org.apache.ldap.server.interceptor
Interface Interceptor

All Known Implementing Classes:
AuthenticationService, AuthorizationService, BaseInterceptor, CollectiveAttributeService, EventService, ExceptionService, NormalizationService, OldAuthorizationService, OperationalAttributeService, SchemaService, SubentryService

public interface Interceptor

Filters invocations on DirectoryPartitionNexus. Interceptor filters most method calls performed on DirectoryPartitionNexus just like Servlet filters do.

Interceptor Chaining

Interceptors should usually pass the control of current invocation to the next interceptor by calling an appropriate method on NextInterceptor. The flow control is returned when the next interceptor's filter method returns. You can therefore implement pre-, post-, around- invocation handler by how you place the statement. Otherwise, you can transform the invocation into other(s).

Pre-invocation Filtering

 public void delete( NextInterceptor nextInterceptor, Name name )
 {
     System.out.println( "Starting invocation." );
     nextInterceptor.delete( name );
 }
 

Post-invocation Filtering

 public void delete( NextInterceptor nextInterceptor, Name name )
 {
     nextInterceptor.delete( name );
     System.out.println( "Invocation ended." );
 }
 

Around-invocation Filtering

 public void delete( NextInterceptor nextInterceptor, Name name )
 {
     long startTime = System.currentTimeMillis();
     try
     {
         nextInterceptor.delete( name );
     }
     finally
     {
         long endTime = System.currentTimeMillis();
         System.out.println( ( endTime - startTime ) + "ms elapsed." );
     }
 }
 

Transforming invocations

 public void delete( NextInterceptor nextInterceptor, Name name )
 {
     // transform deletion into modification.
     Attribute mark = new BasicAttribute( "entryDeleted", "true" );
     nextInterceptor.modify( name, DirContext.REPLACE_ATTRIBUTE, mark );
 }
 

Version:
$Rev: 307234 $, $Date: 2005-10-07 21:43:33 -0400 (Fri, 07 Oct 2005) $
Author:
Apache Directory Project
See Also:
NextInterceptor

Method Summary
 void add(NextInterceptor next, java.lang.String userProvidedName, javax.naming.Name normalizedName, javax.naming.directory.Attributes entry)
          Filters DirectoryPartition.add(String, Name, Attributes) call.
 void addContextPartition(NextInterceptor next, DirectoryPartitionConfiguration cfg)
          Filters DirectoryPartitionNexus.addContextPartition(DirectoryPartitionConfiguration) call.
 boolean compare(NextInterceptor next, javax.naming.Name name, java.lang.String oid, java.lang.Object value)
          Filters DirectoryPartitionNexus.compare(Name,String,Object) call.
 void delete(NextInterceptor next, javax.naming.Name name)
          Filters DirectoryPartition.delete(Name) call.
 void destroy()
          Deinitializes this interceptor.
 javax.naming.Name getMatchedName(NextInterceptor next, javax.naming.Name name, boolean normalized)
          Filters DirectoryPartitionNexus.getMatchedName(Name, boolean) call.
 javax.naming.directory.Attributes getRootDSE(NextInterceptor next)
          Filters DirectoryPartitionNexus.getRootDSE() call.
 javax.naming.Name getSuffix(NextInterceptor next, javax.naming.Name name, boolean normalized)
          Filters DirectoryPartitionNexus.getSuffix(Name, boolean) call.
 boolean hasEntry(NextInterceptor next, javax.naming.Name name)
          Filters DirectoryPartition.lookup(Name, String[]) call.
 void init(DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg)
          Intializes this interceptor.
 boolean isSuffix(NextInterceptor next, javax.naming.Name name)
          Filters DirectoryPartition.isSuffix(Name) call.
 javax.naming.NamingEnumeration list(NextInterceptor next, javax.naming.Name baseName)
          Filters DirectoryPartition.list(Name) call.
 java.util.Iterator listSuffixes(NextInterceptor next, boolean normalized)
          Filters DirectoryPartitionNexus.listSuffixes(boolean) call.
 javax.naming.directory.Attributes lookup(NextInterceptor next, javax.naming.Name name)
          Filters DirectoryPartition.lookup(Name) call.
 javax.naming.directory.Attributes lookup(NextInterceptor next, javax.naming.Name dn, java.lang.String[] attrIds)
          Filters DirectoryPartition.lookup(Name, String[]) call.
 void modify(NextInterceptor next, javax.naming.Name name, int modOp, javax.naming.directory.Attributes attributes)
          Filters DirectoryPartition.modify(Name, int, Attributes) call.
 void modify(NextInterceptor next, javax.naming.Name name, javax.naming.directory.ModificationItem[] items)
          Filters DirectoryPartition.modify(Name, ModificationItem[]) call.
 void modifyRn(NextInterceptor next, javax.naming.Name name, java.lang.String newRn, boolean deleteOldRn)
          Filters DirectoryPartition.modifyRn(Name, String, boolean) call.
 void move(NextInterceptor next, javax.naming.Name oldName, javax.naming.Name newParentName)
          Filters DirectoryPartition.move(Name, Name) call.
 void move(NextInterceptor next, javax.naming.Name oldName, javax.naming.Name newParentName, java.lang.String newRn, boolean deleteOldRn)
          Filters DirectoryPartition.move(Name, Name, String, boolean) call.
 void removeContextPartition(NextInterceptor next, javax.naming.Name suffix)
          Filters DirectoryPartitionNexus.removeContextPartition(Name) call.
 javax.naming.NamingEnumeration search(NextInterceptor next, javax.naming.Name baseName, java.util.Map environment, org.apache.ldap.common.filter.ExprNode filter, javax.naming.directory.SearchControls searchControls)
          Filters DirectoryPartition.search(Name, Map, ExprNode, SearchControls) call.
 

