org.opends.server.admin
Class Constraint

java.lang.Object
  extended by org.opends.server.admin.Constraint
Direct Known Subclasses:
GenericConstraint

public abstract class Constraint
extends java.lang.Object

An interface for enforcing constraints and dependencies between managed objects and their properties. Constraints express relationships between managed objects and their properties, for example:

On the client-side constraints are enforced immediately before a write operation is performed. That is to say, immediately before a new managed object is created, changes to a managed object are applied, or an existing managed object is deleted.


Constructor Summary
protected Constraint()
          Creates a new 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.
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

Constraint

protected Constraint()
Creates a new 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.

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.

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.

initialize

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

Throws:
java.lang.Exception - If this constraint could not be initialized.