Class LoggingSchemaErrorHandler

java.lang.Object
org.apache.directory.api.ldap.model.schema.LoggingSchemaErrorHandler
All Implemented Interfaces:
SchemaErrorHandler

public class LoggingSchemaErrorHandler extends Object implements SchemaErrorHandler
Schema error handler that is logging the messages. The implementation also remembers the errors in a list.
Author:
Apache Directory Project
  • Constructor Details

    • LoggingSchemaErrorHandler

      public LoggingSchemaErrorHandler()
  • Method Details

    • handle

      public void handle(org.slf4j.Logger log, String message, Throwable exception)
      Description copied from interface: SchemaErrorHandler
      Handle schema error. Implementation is free to log the error, ignore the error or do anything else. If the error is not ignored then implementation should remember the error and reflect that in its state. Other methods of this interface should behave in accord with that state.
      Specified by:
      handle in interface SchemaErrorHandler
      Parameters:
      log - Logger that could be used to record error messages.
      message - Error message.
      exception - Exception (if available). Exception may provide more structured description of the error. But it may not be available for all error states. However, only those invocations of handle() method that contain an exceptions are considered to be errors. The implementation may ignore any invocations that do not contain exception.
    • log

      protected void log(org.slf4j.Logger log, String message)
    • wasError

      public boolean wasError()
      Description copied from interface: SchemaErrorHandler
      Returns true if the implementation handled at least one error. This method is used for checks whether the schema processing should proceed or stop, e.g. in cases when we want to stop processing on errors.
      Specified by:
      wasError in interface SchemaErrorHandler
      Returns:
      true if at least one error was met
    • getErrors

      public List<Throwable> getErrors()
      Description copied from interface: SchemaErrorHandler
      Returns list of handled errors.
      Specified by:
      getErrors in interface SchemaErrorHandler
      Returns:
      The list of found errors
    • reset

      public void reset()
      Description copied from interface: SchemaErrorHandler
      Resets implementation state. This cleans up any recorded errors.
      Specified by:
      reset in interface SchemaErrorHandler