org.apache.directory.server.core.exception
Class ExceptionInterceptor

java.lang.Object
  extended by org.apache.directory.server.core.interceptor.BaseInterceptor
      extended by org.apache.directory.server.core.exception.ExceptionInterceptor
All Implemented Interfaces:
Interceptor

public class ExceptionInterceptor
extends BaseInterceptor

An 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.

Version:
$Rev: 927839 $
Author:
Apache Directory Project
XBean

Constructor Summary
ExceptionInterceptor()
          Creates an interceptor that is also the exception handling service.
 
Method Summary
 void add(NextInterceptor nextInterceptor, AddOperationContext opContext)
          In the pre-invocation state this interceptor method checks to see if the entry to be added already exists.
 void delete(NextInterceptor nextInterceptor, DeleteOperationContext opContext)
          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.
 EntryFilteringCursor list(NextInterceptor nextInterceptor, ListOperationContext opContext)
          Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
 ClonedServerEntry lookup(NextInterceptor nextInterceptor, LookupOperationContext opContext)
          Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
 void modify(NextInterceptor nextInterceptor, ModifyOperationContext opContext)
          Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
 void move(NextInterceptor nextInterceptor, MoveOperationContext opContext)
          Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.
 void moveAndRename(NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext)
          Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.
 void rename(NextInterceptor nextInterceptor, RenameOperationContext opContext)
          Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.
 EntryFilteringCursor search(NextInterceptor nextInterceptor, SearchOperationContext opContext)
          Checks to see the entry being searched exists, otherwise throws the appropriate LdapException.
 
Methods inherited from class org.apache.directory.server.core.interceptor.BaseInterceptor
addContextPartition, bind, compare, getContext, getMatchedName, getName, getPrincipal, getRootDSE, getSuffix, hasEntry, listSuffixes, removeContextPartition, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionInterceptor

public ExceptionInterceptor()
Creates an interceptor that is also the exception handling service.

Method Detail

init

public void init(DirectoryService directoryService)
          throws java.lang.Exception
Description copied from class: BaseInterceptor
This method does nothing by default.

Specified by:
init in interface Interceptor
Overrides:
init in class BaseInterceptor
Throws:
java.lang.Exception

destroy

public void destroy()
Description copied from class: BaseInterceptor
This method does nothing by default.

Specified by:
destroy in interface Interceptor
Overrides:
destroy in class BaseInterceptor

add

public void add(NextInterceptor nextInterceptor,
                AddOperationContext opContext)
         throws java.lang.Exception
In the pre-invocation state this interceptor method checks to see if the entry to be added already exists. If it does an exception is raised.

Specified by:
add in interface Interceptor
Overrides:
add in class BaseInterceptor
Throws:
java.lang.Exception

delete

public void delete(NextInterceptor nextInterceptor,
                   DeleteOperationContext opContext)
            throws java.lang.Exception
Checks to make sure the entry being deleted exists, and has no children, otherwise throws the appropriate LdapException.

Specified by:
delete in interface Interceptor
Overrides:
delete in class BaseInterceptor
Throws:
java.lang.Exception

list

public EntryFilteringCursor list(NextInterceptor nextInterceptor,
                                 ListOperationContext opContext)
                          throws java.lang.Exception
Checks to see the base being searched exists, otherwise throws the appropriate LdapException.

Specified by:
list in interface Interceptor
Overrides:
list in class BaseInterceptor
Throws:
java.lang.Exception

lookup

public ClonedServerEntry lookup(NextInterceptor nextInterceptor,
                                LookupOperationContext opContext)
                         throws java.lang.Exception
Checks to see the base being searched exists, otherwise throws the appropriate LdapException.

Specified by:
lookup in interface Interceptor
Overrides:
lookup in class BaseInterceptor
Throws:
java.lang.Exception

modify

public void modify(NextInterceptor nextInterceptor,
                   ModifyOperationContext opContext)
            throws java.lang.Exception
Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.

Specified by:
modify in interface Interceptor
Overrides:
modify in class BaseInterceptor
Throws:
java.lang.Exception

rename

public void rename(NextInterceptor nextInterceptor,
                   RenameOperationContext opContext)
            throws java.lang.Exception
Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.

Specified by:
rename in interface Interceptor
Overrides:
rename in class BaseInterceptor
Throws:
java.lang.Exception

move

public void move(NextInterceptor nextInterceptor,
                 MoveOperationContext opContext)
          throws java.lang.Exception
Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.

Specified by:
move in interface Interceptor
Overrides:
move in class BaseInterceptor
Throws:
java.lang.Exception

moveAndRename

public void moveAndRename(NextInterceptor nextInterceptor,
                          MoveAndRenameOperationContext opContext)
                   throws java.lang.Exception
Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.

Specified by:
moveAndRename in interface Interceptor
Overrides:
moveAndRename in class BaseInterceptor
Throws:
java.lang.Exception

search

public EntryFilteringCursor search(NextInterceptor nextInterceptor,
                                   SearchOperationContext opContext)
                            throws java.lang.Exception
Checks to see the entry being searched exists, otherwise throws the appropriate LdapException.

Specified by:
search in interface Interceptor
Overrides:
search in class BaseInterceptor
Throws:
java.lang.Exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.