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

All Known Implementing Classes:
AciAuthorizationInterceptor, AuthenticationInterceptor, BaseInterceptor, ChangeLogInterceptor, CollectiveAttributeInterceptor, DefaultAuthorizationInterceptor, EventInterceptor, ExceptionInterceptor, KeyDerivationInterceptor, NormalizationInterceptor, OperationalAttributeInterceptor, PasswordPolicyInterceptor, ReplicationInterceptor, SchemaInterceptor, SubentryInterceptor, TriggerInterceptor

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 AttributeImpl( "entryDeleted", "true" );
     nextInterceptor.modify( name, DirContext.REPLACE_ATTRIBUTE, mark );
 }
 

Version:
$Rev: 659905 $, $Date: 2008-05-25 05:37:28 +0200 (So, 25 Mai 2008) $
Author:
Apache Directory Project
See Also:
NextInterceptor

Method Summary
 void add(NextInterceptor next, AddOperationContext opContext)
          Filters Partition.add( AddOperationContext ) call.
 void addContextPartition(NextInterceptor next, AddContextPartitionOperationContext opContext)
          Filters PartitionNexus.addContextPartition( AddContextPartitionOperationContext ) call.
 void bind(NextInterceptor next, BindOperationContext opContext)
          Filters Partition.bind( BindOperationContext ) call.
 boolean compare(NextInterceptor next, CompareOperationContext opContext)
          Filters PartitionNexus.compare( CompareOperationContext ) call.
 void delete(NextInterceptor next, DeleteOperationContext opContext)
          Filters Partition.delete( DeleteOperationContext ) call.
 void destroy()
          Deinitializes this interceptor.
 org.apache.directory.shared.ldap.name.LdapDN getMatchedName(NextInterceptor next, GetMatchedNameOperationContext opContext)
          Filters PartitionNexus.getMatchedName( GetMatchedNameOperationContext ) call.
 java.lang.String getName()
          Name that must be unique in an interceptor chain
 ClonedServerEntry getRootDSE(NextInterceptor next, GetRootDSEOperationContext opContext)
          Filters PartitionNexus.getRootDSE( GetRootDSEOperationContext ) call.
 org.apache.directory.shared.ldap.name.LdapDN getSuffix(NextInterceptor next, GetSuffixOperationContext opContext)
          Filters PartitionNexus.getSuffix( GetSuffixOperationContext ) call.
 boolean hasEntry(NextInterceptor next, EntryOperationContext opContext)
          Filters Partition.hasEntry( EntryOperationContext ) call.
 void init(DirectoryService directoryService)
          Intializes this interceptor.
 EntryFilteringCursor list(NextInterceptor next, ListOperationContext opContext)
          Filters Partition.list( ListOperationContext ) call.
 java.util.Iterator<java.lang.String> listSuffixes(NextInterceptor next, ListSuffixOperationContext opContext)
          Filters PartitionNexus.listSuffixes( ListSuffixOperationContext ) call.
 ClonedServerEntry lookup(NextInterceptor next, LookupOperationContext opContext)
          Filters Partition.lookup( LookupOperationContext ) call.
 void modify(NextInterceptor next, ModifyOperationContext opContext)
          Filters Partition.modify( ModifyOperationContext ) call.
 void move(NextInterceptor next, MoveOperationContext opContext)
          Filters Partition.move( MoveOperationContext ) call.
 void moveAndRename(NextInterceptor next, MoveAndRenameOperationContext opContext)
          Filters Partition.moveAndRename( MoveAndRenameOperationContext) call.
 void removeContextPartition(NextInterceptor next, RemoveContextPartitionOperationContext opContext)
          Filters PartitionNexus.removeContextPartition( RemoveContextPartitionOperationContext ) call.
 void rename(NextInterceptor next, RenameOperationContext opContext)
          Filters Partition.rename( RenameOperationContext ) call.
 EntryFilteringCursor search(NextInterceptor next, SearchOperationContext opContext)
          Filters Partition.search( SearchOperationContext ) call.
 void unbind(NextInterceptor next, UnbindOperationContext opContext)
          Filters Partition.unbind( UnbindOperationContext ) call.
 

Method Detail

getName

java.lang.String getName()
Name that must be unique in an interceptor chain

Returns:
name of this interceptor, must be unique in an interceptor chain.

init

void init(DirectoryService directoryService)
          throws java.lang.Exception
Intializes this interceptor. This is invoked by InterceptorChain when this intercepter is loaded into interceptor chain.

Throws:
java.lang.Exception

destroy

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


getRootDSE

