public class ReplicationBroker extends Object
Constructor and Description |
---|
ReplicationBroker(ReplicationDomain replicationDomain,
ServerState state,
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 |
getNumLostConnections()
Get the number of times the connection was lost.
|
short |
getProtocolVersion()
Get the version of the replication protocol.
|
ReplicaId |
getReplicaId()
Gets the replica id.
|
Map<ReplicaId,DSInfo> |
getReplicaInfos()
Gets the info for DSs in the topology (except us).
|
Map<ReplicaId,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.
|
GroupId |
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).
|
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.
|
boolean |
publish(ReplicationMsg msg)
Publish a message to the other servers.
|
void |
publishRecoveryMsg(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 recoveryInProgress)
This flag is used to indicate if a recovery of update messages is necessary after a reconnection to a RS.
|
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, 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 GroupId getRsGroupId()
public ReplicaId getReplicaId()
public void setGenerationID(long generationID)
generationID
- The generation idpublic void reStart(boolean infiniteTry)
infiniteTry
- the socket which failedpublic boolean publish(ReplicationMsg msg)
msg
- the message to publishpublic void publishRecoveryMsg(ReplicationMsg msg)
msg
- the message to publishpublic ReplicationMsg receive() throws SocketTimeoutException
SocketTimeoutException
- if the timeout set by setSoTimeout has expiredpublic Map<ReplicaId,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 getCurrentRcvWindow()
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<ReplicaId,DSInfo> getReplicaInfos()
public List<RSInfo> getRsInfos()
public void setRecoveryRequired(boolean recoveryInProgress)
recoveryInProgress
- true
when recovery is required..Copyright 2010-2022 ForgeRock AS.