|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.core.interceptor.BaseInterceptor
org.apache.directory.mitosis.service.ReplicationInterceptor
public class ReplicationInterceptor
An Interceptor that intercepts LDAP operations and propagates the
changes occurred by the operations into other ReplicaIds so the DIT
of each ReplicaId in the cluster has the same content without any
conflict.
Once an operation is invoked, this interceptor transforms it into one or
more operations that makes the requested operation more proper and robust
for replication. The transformation process is actually just calling a
respective factory method in OperationFactory. The methods in
OperationFactory returns a new Operation instance.
The newly created Operation is used for three purposes.
PartitionNexus
Operation itself to
ReplicationStore so that it can be retrieved later by
ReplicationLogCleanJob and ReplicationClientContextHandler
ReplicaIds via TCP/IP communication
between ReplicationClientContextHandler and
ReplicationServerContextHandler
Operation to ReplicationStore) are performed automatically
when
Operation#execute(PartitionNexus, ReplicationStore, Registries)
method is invoked. ReplicationInterceptor always call it instead of
forwarding the requested operation to the next Interceptor.
The last action takes place by ReplicationClientContextHandler,
which handles TCP/IP connection managed by ClientConnectionManager.
There are two special attributes in the entries to be replicated:
CSN of the entry. This attribute is
used to compare the incoming operation from other replica is still
valid. If the local entryCSN value is bigger then that of the
incoming operation, it means conflict, and therefore an appropriate
conflict resolution mechanism should get engaged.ReplicationStore by
calling purgeAgedData(), or they will be purged automatically
by periodic manner as you configured with ReplicationConfiguration.
by calling ReplicationConfiguration.setLogMaxAge(int).
Because of this attribute, lookup and search
operations are overrided to ignore entries with entryDeleted
set to TRUE.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_SERVICE_NAME
The service name |
| Constructor Summary | |
|---|---|
ReplicationInterceptor()
Creates a new instance of ReplicationInterceptor. |
|
| Methods inherited from class org.apache.directory.server.core.interceptor.BaseInterceptor |
|---|
addContextPartition, bind, compare, getContext, getMatchedName, getPrincipal, getRootDSE, getSuffix, listSuffixes, removeContextPartition, unbind |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_SERVICE_NAME
| Constructor Detail |
|---|
public ReplicationInterceptor()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface InterceptorgetName in class BaseInterceptorpublic void setName(java.lang.String name)
name - The new namepublic ReplicationConfiguration getConfiguration()
public void setConfiguration(ReplicationConfiguration configuration)
public void init(DirectoryService directoryService)
throws java.lang.Exception
init in interface Interceptorinit in class BaseInterceptordirectoryService - the DirectoryService instance
java.lang.Exceptionpublic void destroy()
BaseInterceptor
destroy in interface Interceptordestroy in class BaseInterceptorpublic void replicate()
public void interruptConnectors()
public void purgeAgedData()
throws java.lang.Exception
Constants.ENTRY_DELETED is TRUE). This method
should be called periodically to make sure the size of the DIT and
ReplicationStore increase limitlessly.
javax.naming.NamingException - on error
java.lang.ExceptionReplicationConfiguration.setLogMaxAge(int),
ReplicationLogCleanJob
public void add(NextInterceptor nextInterceptor,
AddOperationContext addContext)
throws java.lang.Exception
InterceptorPartition.add( AddOperationContext ) call.
add in interface Interceptoradd in class BaseInterceptorjava.lang.Exception
public void delete(NextInterceptor next,
DeleteOperationContext deleteContext)
throws java.lang.Exception
InterceptorPartition.delete( DeleteOperationContext ) call.
delete in interface Interceptordelete in class BaseInterceptorjava.lang.Exception
public void modify(NextInterceptor next,
ModifyOperationContext modifyContext)
throws java.lang.Exception
InterceptorPartition.modify( ModifyOperationContext ) call.
modify in interface Interceptormodify in class BaseInterceptorjava.lang.Exception
public void move(NextInterceptor next,
MoveOperationContext moveOpContext)
throws java.lang.Exception
InterceptorPartition.move( MoveOperationContext ) call.
move in interface Interceptormove in class BaseInterceptorjava.lang.Exception
public void moveAndRename(NextInterceptor next,
MoveAndRenameOperationContext moveAndRenameOpContext)
throws java.lang.Exception
InterceptorPartition.moveAndRename( MoveAndRenameOperationContext) call.
moveAndRename in interface InterceptormoveAndRename in class BaseInterceptorjava.lang.Exception
public void rename(NextInterceptor next,
RenameOperationContext renameOpContext)
throws java.lang.Exception
InterceptorPartition.rename( RenameOperationContext ) call.
rename in interface Interceptorrename in class BaseInterceptorjava.lang.Exception
public boolean hasEntry(NextInterceptor nextInterceptor,
EntryOperationContext entryContext)
throws java.lang.Exception
InterceptorPartition.hasEntry( EntryOperationContext ) call.
hasEntry in interface InterceptorhasEntry in class BaseInterceptorjava.lang.Exception
public ClonedServerEntry lookup(NextInterceptor nextInterceptor,
LookupOperationContext lookupContext)
throws java.lang.Exception
InterceptorPartition.lookup( LookupOperationContext ) call.
lookup in interface Interceptorlookup in class BaseInterceptorjava.lang.Exception
public EntryFilteringCursor list(NextInterceptor nextInterceptor,
ListOperationContext opContext)
throws java.lang.Exception
InterceptorPartition.list( ListOperationContext ) call.
list in interface Interceptorlist in class BaseInterceptorjava.lang.Exception
public EntryFilteringCursor search(NextInterceptor nextInterceptor,
SearchOperationContext opContext)
throws java.lang.Exception
InterceptorPartition.search( SearchOperationContext ) call.
search in interface Interceptorsearch in class BaseInterceptorjava.lang.Exceptionpublic DirectoryService getDirectoryService()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||