org.opends.server.admin
Class GenericConstraint

java.lang.Object
  extended by org.opends.server.admin.Constraint
      extended by org.opends.server.admin.GenericConstraint

public class GenericConstraint
extends Constraint

A generic constraint which comprises of an underlying condition and a description. The condition must evaluate to true in order for a new managed object to be created or modified.


Constructor Summary
GenericConstraint(AbstractManagedObjectDefinition<?,?> definition, int id, Condition condition)
          Creates a new generic constraint.
 
Method Summary
 java.util.Collection<ClientConstraintHandler> getClientConstraintHandlers()
          Gets the client-side constraint handlers which will be used to enforce this constraint in client applications.
 java.util.Collection<ServerConstraintHandler> getServerConstraintHandlers()
          Gets the server-side constraint handlers which will be used to enforce this constraint within the server.
 Message getSynopsis()
          Gets the synopsis of this constraint in the default locale.
 Message getSynopsis(java.util.Locale locale)
          Gets the synopsis of this constraint in the specified locale.
protected  void initialize()
          Initializes this constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericConstraint

public GenericConstraint(AbstractManagedObjectDefinition<?,?> definition,
                         int id,
                         Condition condition)
Creates a new generic constraint.

Parameters:
definition - The managed object definition associated with this constraint.
id - The constraint ID.
condition - The condition associated with this constraint.
Method Detail

getClientConstraintHandlers

public java.util.Collection<ClientConstraintHandler> getClientConstraintHandlers()
Gets the client-side constraint handlers which will be used to enforce this constraint in client applications. The default implementation is to return an empty set of client constraint handlers.

Overrides:
getClientConstraintHandlers in class Constraint
Returns:
Returns the client-side constraint handlers which will be used to enforce this constraint in client applications. The returned collection must not be null but maybe empty (indicating that the constraint can only be enforced on the server-side).

getServerConstraintHandlers

public java.util.Collection<ServerConstraintHandler> getServerConstraintHandlers()
Gets the server-side constraint handlers which will be used to enforce this constraint within the server. The default implementation is to return an empty set of server constraint handlers.

Overrides:
getServerConstraintHandlers in class Constraint
Returns:
Returns the server-side constraint handlers which will be used to enforce this constraint within the server. The returned collection must not be null and must not be empty, since constraints must always be enforced on the server.

getSynopsis

public final Message getSynopsis()
Gets the synopsis of this constraint in the default locale.

Returns:
Returns the synopsis of this constraint in the default locale.

getSynopsis

public final Message getSynopsis(java.util.Locale locale)
Gets the synopsis of this constraint in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the synopsis of this constraint in the specified locale.

initialize

protected void initialize()
                   throws java.lang.Exception
Initializes this constraint. The default implementation is to do nothing.

Overrides:
initialize in class Constraint
Throws:
java.lang.Exception - If this constraint could not be initialized.