org.opends.server.admin.server
Class ConstraintViolationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.opends.server.types.OpenDsException
              extended by org.opends.server.admin.AdminException
                  extended by org.opends.server.admin.OperationsException
                      extended by org.opends.server.admin.DecodingException
                          extended by org.opends.server.admin.server.ConstraintViolationException
All Implemented Interfaces:
java.io.Serializable

public class ConstraintViolationException
extends DecodingException

This exception is thrown when the server refuses to use or delete a managed object due to one or more constraints that cannot be satisfied.

See Also:
Serialized Form

Constructor Summary
ConstraintViolationException(ServerManagedObject<?> managedObject, java.util.Collection<Message> messages)
          Creates a new constraint violation exception with the provided messages.
ConstraintViolationException(ServerManagedObject<?> managedObject, Message message)
          Creates a new constraint violation exception with the provided message.
 
Method Summary
 ServerManagedObject<?> getManagedObject()
          Gets the server managed object which caused the constraint violations.
 java.util.Collection<Message> getMessages()
          Gets an unmodifiable collection view of the messages describing the constraint violations that occurred.
 Message getMessagesAsSingleMessage()
          Creates a single message listing all the messages combined into a single list separated by semi-colons.
 
Methods inherited from class org.opends.server.types.OpenDsException
getMessageObject
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstraintViolationException

public ConstraintViolationException(ServerManagedObject<?> managedObject,
                                    java.util.Collection<Message> messages)
Creates a new constraint violation exception with the provided messages.

Parameters:
managedObject - The server managed object which caused the constraint violations.
messages - The messages describing the constraint violations that occurred (must be non-null and non-empty).

ConstraintViolationException

public ConstraintViolationException(ServerManagedObject<?> managedObject,
                                    Message message)
Creates a new constraint violation exception with the provided message.

Parameters:
managedObject - The server managed object which caused the constraint violations.
message - The message describing the constraint violation that occurred.
Method Detail

getMessages

public java.util.Collection<Message> getMessages()
Gets an unmodifiable collection view of the messages describing the constraint violations that occurred.

Returns:
Returns an unmodifiable collection view of the messages describing the constraint violations that occurred.

getMessagesAsSingleMessage

public Message getMessagesAsSingleMessage()
Creates a single message listing all the messages combined into a single list separated by semi-colons.

Returns:
Returns a single message listing all the messages combined into a single list separated by semi-colons.

getManagedObject

public ServerManagedObject<?> getManagedObject()
Gets the server managed object which caused the constraint violations.

Returns:
Returns the server managed object which caused the constraint violations.