ClonedServerEntry getRootDSE(NextInterceptor next,
                             GetRootDSEOperationContext opContext)
                             throws java.lang.Exception
Filters PartitionNexus.getRootDSE( GetRootDSEOperationContext ) call.

Throws:
java.lang.Exception

getMatchedName

org.apache.directory.shared.ldap.name.LdapDN getMatchedName(NextInterceptor next,
                                                            GetMatchedNameOperationContext opContext)
                                                            throws java.lang.Exception
Filters PartitionNexus.getMatchedName( GetMatchedNameOperationContext ) call.

Throws:
java.lang.Exception

getSuffix

org.apache.directory.shared.ldap.name.LdapDN getSuffix(NextInterceptor next,
                                                       GetSuffixOperationContext opContext)
                                                       throws java.lang.Exception
Filters PartitionNexus.getSuffix( GetSuffixOperationContext ) call.

Throws:
java.lang.Exception

listSuffixes

java.util.Iterator<java.lang.String> listSuffixes(NextInterceptor next,
                                                  ListSuffixOperationContext opContext)
                                                  throws java.lang.Exception
Filters PartitionNexus.listSuffixes( ListSuffixOperationContext ) call.

Throws:
java.lang.Exception

addContextPartition

void addContextPartition(NextInterceptor next,
                         AddContextPartitionOperationContext opContext)
                         throws java.lang.Exception
Filters PartitionNexus.addContextPartition( AddContextPartitionOperationContext ) call.

Throws:
java.lang.Exception

removeContextPartition

void removeContextPartition(NextInterceptor next,
                            RemoveContextPartitionOperationContext opContext)
                            throws java.lang.Exception
Filters PartitionNexus.removeContextPartition( RemoveContextPartitionOperationContext ) call.

Throws:
java.lang.Exception

compare

boolean compare(NextInterceptor next,
                CompareOperationContext opContext)
                throws java.lang.Exception
Filters PartitionNexus.compare( CompareOperationContext ) call.

Throws:
java.lang.Exception

delete

void delete(NextInterceptor next,
            DeleteOperationContext opContext)
            throws java.lang.Exception
Filters Partition.delete( DeleteOperationContext ) call.

Throws:
java.lang.Exception

add

void add(NextInterceptor next,
         AddOperationContext opContext)
         throws java.lang.Exception
Filters Partition.add( AddOperationContext ) call.

Throws:
java.lang.Exception

modify

void modify(NextInterceptor next,
            ModifyOperationContext opContext)
            throws java.lang.Exception
Filters Partition.modify( ModifyOperationContext ) call.

Throws:
java.lang.Exception

list

EntryFilteringCursor list(NextInterceptor next,
                          ListOperationContext opContext)
                          throws java.lang.Exception
Filters Partition.list( ListOperationContext ) call.

Throws:
java.lang.Exception

search

EntryFilteringCursor search(NextInterceptor next,
                            SearchOperationContext opContext)
                            throws java.lang.Exception
Filters Partition.search( SearchOperationContext ) call.

Throws:
java.lang.Exception

lookup

ClonedServerEntry lookup(NextInterceptor next,
                         LookupOperationContext opContext)
                         throws java.lang.Exception
Filters Partition.lookup( LookupOperationContext ) call.

Throws:
java.lang.Exception

hasEntry

boolean hasEntry(NextInterceptor next,
                 EntryOperationContext opContext)
                 throws java.lang.Exception
Filters Partition.hasEntry( EntryOperationContext ) call.

Throws:
java.lang.Exception

rename

void rename(NextInterceptor next,
            RenameOperationContext opContext)
            throws java.lang.Exception
Filters Partition.rename( RenameOperationContext ) call.

Throws:
java.lang.Exception

move

void move(NextInterceptor next,
          MoveOperationContext opContext)
          throws java.lang.Exception
Filters Partition.move( MoveOperationContext ) call.

Throws:
java.lang.Exception

moveAndRename

void moveAndRename(NextInterceptor next,
                   MoveAndRenameOperationContext opContext)
                   throws java.lang.Exception
Filters Partition.moveAndRename( MoveAndRenameOperationContext) call.

Throws:
java.lang.Exception

bind

void bind(NextInterceptor next,
          BindOperationContext opContext)
          throws java.lang.Exception
Filters Partition.bind( BindOperationContext ) call.

Throws:
java.lang.Exception

unbind

void unbind(NextInterceptor next,
            UnbindOperationContext opContext)
            throws java.lang.Exception
Filters Partition.unbind( UnbindOperationContext ) call.

Throws:
java.lang.Exception


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