public class ExceptionInterceptor extends BaseInterceptor
Interceptor that detects any operations that breaks integrity
of Partition and terminates the current invocation chain by
throwing a Exception. Those operations include when an entry
already exists at a Dn and is added once again to the same Dn.| Modifier and Type | Field and Description |
|---|---|
private static int |
DEFAULT_CACHE_SIZE
Declare a default for this cache.
|
private PartitionNexus |
nexus |
private org.apache.commons.collections.map.LRUMap |
notAliasCache
A cache to store entries which are not aliases.
|
private org.apache.directory.api.ldap.model.name.Dn |
subschemSubentryDn |
directoryService, dnFactory, PWD_POLICY_STATE_ATTRIBUTE_TYPES, schemaManager| Constructor and Description |
|---|
ExceptionInterceptor()
Creates an interceptor that is also the exception handling service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AddOperationContext addContext)
In the pre-invocation state this interceptor method checks to see if the entry to be added already exists.
|
private void |
assertHasEntry(OperationContext opContext,
java.lang.String msg)
Asserts that an entry is present and as a side effect if it is not, creates a LdapNoSuchObjectException, which is
used to set the before exception on the invocation - eventually the exception is thrown.
|
void |
delete(DeleteOperationContext deleteContext)
Checks to make sure the entry being deleted exists, and has no children, otherwise throws the appropriate
LdapException.
|
void |
destroy()
This method does nothing by default.
|
void |
init(DirectoryService directoryService)
This method does nothing by default.
|
void |
modify(ModifyOperationContext modifyContext)
Filters
Partition#modify( ModifyOperationContext ) call. |
void |
move(MoveOperationContext moveContext)
Filters
Partition#move( MoveOperationContext ) call. |
void |
moveAndRename(MoveAndRenameOperationContext moveAndRenameContext)
Filters
Partition#moveAndRename( MoveAndRenameOperationContext) call. |
void |
rename(RenameOperationContext renameContext)
Filters
Partition#rename( RenameOperationContext ) call. |
private PartitionNexus nexus
private org.apache.directory.api.ldap.model.name.Dn subschemSubentryDn
private final org.apache.commons.collections.map.LRUMap notAliasCache
private static final int DEFAULT_CACHE_SIZE
public ExceptionInterceptor()
public void init(DirectoryService directoryService) throws org.apache.directory.api.ldap.model.exception.LdapException
init in interface Interceptorinit in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void destroy()
BaseInterceptordestroy in interface Interceptordestroy in class BaseInterceptorpublic void add(AddOperationContext addContext) throws org.apache.directory.api.ldap.model.exception.LdapException
add in interface Interceptoradd in class BaseInterceptoraddContext - The AddOperationContext instanceorg.apache.directory.api.ldap.model.exception.LdapException - If we had some error while processing the Add operationpublic void delete(DeleteOperationContext deleteContext) throws org.apache.directory.api.ldap.model.exception.LdapException
delete in interface Interceptordelete in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void modify(ModifyOperationContext modifyContext) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition#modify( ModifyOperationContext ) call.modify in interface Interceptormodify in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void move(MoveOperationContext moveContext) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition#move( MoveOperationContext ) call.move in interface Interceptormove in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void moveAndRename(MoveAndRenameOperationContext moveAndRenameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition#moveAndRename( MoveAndRenameOperationContext) call.moveAndRename in interface InterceptormoveAndRename in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void rename(RenameOperationContext renameContext) throws org.apache.directory.api.ldap.model.exception.LdapException
Partition#rename( RenameOperationContext ) call.rename in interface Interceptorrename in class BaseInterceptororg.apache.directory.api.ldap.model.exception.LdapExceptionprivate void assertHasEntry(OperationContext opContext, java.lang.String msg) throws org.apache.directory.api.ldap.model.exception.LdapException
msg - the message to prefix to the distinguished name for explanationnextInterceptor - the next interceptor in the chainjava.lang.Exception - if the entry does not existorg.apache.directory.api.ldap.model.exception.LdapException