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.voidhandle(Logger log, String message, Throwable exception)Handle schema error.protected voidlog(Logger log, String message)voidreset()Resets implementation state.booleanwasError()Returns true if the implementation handled at least one error.
-
-
-
Method Detail
-
handle
public void handle(Logger log, String message, Throwable exception)
Description copied from interface:SchemaErrorHandlerHandle 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:
handlein 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:SchemaErrorHandlerReturns 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:
wasErrorin interfaceSchemaErrorHandler- Returns:
- true if at least one error was met
-
getErrors
public List<Throwable> getErrors()
Description copied from interface:SchemaErrorHandlerReturns list of handled errors.- Specified by:
getErrorsin interfaceSchemaErrorHandler- Returns:
- The list of found errors
-
reset
public void reset()
Description copied from interface:SchemaErrorHandlerResets implementation state. This cleans up any recorded errors.- Specified by:
resetin interfaceSchemaErrorHandler
-
-