Class EntryCacheCommon.ConfigErrorHandler

  • Enclosing class:
    EntryCacheCommon

    public static class EntryCacheCommon.ConfigErrorHandler
    extends Object
    Error handler used by local methods to report configuration error. The error handler simplifies the code of initializeEntryCache(), isConfigurationChangeAcceptable() and applyConfigurationChanges() methods.
    • Constructor Detail

      • ConfigErrorHandler

        public ConfigErrorHandler​(EntryCacheCommon.ConfigPhase configPhase,
                                  List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons,
                                  List<org.forgerock.i18n.LocalizableMessage> 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​(org.forgerock.i18n.LocalizableMessage 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​(org.forgerock.i18n.LocalizableMessage 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 List<org.forgerock.i18n.LocalizableMessage> getUnacceptableReasons()
        Get the current unacceptable reasons. The unacceptable reasons are elaborated when the configuration is checked.
        Returns:
        the list of unacceptable reasons
      • getErrorMessages

        public List<org.forgerock.i18n.LocalizableMessage> 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