|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.replication.plugin.ReplicationBroker
public class ReplicationBroker
The broker for Multi-master Replication.
| Constructor Summary | |
|---|---|
ReplicationBroker(ServerState state,
DN baseDn,
short serverID,
int maxReceiveQueue,
int maxReceiveDelay,
int maxSendQueue,
int maxSendDelay,
int window,
long heartbeatInterval,
long generationId,
ReplSessionSecurity replSessionSecurity)
Creates a new ReplicationServer Broker for a particular ReplicationDomain. |
|
| Method Summary | |
|---|---|
void |
changeConfig(java.util.Collection<java.lang.String> replicationServers,
int maxReceiveQueue,
int maxReceiveDelay,
int maxSendQueue,
int maxSendDelay,
int window,
long heartbeatInterval)
Change some config parameters. |
static java.lang.String |
computeBestReplicationServer(ServerState myState,
java.util.HashMap<java.lang.String,ServerState> rsStates,
short serverId,
DN baseDn)
Returns the replication server that best fits our need so that we can connect to it. |
int |
getCurrentRcvWindow()
Get the current receive window size. |
int |
getCurrentSendWindow()
Get the current send window size. |
int |
getMaxRcvWindow()
Get the maximum receive window size. |
int |
getMaxSendWindow()
Get the maximum send window size. |
int |
getNumLostConnections()
Get the number of times the connection was lost. |
short |
getProtocolVersion()
Get the version of the replication protocol. |
java.lang.String |
getReplicationServer()
Get the name of the replicationServer to which this broker is currently connected. |
void |
handleInternalSearchEntry(InternalSearchOperation searchOperation,
SearchResultEntry searchEntry)
Performs any processing necessary for the provided search result entry. |
void |
handleInternalSearchReference(InternalSearchOperation searchOperation,
SearchResultReference searchReference)
Performs any processing necessary for the provided search result reference. |
boolean |
isConnected()
Check if the broker is connected to a ReplicationServer and therefore ready to received and send Replication Messages. |
boolean |
isSessionEncrypted()
Determine whether the connection to the replication server is encrypted. |
ReplServerStartMessage |
performHandshake(java.lang.String server,
boolean keepConnection)
Connect to the provided server performing the handshake (start messages exchange) and return the reply message from the replication server. |
void |
publish(ReplicationMessage msg)
Publish a message to the other servers. |
ReplicationMessage |
receive()
Receive a message. |
void |
reStart()
restart the ReplicationBroker. |
void |
reStart(ProtocolSession failingSession)
Restart the ReplicationServer broker after a failure. |
static InternalSearchOperation |
searchForChangedEntries(DN baseDn,
ChangeNumber fromChangeNumber,
InternalSearchListener resultListener)
Search for the changes that happened since fromChangeNumber based on the historical attribute. |
void |
setGenerationId(long generationId)
Set the value of the generationId for that broker. |
void |
setSoTimeout(int timeout)
Set a timeout value. |
void |
start(java.util.Collection<java.lang.String> servers)
Start the ReplicationBroker. |
void |
stop()
stop the server. |
void |
updateWindowAfterReplay()
This method allows to do the necessary computing for the window management after treatment by the worker threads. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReplicationBroker(ServerState state,
DN baseDn,
short serverID,
int maxReceiveQueue,
int maxReceiveDelay,
int maxSendQueue,
int maxSendDelay,
int window,
long heartbeatInterval,
long generationId,
ReplSessionSecurity replSessionSecurity)
state - The ServerState that should be used by this broker
when negociating the session with the replicationServer.baseDn - The base DN that should be used by this broker
when negociating the session with the replicationServer.serverID - The server ID that should be used by this broker
when negociating the session with the replicationServer.maxReceiveQueue - The maximum size of the receive queue to use on
the replicationServer.maxReceiveDelay - The maximum replication delay to use on the
replicationServer.maxSendQueue - The maximum size of the send queue to use on
the replicationServer.maxSendDelay - The maximum send delay to use on the replicationServer.window - The size of the send and receive window to use.heartbeatInterval - The interval between heartbeats requested of the
replicationServer, or zero if no heartbeats are requested.generationId - The generationId for the server associated to the
provided serverID and for the domain associated to the provided baseDN.replSessionSecurity - The session security configuration.| Method Detail |
|---|
public void start(java.util.Collection<java.lang.String> servers)
servers - list of servers used
public ReplServerStartMessage performHandshake(java.lang.String server,
boolean keepConnection)
server - Server to connect to.keepConnection - Do we keep session opened or not after handshake.
public static java.lang.String computeBestReplicationServer(ServerState myState,
java.util.HashMap<java.lang.String,ServerState> rsStates,
short serverId,
DN baseDn)
myState - The local server state.rsStates - The list of available replication servers and their
associated server state.serverId - The server id for the suffix we are working for.baseDn - The suffix for which we are working for.
public static InternalSearchOperation searchForChangedEntries(DN baseDn,
ChangeNumber fromChangeNumber,
InternalSearchListener resultListener)
throws java.lang.Exception
baseDn - the base DNfromChangeNumber - The change number from which we want the changesresultListener - that will process the entries returned.
java.lang.Exception - when raised.public void reStart()
public void reStart(ProtocolSession failingSession)
failingSession - the socket which failedpublic void publish(ReplicationMessage msg)
msg - the message to publish
public ReplicationMessage receive()
throws java.net.SocketTimeoutException
java.net.SocketTimeoutException - if the timeout set by setSoTimeout
has expiredpublic void updateWindowAfterReplay()
public void stop()
public void setSoTimeout(int timeout)
throws java.net.SocketException
timeout - the specified timeout, in milliseconds.
java.net.SocketException - if there is an error in the underlying protocol,
such as a TCP error.public void setGenerationId(long generationId)
generationId - The value of the generationId.public java.lang.String getReplicationServer()
public void handleInternalSearchEntry(InternalSearchOperation searchOperation,
SearchResultEntry searchEntry)
handleInternalSearchEntry in interface InternalSearchListenersearchOperation - The internal search operation being
processed.searchEntry - The matching search result entry to be
processed.
public void handleInternalSearchReference(InternalSearchOperation searchOperation,
SearchResultReference searchReference)
handleInternalSearchReference in interface InternalSearchListenersearchOperation - The internal search operation being
processed.searchReference - The search result reference to be
processed.public int getMaxRcvWindow()
public int getCurrentRcvWindow()
public int getMaxSendWindow()
public int getCurrentSendWindow()
public int getNumLostConnections()
public void changeConfig(java.util.Collection<java.lang.String> replicationServers,
int maxReceiveQueue,
int maxReceiveDelay,
int maxSendQueue,
int maxSendDelay,
int window,
long heartbeatInterval)
replicationServers - The new list of replication servers.maxReceiveQueue - The max size of receive queue.maxReceiveDelay - The max receive delay.maxSendQueue - The max send queue.maxSendDelay - The max Send Delay.window - The max window size.heartbeatInterval - The heartbeat interval.public short getProtocolVersion()
public boolean isConnected()
public boolean isSessionEncrypted()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||