org.apache.directory.server.core.interceptor
Interface Interceptor

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

public interface Interceptor

Filters invocations on PartitionNexus. Interceptor filters most method calls performed on PartitionNexus 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: 493916 $, $Date: 2007-01-08 03:44:33 +0100 (Mon, 08 Jan 2007) $
Author:
Apache Directory Project
See Also:
NextInterceptor

Method Summary
 void add(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name, javax.naming.directory.Attributes entry)
          Filters Partition.add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes) call.
 void addContextPartition(NextInterceptor next, PartitionConfiguration cfg)
          Filters PartitionNexus.addContextPartition(PartitionConfiguration) call.
 void bind(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN bindDn, byte[] credentials, java.util.List mechanisms, java.lang.String saslAuthId)
          Filters Partition.bind(org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String) call.
 boolean compare(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name, java.lang.String oid, java.lang.Object value)
          Filters PartitionNexus.compare(org.apache.directory.shared.ldap.name.LdapDN,String,Object) call.
 void delete(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters Partition.delete(org.apache.directory.shared.ldap.name.LdapDN) call.
 void destroy()
          Deinitializes this interceptor.
 org.apache.directory.shared.ldap.name.LdapDN getMatchedName(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters PartitionNexus.getMatchedName(org.apache.directory.shared.ldap.name.LdapDN) call.
 javax.naming.directory.Attributes getRootDSE(NextInterceptor next)
          Filters PartitionNexus.getRootDSE() call.
 org.apache.directory.shared.ldap.name.LdapDN getSuffix(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters PartitionNexus.getSuffix(org.apache.directory.shared.ldap.name.LdapDN) call.
 boolean hasEntry(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN,String[]) call.
 void init(DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg)
          Intializes this interceptor.
 boolean isSuffix(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters Partition.isSuffix(org.apache.directory.shared.ldap.name.LdapDN) call.
 javax.naming.NamingEnumeration list(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN baseName)
          Filters Partition.list(org.apache.directory.shared.ldap.name.LdapDN) call.
 java.util.Iterator listSuffixes(NextInterceptor next)
          Filters PartitionNexus.listSuffixes() call.
 javax.naming.directory.Attributes lookup(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name)
          Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN) call.
 javax.naming.directory.Attributes lookup(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN dn, java.lang.String[] attrIds)
          Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN,String[]) call.
 void modify(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name, int modOp, javax.naming.directory.Attributes attributes)
          Filters Partition.modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes) call.
 void modify(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name, org.apache.directory.shared.ldap.message.ModificationItemImpl[] items)
          Filters Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[]) call.
 void modifyRn(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN name, java.lang.String newRn, boolean deleteOldRn)
          Filters Partition.modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean) call.
 void move(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN oldName, org.apache.directory.shared.ldap.name.LdapDN newParentName)
          Filters Partition.move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN) call.
 void move(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN oldName, org.apache.directory.shared.ldap.name.LdapDN newParentName, java.lang.String newRn, boolean deleteOldRn)
          Filters Partition.move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean) call.
 void removeContextPartition(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN suffix)
          Filters PartitionNexus.removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN) call.
 javax.naming.NamingEnumeration search(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN baseName, java.util.Map environment, org.apache.directory.shared.ldap.filter.ExprNode filter, javax.naming.directory.SearchControls searchControls)
          Filters Partition.search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls) call.
 void unbind(NextInterceptor next, org.apache.directory.shared.ldap.name.LdapDN bindDn)
          Filters Partition.unbind(org.apache.directory.shared.ldap.name.LdapDN) 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 PartitionNexus.getRootDSE() call.

Throws:
javax.naming.NamingException

getMatchedName

org.apache.directory.shared.ldap.name.LdapDN getMatchedName(NextInterceptor next,
                                                            org.apache.directory.shared.ldap.name.LdapDN name)
                                                            throws javax.naming.NamingException
