org.apache.ldap.server.interceptor
Class BaseInterceptor
java.lang.Object
org.apache.ldap.server.interceptor.BaseInterceptor
- All Implemented Interfaces:
- Interceptor
- Direct Known Subclasses:
- AuthorizationService, ExceptionService, NormalizationService, OperationalAttributeService, SchemaService
- public abstract class BaseInterceptor
- extends java.lang.Object
- implements Interceptor
A easy-to-use implementation of Interceptor
that demultiplexes invocations
using method signature overloading.
This Interceptor
forwards received process requests to an appropriate
process(NextInterceptor, ConcreteInvocation)
methods. Users
can override any process(..)
methods that correspond to
Invocation
types that he or she wants to filter.
For example, if user wants to filter Add
invocation:
public class MyInterceptor extends BaseInterceptor
{
protected void process( NextInterceptor nextInterceptor, Add invocation )
{
nextInterceptor.process( invocation );
System.out.println( "Item added!" );
}
}
BaseInterceptor
handles all long and tedious if-elseif blocks behind the
scenes.
- Version:
- $Rev: 159316 $, $Date: 2005-03-28 17:20:10 -0500 (Mon, 28 Mar 2005) $
- Author:
- Apache Directory Project
Method Summary |
static LdapPrincipal |
getPrincipal(Invocation call)
Gets the call's current context's Principal. |
protected void |
process(NextInterceptor nextInterceptor,
Add call)
|
protected void |
process(NextInterceptor nextInterceptor,
Delete call)
|
protected void |
process(NextInterceptor nextInterceptor,
GetMatchedDN call)
|
protected void |
process(NextInterceptor nextInterceptor,
GetSuffix call)
|
protected void |
process(NextInterceptor nextInterceptor,
HasEntry call)
|
void |
process(NextInterceptor nextInterceptor,
Invocation call)
Uses a switch on the invocation method type to call the respective member
analog method that does the work of the Interceptor for that Invocation method. |
protected void |
process(NextInterceptor nextInterceptor,
IsSuffix call)
|
protected void |
process(NextInterceptor nextInterceptor,
List call)
|
protected void |
process(NextInterceptor nextInterceptor,
ListSuffixes call)
|
protected void |
process(NextInterceptor nextInterceptor,
Lookup call)
|
protected void |
process(NextInterceptor nextInterceptor,
LookupWithAttrIds call)
|
protected void |
process(NextInterceptor nextInterceptor,
Modify call)
|
protected void |
process(NextInterceptor nextInterceptor,
ModifyMany call)
|
protected void |
process(NextInterceptor nextInterceptor,
ModifyRN call)
|
protected void |
process(NextInterceptor nextInterceptor,
Move call)
|
protected void |
process(NextInterceptor nextInterceptor,
MoveAndModifyRN call)
|
protected void |
process(NextInterceptor nextInterceptor,
Search call)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseInterceptor
protected BaseInterceptor()
getPrincipal
public static LdapPrincipal getPrincipal(Invocation call)
- Gets the call's current context's Principal.
- Returns:
- the principal making the call
process
public void process(NextInterceptor nextInterceptor,
Invocation call)
throws javax.naming.NamingException
- Uses a switch on the invocation method type to call the respective member
analog method that does the work of the Interceptor for that Invocation method.
- Specified by:
process
in interface Interceptor
- Parameters:
nextInterceptor
- the next interceptor in the interceptor chaincall
- the invocation to process
- Throws:
javax.naming.NamingException
- on failures while handling the invocation
process
protected void process(NextInterceptor nextInterceptor,
Add call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
Delete call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
GetMatchedDN call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
GetSuffix call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
HasEntry call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
IsSuffix call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
List call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
ListSuffixes call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
Lookup call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
LookupWithAttrIds call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
Modify call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
ModifyMany call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
ModifyRN call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
Move call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
MoveAndModifyRN call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
process
protected void process(NextInterceptor nextInterceptor,
Search call)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
Copyright © 2002-2005 . All Rights Reserved.