Method Detail

init

void init(DirectoryServiceConfiguration factoryCfg,
          InterceptorConfiguration cfg)
          throws javax.naming.NamingException
Intializes this interceptor. This is invoked by InterceptorChain when this intercepter is loaded into interceptor chain.

Throws:
javax.naming.NamingException

destroy

void destroy()
Deinitializes this interceptor. This is invoked by InterceptorChain when this intercepter is unloaded from interceptor chain.


getRootDSE

javax.naming.directory.Attributes getRootDSE(NextInterceptor next)
                                             throws javax.naming.NamingException
Filters DirectoryPartitionNexus.getRootDSE() call.

Throws:
javax.naming.NamingException

getMatchedName

javax.naming.Name getMatchedName(NextInterceptor next,
                                 javax.naming.Name name,
                                 boolean normalized)
                                 throws javax.naming.NamingException
Filters DirectoryPartitionNexus.getMatchedName(Name, boolean) call.

Throws:
javax.naming.NamingException

getSuffix

javax.naming.Name getSuffix(NextInterceptor next,
                            javax.naming.Name name,
                            boolean normalized)
                            throws javax.naming.NamingException
Filters DirectoryPartitionNexus.getSuffix(Name, boolean) call.

Throws:
javax.naming.NamingException

listSuffixes

java.util.Iterator listSuffixes(NextInterceptor next,
                                boolean normalized)
                                throws javax.naming.NamingException
Filters DirectoryPartitionNexus.listSuffixes(boolean) call.

Throws:
javax.naming.NamingException

addContextPartition

void addContextPartition(NextInterceptor next,
                         DirectoryPartitionConfiguration cfg)
                         throws javax.naming.NamingException
Filters DirectoryPartitionNexus.addContextPartition(DirectoryPartitionConfiguration) call.

Throws:
javax.naming.NamingException

removeContextPartition

void removeContextPartition(NextInterceptor next,
                            javax.naming.Name suffix)
                            throws javax.naming.NamingException
Filters DirectoryPartitionNexus.removeContextPartition(Name) call.

Throws:
javax.naming.NamingException

compare

