|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.admin.server.ServerConstraintHandler
public abstract class ServerConstraintHandler
An interface for performing server-side constraint validation.
Constraints are evaluated immediately before and after write
operations are performed. Server-side constraints are evaluated in
two phases: the first phase determines if the proposed add, delete,
or modification is acceptable according to the constraint. If one
or more constraints fails, the write write operation is refused,
and the client will receive an
OperationRejectedException
exception. The second
phase is invoked once the add, delete, or modification request has
been allowed and any changes applied. The second phase gives the
constraint handler a chance to register listener call-backs if
required.
A server constraint handler must override at least one of the provided methods.
Constraint
Constructor Summary | |
---|---|
protected |
ServerConstraintHandler()
Creates a new server constraint handler. |
Method Summary | |
---|---|
boolean |
isDeleteAllowed(ServerManagedObject<?> managedObject,
java.util.Collection<Message> unacceptableReasons)
Determines whether or not the existing managed object can be deleted from the server's configuration. |
boolean |
isUsable(ServerManagedObject<?> managedObject,
java.util.Collection<Message> unacceptableReasons)
Determines whether or not the provided managed object can be used by the server. |
void |
performPostAdd(ServerManagedObject<?> managedObject)
Performs any post-add processing required by this constraint. |
void |
performPostDelete(ServerManagedObject<?> managedObject)
Performs any post-delete processing required by this constraint. |
void |
performPostModify(ServerManagedObject<?> managedObject)
Performs any post-modify processing required by this constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ServerConstraintHandler()
Method Detail |
---|
public boolean isDeleteAllowed(ServerManagedObject<?> managedObject, java.util.Collection<Message> unacceptableReasons) throws ConfigException
If the constraint is not satisfied, the implementation must
return false
and add a message describing why the
managed object cannot be deleted.
The default implementation is to return true
.
managedObject
- The managed object which is about to be deleted.unacceptableReasons
- A list of messages to which error messages should be
added.
true
if this constraint is
satisfied, or false
if it is not and the
managed object cannot be deleted.
ConfigException
- If an configuration exception prevented this constraint
from being evaluated.public boolean isUsable(ServerManagedObject<?> managedObject, java.util.Collection<Message> unacceptableReasons) throws ConfigException
If the constraint is not satisfied, the implementation must
return false
and add a message describing why the
managed object is not usable.
The default implementation is to return true
.
managedObject
- The new managed object.unacceptableReasons
- A list of messages to which error messages should be
added.
true
if this constraint is
satisfied, or false
if it is not and the
managed object cannot be used.
ConfigException
- If an configuration exception prevented this constraint
from being evaluated.public void performPostAdd(ServerManagedObject<?> managedObject) throws ConfigException
The default implementation is to do nothing.
managedObject
- The managed object which has just been added to the
server's configuration.
ConfigException
- If the post-add processing fails due to a configuration
exception.public void performPostDelete(ServerManagedObject<?> managedObject) throws ConfigException
The default implementation is to do nothing.
managedObject
- The managed object which was deleted.
ConfigException
- If the post-delete processing fails due to a
configuration exception.public void performPostModify(ServerManagedObject<?> managedObject) throws ConfigException
The default implementation is to do nothing.
managedObject
- The managed object which was modified.
ConfigException
- If the post-modify processing fails due to a
configuration exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |