org.apache.ldap.server.exception
Class ExceptionService

java.lang.Object
  extended byorg.apache.ldap.server.interceptor.BaseInterceptor
      extended byorg.apache.ldap.server.exception.ExceptionService
All Implemented Interfaces:
Interceptor

public class ExceptionService
extends BaseInterceptor

An Interceptor that detects any operations that breaks integrity of ContextPartition and terminates the current invocation chain by throwing a NamingException. Those operations include when an entry already exists at a DN and is added once again to the same DN.

Version:
$Rev: 264732 $
Author:
Apache Directory Project

Constructor Summary
ExceptionService()
          Creates an interceptor that is also the exception handling service.
 
Method Summary
 void add(NextInterceptor nextInterceptor, java.lang.String upName, javax.naming.Name normName, javax.naming.directory.Attributes entry)
          In the pre-invocation state this interceptor method checks to see if the entry to be added already exists.
 void delete(NextInterceptor nextInterceptor, javax.naming.Name name)
          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(ContextFactoryConfiguration factoryCfg, InterceptorConfiguration cfg)
          This method does nothing by default.
 javax.naming.NamingEnumeration list(NextInterceptor nextInterceptor, javax.naming.Name baseName)
          Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
 javax.naming.directory.Attributes lookup(NextInterceptor nextInterceptor, javax.naming.Name name)
          Checks to make sure the entry being looked up exists other wise throws the appropriate LdapException.
 javax.naming.directory.Attributes lookup(NextInterceptor nextInterceptor, javax.naming.Name name, java.lang.String[] attrIds)
          Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
 void modify(NextInterceptor nextInterceptor, javax.naming.Name name, int modOp, javax.naming.directory.Attributes attrs)
          Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
 void modify(NextInterceptor nextInterceptor, javax.naming.Name name, javax.naming.directory.ModificationItem[] items)
          Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
 void modifyRn(NextInterceptor nextInterceptor, javax.naming.Name dn, java.lang.String newRn, boolean deleteOldRn)
          Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.
 void move(NextInterceptor nextInterceptor, javax.naming.Name oriChildName, javax.naming.Name newParentName)
          Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.
 void move(NextInterceptor nextInterceptor, javax.naming.Name oriChildName, javax.naming.Name newParentName, java.lang.String newRn, boolean deleteOldRn)
          Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate LdapException.
 javax.naming.NamingEnumeration search(NextInterceptor nextInterceptor, javax.naming.Name base, java.util.Map env, org.apache.ldap.common.filter.ExprNode filter, javax.naming.directory.SearchControls searchCtls)
          Checks to see the entry being searched exists, otherwise throws the appropriate LdapException.
 
Methods inherited from class org.apache.ldap.server.interceptor.BaseInterceptor
addContextPartition, getContext, getMatchedName, getPrincipal, getRootDSE, getSuffix, hasEntry, isSuffix, listSuffixes, removeContextPartition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionService

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

Method Detail

init

public void init(ContextFactoryConfiguration factoryCfg,
                 InterceptorConfiguration cfg)
Description copied from class: BaseInterceptor
This method does nothing by default.

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

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,
                java.lang.String upName,
                javax.naming.Name normName,
                javax.naming.directory.Attributes entry)
         throws javax.naming.NamingException
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:
javax.naming.NamingException

delete

public void delete(NextInterceptor nextInterceptor,
                   javax.naming.Name name)
            throws javax.naming.NamingException
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:
javax.naming.NamingException

list

public javax.naming.NamingEnumeration list(NextInterceptor nextInterceptor,
                                           javax.naming.Name baseName)
                                    throws javax.naming.NamingException
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:
javax.naming.NamingException

lookup

public javax.naming.directory.Attributes lookup(NextInterceptor nextInterceptor,
                                                javax.naming.Name name)
                                         throws javax.naming.NamingException
Checks to make sure the entry being looked up exists other wise throws the appropriate LdapException.

Specified by:
lookup in interface Interceptor
Overrides:
lookup in class BaseInterceptor
Throws:
javax.naming.NamingException

lookup

public javax.naming.directory.Attributes lookup(NextInterceptor nextInterceptor,
                                                javax.naming.Name name,
                                                java.lang.String[] attrIds)
                                         throws javax.naming.NamingException
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:
javax.naming.NamingException

modify

public void modify(NextInterceptor nextInterceptor,
                   javax.naming.Name name,
                   int modOp,
                   javax.naming.directory.Attributes attrs)
            throws javax.naming.NamingException
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:
javax.naming.NamingException

modify

public void modify(NextInterceptor nextInterceptor,
                   javax.naming.Name name,
                   javax.naming.directory.ModificationItem[] items)
            throws javax.naming.NamingException
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:
javax.naming.NamingException

modifyRn

public void modifyRn(NextInterceptor nextInterceptor,
                     javax.naming.Name dn,
                     java.lang.String newRn,
                     boolean deleteOldRn)
              throws javax.naming.NamingException
Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.

Specified by:
modifyRn in interface Interceptor
Overrides:
modifyRn in class BaseInterceptor
Throws:
javax.naming.NamingException

move

public void move(NextInterceptor nextInterceptor,
                 javax.naming.Name oriChildName,
                 javax.naming.Name newParentName)
          throws javax.naming.NamingException
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:
javax.naming.NamingException

move

public void move(NextInterceptor nextInterceptor,
                 javax.naming.Name oriChildName,
                 javax.naming.Name newParentName,
                 java.lang.String newRn,
                 boolean deleteOldRn)
          throws javax.naming.NamingException
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:
javax.naming.NamingException

search

public javax.naming.NamingEnumeration search(NextInterceptor nextInterceptor,
                                             javax.naming.Name base,
                                             java.util.Map env,
                                             org.apache.ldap.common.filter.ExprNode filter,
                                             javax.naming.directory.SearchControls searchCtls)
                                      throws javax.naming.NamingException
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:
javax.naming.NamingException