boolean compare(NextInterceptor next,
                javax.naming.Name name,
                java.lang.String oid,
                java.lang.Object value)
                throws javax.naming.NamingException
Filters DirectoryPartitionNexus.compare(Name,String,Object) call.

Throws:
javax.naming.NamingException

delete

void delete(NextInterceptor next,
            javax.naming.Name name)
            throws javax.naming.NamingException
Filters DirectoryPartition.delete(Name) call.

Throws:
javax.naming.NamingException

add

void add(NextInterceptor next,
         java.lang.String userProvidedName,
         javax.naming.Name normalizedName,
         javax.naming.directory.Attributes entry)
         throws javax.naming.NamingException
Filters DirectoryPartition.add(String, Name, Attributes) call.

Throws:
javax.naming.NamingException

modify

void modify(NextInterceptor next,
            javax.naming.Name name,
            int modOp,
            javax.naming.directory.Attributes attributes)
            throws javax.naming.NamingException
Filters DirectoryPartition.modify(Name, int, Attributes) call.

Throws:
javax.naming.NamingException

modify

void modify(NextInterceptor next,
            javax.naming.Name name,
            javax.naming.directory.ModificationItem[] items)
            throws javax.naming.NamingException
Filters DirectoryPartition.modify(Name, ModificationItem[]) call.

Throws:
javax.naming.NamingException

list

javax.naming.NamingEnumeration list(NextInterceptor next,
                                    javax.naming.Name baseName)
                                    throws javax.naming.NamingException
Filters DirectoryPartition.list(Name) call.

Throws:
javax.naming.NamingException

search

javax.naming.NamingEnumeration search(NextInterceptor next,
                                      javax.naming.Name baseName,
                                      java.util.Map environment,
                                      org.apache.ldap.common.filter.ExprNode filter,
                                      javax.naming.directory.SearchControls searchControls)
                                      throws javax.naming.NamingException
Filters DirectoryPartition.search(Name, Map, ExprNode, SearchControls) call.

Throws:
javax.naming.NamingException

lookup

javax.naming.directory.Attributes lookup(NextInterceptor next,
                                         javax.naming.Name name)
                                         throws javax.naming.NamingException
Filters DirectoryPartition.lookup(Name) call.

Throws:
javax.naming.NamingException

lookup

javax.naming.directory.Attributes lookup(NextInterceptor next,
                                         javax.naming.Name dn,
                                         java.lang.String[] attrIds)
                                         throws javax.naming.NamingException
Filters DirectoryPartition.lookup(Name, String[]) call.

Throws:
javax.naming.NamingException

hasEntry

boolean hasEntry(NextInterceptor next,
                 javax.naming.Name name)
                 throws javax.naming.NamingException
Filters DirectoryPartition.lookup(Name, String[]) call.

Throws:
javax.naming.NamingException

isSuffix

boolean isSuffix(NextInterceptor next,
                 javax.naming.Name name)
                 throws javax.naming.NamingException
Filters DirectoryPartition.isSuffix(Name) call.

Throws:
javax.naming.NamingException

modifyRn

void modifyRn(NextInterceptor next,
              javax.naming.Name name,
              java.lang.String newRn,
              boolean deleteOldRn)
              throws javax.naming.NamingException
Filters DirectoryPartition.modifyRn(Name, String, boolean) call.

Throws:
javax.naming.NamingException

move

void move(NextInterceptor next,
          javax.naming.Name oldName,
          javax.naming.Name newParentName)
          throws javax.naming.NamingException
Filters DirectoryPartition.move(Name, Name) call.

Throws:
javax.naming.NamingException

move

void move(NextInterceptor next,
          javax.naming.Name oldName,
          javax.naming.Name newParentName,
          java.lang.String newRn,
          boolean deleteOldRn)
          throws javax.naming.NamingException
Filters DirectoryPartition.move(Name, Name, String, boolean) call.

Throws:
javax.naming.NamingException


Copyright © 2002-2005 . All Rights Reserved.