|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.mitosis.service.protocol.handler.ReplicationClientContextHandler
public class ReplicationClientContextHandler
ReplicationContextHandler
that implements client-side replication
logic which sends any changes out-of-date to server. The following is
the detailed protocol flow and the description of the replication logic
execution.
LoginMessage
to the server.LoginAckMessage
to the client
Constants.OK
, disconnect.
Next connection attempt is performed by
ClientConnectionManager later.ReplicationContext
changes to
ReplicationContext.State.READY
, and proceed.ReplicationStore
periodically using
contextIdle(ReplicationContext, IdleStatus)
event,
which is implemented using sessionIdle event in MINA.
BeginLogEntriesMessage
to the server.BeginLogEntriesAckMessage
.
Constants.OK
,
BeginLogEntriesAckMessage
contains a
Update Vector (UV) of the server. The client compares
the received UV and the client's Purge Vector (PV).
ReplicationConfiguration.getLogMaxAge()
).
The clients sends all entries in the DIT to the server,
and the server overwrites its current DIT with the
received entries.ReplicationStore
by calling
ReplicationStore.getLogs(CSNVector, boolean)
.LogEntryMessage
,
and then the server responds with LogEntryAckMessage
.Constants.OK
, retry later.
Constructor Summary | |
---|---|
ReplicationClientContextHandler()
|
Method Summary | |
---|---|
boolean |
beginReplication(ReplicationContext ctx)
|
void |
contextBegin(ReplicationContext ctx)
Invoked when a connection is established between two replicas. |
void |
contextEnd(ReplicationContext ctx)
Invoked when a connection is closed between two replicas. |
void |
contextIdle(ReplicationContext ctx,
org.apache.mina.common.IdleStatus status)
Invoked when two replicas are not exchanging any data for certain amount of time. |
void |
exceptionCaught(ReplicationContext ctx,
java.lang.Throwable cause)
Invoked when an exception is raised during the communication or executing replication logic. |
void |
messageReceived(ReplicationContext ctx,
java.lang.Object message)
Invoked when a message is received from a peer replica. |
void |
messageSent(ReplicationContext ctx,
java.lang.Object message)
Invoked when a message is received from a peer replica. |
org.apache.mina.common.WriteFuture |
writeTimeLimitedMessage(ReplicationContext ctx,
java.lang.Object message)
A helper to write a message and schedule that message for expiration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplicationClientContextHandler()
Method Detail |
---|
public void contextBegin(ReplicationContext ctx) throws java.lang.Exception
ReplicationContextHandler
contextBegin
in interface ReplicationContextHandler
java.lang.Exception
public void contextEnd(ReplicationContext ctx) throws java.lang.Exception
ReplicationContextHandler
contextEnd
in interface ReplicationContextHandler
java.lang.Exception
public void messageReceived(ReplicationContext ctx, java.lang.Object message) throws java.lang.Exception
ReplicationContextHandler
messageReceived
in interface ReplicationContextHandler
java.lang.Exception
public void messageSent(ReplicationContext ctx, java.lang.Object message) throws java.lang.Exception
ReplicationContextHandler
messageSent
in interface ReplicationContextHandler
java.lang.Exception
public org.apache.mina.common.WriteFuture writeTimeLimitedMessage(ReplicationContext ctx, java.lang.Object message)
ctx
- the replication contextmessage
- the message to replicate
public void exceptionCaught(ReplicationContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ReplicationContextHandler
exceptionCaught
in interface ReplicationContextHandler
java.lang.Exception
public void contextIdle(ReplicationContext ctx, org.apache.mina.common.IdleStatus status) throws java.lang.Exception
ReplicationContextHandler
contextIdle
in interface ReplicationContextHandler
java.lang.Exception
public boolean beginReplication(ReplicationContext ctx)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |