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 Summary
Constructors Constructor Description LoggingSchemaErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Throwable>
getErrors()
Returns list of handled errors.void
handle(org.slf4j.Logger log, String message, Throwable exception)
Handle schema error.void
reset()
Resets implementation state.boolean
wasError()
Returns true if the implementation handled at least one error.
-
-
-
Constructor Detail
-
LoggingSchemaErrorHandler
public LoggingSchemaErrorHandler()
-
-
Method Detail
-
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 interfaceSchemaErrorHandler
- 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.
-
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 interfaceSchemaErrorHandler
- 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 interfaceSchemaErrorHandler
- 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 interfaceSchemaErrorHandler
-
-