org.opends.server.extensions
Class EntryCacheCommon.ConfigErrorHandler

java.lang.Object
  extended by org.opends.server.extensions.EntryCacheCommon.ConfigErrorHandler
Enclosing class:
EntryCacheCommon

public class EntryCacheCommon.ConfigErrorHandler
extends java.lang.Object

Error handler used by local methods to report configuration error. The error handler simplifies the code of initializeEntryCache(), isConfigurationChangeAcceptable() and applyConfigurationChanges() methods.


Constructor Summary
EntryCacheCommon.ConfigErrorHandler(EntryCacheCommon.ConfigPhase configPhase, java.util.List<Message> unacceptableReasons, java.util.ArrayList<Message> errorMessages)
          Create an error handler.
 
Method Summary
 EntryCacheCommon.ConfigPhase getConfigPhase()
          Get the current configuration phase.
 java.util.ArrayList<Message> getErrorMessages()
          Get the current error messages.
 boolean getIsAcceptable()
          Get the current isAcceptable flag.
 boolean getIsAdminActionRequired()
          Get the current isAdminActionRequired flag as determined after apply action has been taken on a given configuration.
 ResultCode getResultCode()
          Get the current result code that was elaborated right after a configuration has been applied.
 java.util.List<Message> getUnacceptableReasons()
          Get the current unacceptable reasons.
 void reportError(Message error, boolean isAcceptable, ResultCode resultCode)
          Report an error.
 void reportError(Message error, boolean isAcceptable, ResultCode resultCode, boolean isAdminActionRequired)
          Report an error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryCacheCommon.ConfigErrorHandler

public EntryCacheCommon.ConfigErrorHandler(EntryCacheCommon.ConfigPhase configPhase,
                                           java.util.List<Message> unacceptableReasons,
                                           java.util.ArrayList<Message> errorMessages)
Create an error handler.

Parameters:
configPhase - the configuration phase for which the error handler is used
unacceptableReasons - the reasons why the configuration cannot be applied (during PHASE_ACCEPTABLE phase)
errorMessages - the errors found when applying a new configuration (during PHASE_APPLY phase)
Method Detail

reportError

public void reportError(Message error,
                        boolean isAcceptable,
                        ResultCode resultCode)
Report an error.

Parameters:
error - the error to report
isAcceptable - true if the configuration is acceptable
resultCode - the change result for the current configuration

reportError

public void reportError(Message error,
                        boolean isAcceptable,
                        ResultCode resultCode,
                        boolean isAdminActionRequired)
Report an error.

Parameters:
error - the error to report
isAcceptable - true if the configuration is acceptable
resultCode - the change result for the current configuration
isAdminActionRequired - true if administrative action is required or false otherwise

getResultCode

public ResultCode getResultCode()
Get the current result code that was elaborated right after a configuration has been applied.

Returns:
the current result code

getIsAcceptable

public boolean getIsAcceptable()
Get the current isAcceptable flag. The isAcceptable flag is elaborated right after the configuration was checked.

Returns:
the isAcceptable flag

getUnacceptableReasons

public java.util.List<Message> getUnacceptableReasons()
Get the current unacceptable reasons. The unacceptable reasons are elaborated when the configuration is checked.

Returns:
the list of unacceptable reasons

getErrorMessages

public java.util.ArrayList<Message> getErrorMessages()
Get the current error messages. The error messages are elaborated when the configuration is applied.

Returns:
the list of error messages

getConfigPhase

public EntryCacheCommon.ConfigPhase getConfigPhase()
Get the current configuration phase. The configuration phase indicates whether the entry cache is in initialization step, or in configuration checking step or in configuration being applied step.

Returns:
the current configuration phase.

getIsAdminActionRequired

public boolean getIsAdminActionRequired()
Get the current isAdminActionRequired flag as determined after apply action has been taken on a given configuration.

Returns:
the isAdminActionRequired flag