public class ReplicationBroker extends Object
Constructor and Description |
---|
ReplicationBroker(ReplicationDomain replicationDomain,
ServerState state,
org.forgerock.opendj.server.config.server.ReplicationDomainCfg config,
ReplSessionSecurity replSessionSecurity)
Creates a new ReplicationServer Broker for a particular ReplicationDomain.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Map<Integer,DSInfo> |
getReplicaInfos()
Gets the info for DSs in the topology (except us).
|
Map<Integer,ServerState> |
getReplicaStates()
Gets the States of all the Replicas currently in the Topology.
|
HostPort |
getReplicationServer()
Get the host and port of the replicationServer to which this broker is currently connected.
|
byte |
getRsGroupId()
Gets the group id of the RS we are connected to.
|
List<RSInfo> |
getRsInfos()
Gets the info for RSs in the topology (except the one we are connected
to).
|
int |
getRsServerId()
Gets the server id of the RS we are connected to.
|
int |
getServerId()
Gets the server id.
|
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.
|
void |
publish(ReplicationMsg msg)
Publish a message to the other servers.
|
void |
publishRecovery(ReplicationMsg msg)
Publish a recovery message to the other servers.
|
ReplicationMsg |
receive()
Receive a message.
|
void |
reStart(boolean infiniteTry)
Restart the ReplicationBroker.
|
void |
setGenerationID(long generationID)
Set the generation id - for test purpose.
|
void |
setRecoveryRequired(boolean b)
Set the connectRequiresRecovery to the provided value.
|
void |
setSoTimeout(int timeout)
Set a timeout value.
|
void |
signalStatusChange(ServerStatus newStatus)
Signals the RS we just entered a new status.
|
void |
start()
Start the ReplicationBroker.
|
void |
stop()
Stop the server.
|
String |
toString() |
void |
updateWindowAfterReplay()
This method allows to do the necessary computing for the window
management after treatment by the worker threads.
|
public ReplicationBroker(ReplicationDomain replicationDomain, ServerState state, org.forgerock.opendj.server.config.server.ReplicationDomainCfg config, ReplSessionSecurity replSessionSecurity)
replicationDomain
- The replication domain that is creating us.state
- The ServerState that should be used by this broker
when negotiating the session with the replicationServer.config
- The configuration to use.replSessionSecurity
- The session security configuration.public void start()
public byte getRsGroupId()
public int getRsServerId()
public int getServerId()
public void setGenerationID(long generationID)
generationID
- The generation idpublic void reStart(boolean infiniteTry)
infiniteTry
- the socket which failedpublic void publish(ReplicationMsg msg)
msg
- the message to publishpublic void publishRecovery(ReplicationMsg msg)
msg
- the message to publishpublic ReplicationMsg receive() throws SocketTimeoutException
SocketTimeoutException
- if the timeout set by setSoTimeout
has expiredpublic Map<Integer,ServerState> getReplicaStates()
public void updateWindowAfterReplay()
public void stop()
public void setSoTimeout(int timeout) throws SocketException
timeout
- the specified timeout, in milliseconds.SocketException
- if there is an error in the underlying protocol,
such as a TCP error.public HostPort getReplicationServer()
public int getMaxRcvWindow()
public int getCurrentRcvWindow()
public int getMaxSendWindow()
public int getCurrentSendWindow()
public int getNumLostConnections()
public short getProtocolVersion()
public boolean isConnected()
public boolean isSessionEncrypted()
public void signalStatusChange(ServerStatus newStatus)
newStatus
- The status the local DS just enteredpublic Map<Integer,DSInfo> getReplicaInfos()
public List<RSInfo> getRsInfos()
public void setRecoveryRequired(boolean b)
b
- the new value of the connectRequiresRecovery.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.