Filters PartitionNexus.getMatchedName(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

getSuffix

org.apache.directory.shared.ldap.name.LdapDN getSuffix(NextInterceptor next,
                                                       org.apache.directory.shared.ldap.name.LdapDN name)
                                                       throws javax.naming.NamingException
Filters PartitionNexus.getSuffix(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

listSuffixes

java.util.Iterator listSuffixes(NextInterceptor next)
                                throws javax.naming.NamingException
Filters PartitionNexus.listSuffixes() call.

Throws:
javax.naming.NamingException

addContextPartition

void addContextPartition(NextInterceptor next,
                         PartitionConfiguration cfg)
                         throws javax.naming.NamingException
Filters PartitionNexus.addContextPartition(PartitionConfiguration) call.

Throws:
javax.naming.NamingException

removeContextPartition

void removeContextPartition(NextInterceptor next,
                            org.apache.directory.shared.ldap.name.LdapDN suffix)
                            throws javax.naming.NamingException
Filters PartitionNexus.removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

compare

boolean compare(NextInterceptor next,
                org.apache.directory.shared.ldap.name.LdapDN name,
                java.lang.String oid,
                java.lang.Object value)
                throws javax.naming.NamingException
Filters PartitionNexus.compare(org.apache.directory.shared.ldap.name.LdapDN,String,Object) call.

Throws:
javax.naming.NamingException

delete

void delete(NextInterceptor next,
            org.apache.directory.shared.ldap.name.LdapDN name)
            throws javax.naming.NamingException
Filters Partition.delete(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

add

void add(NextInterceptor next,
         org.apache.directory.shared.ldap.name.LdapDN name,
         javax.naming.directory.Attributes entry)
         throws javax.naming.NamingException
Filters Partition.add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes) call.

Throws:
javax.naming.NamingException

modify

void modify(NextInterceptor next,
            org.apache.directory.shared.ldap.name.LdapDN name,
            int modOp,
            javax.naming.directory.Attributes attributes)
            throws javax.naming.NamingException
Filters Partition.modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes) call.

Throws:
javax.naming.NamingException

modify

void modify(NextInterceptor next,
            org.apache.directory.shared.ldap.name.LdapDN name,
            org.apache.directory.shared.ldap.message.ModificationItemImpl[] items)
            throws javax.naming.NamingException
Filters Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[]) call.

Throws:
javax.naming.NamingException

list

javax.naming.NamingEnumeration list(NextInterceptor next,
                                    org.apache.directory.shared.ldap.name.LdapDN baseName)
                                    throws javax.naming.NamingException
Filters Partition.list(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

search

javax.naming.NamingEnumeration search(NextInterceptor next,
                                      org.apache.directory.shared.ldap.name.LdapDN baseName,
                                      java.util.Map environment,
                                      org.apache.directory.shared.ldap.filter.ExprNode filter,
                                      javax.naming.directory.SearchControls searchControls)
                                      throws javax.naming.NamingException
Filters Partition.search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls) call.

Throws:
javax.naming.NamingException

lookup

javax.naming.directory.Attributes lookup(NextInterceptor next,
                                         org.apache.directory.shared.ldap.name.LdapDN name)
                                         throws javax.naming.NamingException
Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

lookup

javax.naming.directory.Attributes lookup(NextInterceptor next,
                                         org.apache.directory.shared.ldap.name.LdapDN dn,
                                         java.lang.String[] attrIds)
                                         throws javax.naming.NamingException
Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN,String[]) call.

Throws:
javax.naming.NamingException

hasEntry

boolean hasEntry(NextInterceptor next,
                 org.apache.directory.shared.ldap.name.LdapDN name)
                 throws javax.naming.NamingException
Filters Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN,String[]) call.

Throws:
javax.naming.NamingException

isSuffix

boolean isSuffix(NextInterceptor next,
                 org.apache.directory.shared.ldap.name.LdapDN name)
                 throws javax.naming.NamingException
Filters Partition.isSuffix(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

modifyRn

void modifyRn(NextInterceptor next,
              org.apache.directory.shared.ldap.name.LdapDN name,
              java.lang.String newRn,
              boolean deleteOldRn)
              throws javax.naming.NamingException
Filters Partition.modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean) call.

Throws:
javax.naming.NamingException

move

void move(NextInterceptor next,
          org.apache.directory.shared.ldap.name.LdapDN oldName,
          org.apache.directory.shared.ldap.name.LdapDN newParentName)
          throws javax.naming.NamingException
Filters Partition.move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException

move

void move(NextInterceptor next,
          org.apache.directory.shared.ldap.name.LdapDN oldName,
          org.apache.directory.shared.ldap.name.LdapDN newParentName,
          java.lang.String newRn,
          boolean deleteOldRn)
          throws javax.naming.NamingException
Filters Partition.move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean) call.

Throws:
javax.naming.NamingException

bind

void bind(NextInterceptor next,
          org.apache.directory.shared.ldap.name.LdapDN bindDn,
          byte[] credentials,
          java.util.List mechanisms,
          java.lang.String saslAuthId)
          throws javax.naming.NamingException
Filters Partition.bind(org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String) call.

Throws:
javax.naming.NamingException

unbind

void unbind(NextInterceptor next,
            org.apache.directory.shared.ldap.name.LdapDN bindDn)
            throws javax.naming.NamingException
Filters Partition.unbind(org.apache.directory.shared.ldap.name.LdapDN) call.

Throws:
javax.naming.NamingException


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