org.opends.server.admin.condition
Class ContainsCondition

java.lang.Object
  extended by org.opends.server.admin.condition.ContainsCondition
All Implemented Interfaces:
Condition

public final class ContainsCondition
extends java.lang.Object
implements Condition

A condition which evaluates to true if and only if a property contains a particular value.


Constructor Summary
ContainsCondition(java.lang.String propertyName, java.lang.String stringValue)
          Creates a new contains value condition.
 
Method Summary
 boolean evaluate(ManagementContext context, ManagedObject<?> managedObject)
          Evaluates this condition against the provided client managed object.
 boolean evaluate(ServerManagedObject<?> managedObject)
          Evaluates this condition against the provided server managed object.
 PropertyDefinition<?> getPropertyDefinition()
          Returns the property definition associated with this condition.
 java.lang.Object getValue()
          Returns the value that must be set for this condition to be fulfilled.
 void initialize(AbstractManagedObjectDefinition<?,?> d)
          Initializes this condition.
 void setPropertyValue(ManagedObject<?> managedObject)
          Modifies the provided managed object so that it has the property value associated with this condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainsCondition

public ContainsCondition(java.lang.String propertyName,
                         java.lang.String stringValue)
Creates a new contains value condition.

Parameters:
propertyName - The property name.
stringValue - The string representation of the required property value.
Method Detail

evaluate

public boolean evaluate(ManagementContext context,
                        ManagedObject<?> managedObject)
                 throws AuthorizationException,
                        CommunicationException
Evaluates this condition against the provided client managed object.

Specified by:
evaluate in interface Condition
Parameters:
context - The client management context.
managedObject - The client managed object.
Returns:
Returns true if this condition is satisfied.
Throws:
AuthorizationException - If the condition could not be evaluated due to an authorization problem.
CommunicationException - If the condition could not be evaluated due to an communication problem.

evaluate

public boolean evaluate(ServerManagedObject<?> managedObject)
                 throws ConfigException
Evaluates this condition against the provided server managed object.

Specified by:
evaluate in interface Condition
Parameters:
managedObject - The server managed object.
Returns:
Returns true if this condition is satisfied.
Throws:
ConfigException - If the condition could not be evaluated due to an unexpected configuration exception.

setPropertyValue

public void setPropertyValue(ManagedObject<?> managedObject)
Modifies the provided managed object so that it has the property value associated with this condition.

Parameters:
managedObject - The managed object.

initialize

public void initialize(AbstractManagedObjectDefinition<?,?> d)
                throws java.lang.Exception
Initializes this condition.

Specified by:
initialize in interface Condition
Parameters:
d - The abstract managed object definition associated with this condition.
Throws:
java.lang.Exception - If this condition could not be initialized.

getPropertyDefinition

public PropertyDefinition<?> getPropertyDefinition()
Returns the property definition associated with this condition.

Returns:
the property definition associated with this condition.

getValue

public java.lang.Object getValue()
Returns the value that must be set for this condition to be fulfilled.

Returns:
the value that must be set for this condition to be fulfilled.