|
||||||||||
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 ReplicaId
s 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
ReplicaId
s 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 Interceptor
getName
in class BaseInterceptor
public 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 Interceptor
init
in class BaseInterceptor
directoryService
- the DirectoryService instance
java.lang.Exception
public void destroy()
BaseInterceptor
destroy
in interface Interceptor
destroy
in class BaseInterceptor
public 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.Exception
ReplicationConfiguration.setLogMaxAge(int)
,
ReplicationLogCleanJob
public void add(NextInterceptor nextInterceptor, AddOperationContext addContext) throws java.lang.Exception
Interceptor
Partition.add( AddOperationContext )
call.
add
in interface Interceptor
add
in class BaseInterceptor
java.lang.Exception
public void delete(NextInterceptor next, DeleteOperationContext deleteContext) throws java.lang.Exception
Interceptor
Partition.delete( DeleteOperationContext )
call.
delete
in interface Interceptor
delete
in class BaseInterceptor
java.lang.Exception
public void modify(NextInterceptor next, ModifyOperationContext modifyContext) throws java.lang.Exception
Interceptor
Partition.modify( ModifyOperationContext )
call.
modify
in interface Interceptor
modify
in class BaseInterceptor
java.lang.Exception
public void move(NextInterceptor next, MoveOperationContext moveOpContext) throws java.lang.Exception
Interceptor
Partition.move( MoveOperationContext )
call.
move
in interface Interceptor
move
in class BaseInterceptor
java.lang.Exception
public void moveAndRename(NextInterceptor next, MoveAndRenameOperationContext moveAndRenameOpContext) throws java.lang.Exception
Interceptor
Partition.moveAndRename( MoveAndRenameOperationContext)
call.
moveAndRename
in interface Interceptor
moveAndRename
in class BaseInterceptor
java.lang.Exception
public void rename(NextInterceptor next, RenameOperationContext renameOpContext) throws java.lang.Exception
Interceptor
Partition.rename( RenameOperationContext )
call.
rename
in interface Interceptor
rename
in class BaseInterceptor
java.lang.Exception
public boolean hasEntry(NextInterceptor nextInterceptor, EntryOperationContext entryContext) throws java.lang.Exception
Interceptor
Partition.hasEntry( EntryOperationContext )
call.
hasEntry
in interface Interceptor
hasEntry
in class BaseInterceptor
java.lang.Exception
public ClonedServerEntry lookup(NextInterceptor nextInterceptor, LookupOperationContext lookupContext) throws java.lang.Exception
Interceptor
Partition.lookup( LookupOperationContext )
call.
lookup
in interface Interceptor
lookup
in class BaseInterceptor
java.lang.Exception
public EntryFilteringCursor list(NextInterceptor nextInterceptor, ListOperationContext opContext) throws java.lang.Exception
Interceptor
Partition.list( ListOperationContext )
call.
list
in interface Interceptor
list
in class BaseInterceptor
java.lang.Exception
public EntryFilteringCursor search(NextInterceptor nextInterceptor, SearchOperationContext opContext) throws java.lang.Exception
Interceptor
Partition.search( SearchOperationContext )
call.
search
in interface Interceptor
search
in class BaseInterceptor
java.lang.Exception
public DirectoryService getDirectoryService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |