public class DataServerHandler extends ServerHandler
Modifier and Type | Field and Description |
---|---|
protected int |
maxQueueSize
Specifies the max queue size for this handler.
|
protected ReplicationServer |
replicationServer
Local hosting RS.
|
protected ReplicationServerDomain |
replicationServerDomain
Specifies the related replication server domain based on baseDN.
|
generationId, groupId, heartbeatInterval, localGenerationId, maxRcvWindow, oldGenerationId, serverId, serverURL, session, sslEncryption, weight
Constructor and Description |
---|
DataServerHandler(Session session,
int queueSize,
ReplicationServer replicationServer,
int rcvWindowSize)
Creates a new data server handler.
|
Modifier and Type | Method and Description |
---|---|
ServerStatus |
changeStatus(StatusMachineEvent event)
Change the status according to the event.
|
void |
changeStatusForResetGenId(long newGenId)
Order the peer DS server to change his status or close the connection
according to the requested new generation id.
|
protected DN |
getBaseDN()
Get the baseDN for this handler.
|
byte |
getLocalGroupId()
Get the groupId of the hosting RS.
|
List<Attribute> |
getMonitorData()
Retrieves a set of attributes containing monitor data that should
be returned to the client if the corresponding monitor entry is
requested.
|
String |
getMonitorInstanceName()
Retrieves the name of this monitor provider.
|
protected UpdateMsg |
getNextMessage()
Get the next update that must be sent to the consumer from the message queue or from the database.
|
CSN |
getOlderUpdateCSN()
Get the older CSN for that server.
|
int |
getRcvMsgQueueSize()
Get the number of message in the receive message queue.
|
int |
getReplicationServerId()
Get the serverId of the hosting replication server.
|
String |
getReplicationServerURL()
Get the server URL of the hosting replication server.
|
ServerState |
getServerState()
Get the state of this server.
|
ServerStatus |
getStatus()
Gets the status of the connected DS.
|
boolean |
isDataServer()
Check if the server associated to this ServerHandler is a data server
in the topology.
|
ServerStatus |
processNewStatus(ChangeStatusMsg csMsg)
Process message of a remote server changing his status.
|
boolean |
processStartFromRemote(ServerStartMsg serverStartMsg)
Processes a start message received from a remote data server.
|
void |
receiveNewStatus(ChangeStatusMsg csMsg)
Process message of a remote server changing his status.
|
protected void |
setBaseDNAndDomain(DN baseDN,
boolean isDataServer)
Set the baseDN for this handler.
|
void |
setConsumerActive(boolean active)
Set that the consumer is now becoming inactive and thus getNextMessage
should not return any UpdateMsg any more.
|
void |
setInitialServerState(ServerState serverState)
Set the initial value of the serverState for this handler.
|
void |
startFromRemoteDS(ServerStartMsg inServerStartMsg)
Starts the handler from a remote ServerStart message received from
the remote data server.
|
DSInfo |
toDSInfo()
Creates a DSInfo structure representing this remote DS.
|
String |
toString() |
abortStart, checkWindow, createReplServerStartMsg, doStop, finalizeStart, getApproxFirstMissingDate, getAssuredSdReceivedUpdates, getAssuredSdReceivedUpdatesTimeout, getAssuredSdSentUpdates, getAssuredSdSentUpdatesTimeout, getAssuredSrReceivedUpdates, getAssuredSrReceivedUpdatesTimeout, getAssuredSrSentUpdates, getAssuredSrSentUpdatesTimeout, getBadlyDisconnectedErrorMessage, getDomain, getGenerationId, getGroupId, getHeartbeatInterval, getProtocolVersion, getReferenceGenId, getServerId, getServerURL, incrementAssuredSdReceivedUpdates, incrementAssuredSdReceivedUpdatesTimeout, incrementAssuredSdSentUpdatesTimeout, incrementAssuredSrReceivedUpdates, incrementAssuredSrReceivedUpdatesTimeout, incrementAssuredSrSentUpdatesTimeout, initializeMonitorProvider, isReplicationServer, lockDomainNoTimeout, lockDomainWithTimeout, logStartHandshakeRCVandSND, logStartHandshakeSNDandRCV, logStartSessionHandshake, logStopReceived, logTopoHandshakeRCVandSND, logTopoHandshakeSNDandRCV, put, releaseDomainLock, replyToWindowProbe, send, sendTopoInfo, setGenerationId, setSendWindowSize, shutdown, take, toRSInfo, updateWindow
finalizeMonitorProvider, getMonitorObjectClass, isConfigurationAcceptable, scheduleUpdate
protected final ReplicationServer replicationServer
protected ReplicationServerDomain replicationServerDomain
protected final int maxQueueSize
public DataServerHandler(Session session, int queueSize, ReplicationServer replicationServer, int rcvWindowSize)
session
- The session opened with the remote data server.queueSize
- The queue size.replicationServer
- The hosting RS.rcvWindowSize
- The receiving window size.public void changeStatusForResetGenId(long newGenId) throws IOException
newGenId
- The new generation id to take into accountIOException
- If IO error occurred.public ServerStatus changeStatus(StatusMachineEvent event) throws IOException
event
- The event to be used for new status computationIOException
- When raised by the underlying sessionpublic List<Attribute> getMonitorData()
getMonitorData
in class ServerHandler
public String getMonitorInstanceName()
getMonitorInstanceName
in class ServerHandler
public ServerStatus getStatus()
getStatus
in class ServerHandler
public boolean isDataServer()
isDataServer
in class ServerHandler
public ServerStatus processNewStatus(ChangeStatusMsg csMsg)
csMsg
- The message containing the new statuspublic boolean processStartFromRemote(ServerStartMsg serverStartMsg) throws DirectoryException
serverStartMsg
- The provided start message received.DirectoryException
- raised when an error occurs.public void startFromRemoteDS(ServerStartMsg inServerStartMsg)
inServerStartMsg
- The provided ServerStart message received.public DSInfo toDSInfo()
public void receiveNewStatus(ChangeStatusMsg csMsg)
csMsg
- The message containing the new statusprotected UpdateMsg getNextMessage() throws ChangelogException
null
when queue is emptyChangelogException
- If a problem occurs when reading the changelogpublic CSN getOlderUpdateCSN()
public int getRcvMsgQueueSize()
public ServerState getServerState()
public void setConsumerActive(boolean active)
active
- the provided state of the consumer.public void setInitialServerState(ServerState serverState) throws DirectoryException
serverState
- the provided serverState.DirectoryException
- raised when a problem occurs.protected void setBaseDNAndDomain(DN baseDN, boolean isDataServer) throws DirectoryException
baseDN
- The provided baseDN.isDataServer
- The handler is a dataServerDirectoryException
- raised when a problem occurs.public byte getLocalGroupId()
public int getReplicationServerId()
public String getReplicationServerURL()
Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.