public class SafeReadExpectedAcksInfo extends ExpectedAcksInfo
csn, expectedServersAckStatus, serversInTimeout
Constructor and Description |
---|
SafeReadExpectedAcksInfo(CSN csn,
ServerHandler requesterServerHandler,
List<Integer> expectedServers,
List<Integer> wrongStatusServers)
Creates a new SafeReadExpectedAcksInfo.
|
Modifier and Type | Method and Description |
---|---|
AckMsg |
createAck(boolean timeout)
Creates the ack message to be returned to the requester server, taking into
account the information in the received acks from every servers.
|
boolean |
hasReplayError()
Gets the replay error marker for the future update ack.
|
boolean |
hasTimeout()
Gets the timeout marker for the future update ack.
|
boolean |
hasWrongStatus()
Gets the wrong status marker for the future update ack.
|
boolean |
processReceivedAck(ServerHandler ackingServer,
AckMsg ackMsg)
Process the received ack from a server we are waiting an ack from.
|
void |
setHasReplayError(boolean hasReplayError)
Sets the replay error marker for the future update ack.
|
void |
setHasTimeout(boolean hasTimeout)
Sets the timeout marker for the future update ack.
|
void |
setHasWrongStatus(boolean hasWrongStatus)
Sets the wrong status marker for the future update ack.
|
completed, getAssuredMode, getRequesterServer, getTimeoutServers, isCompleted
public SafeReadExpectedAcksInfo(CSN csn, ServerHandler requesterServerHandler, List<Integer> expectedServers, List<Integer> wrongStatusServers)
csn
- The CSN of the assured update messagerequesterServerHandler
- The server that sent the assured update
messageexpectedServers
- The list of servers we want an ack from (they are
in normal status and have the same group id as us)wrongStatusServers
- The list of all servers already detected in
wrongStatus (degraded status) to keep trace of the error for the future
returning ack we gonna computepublic void setHasTimeout(boolean hasTimeout)
hasTimeout
- True if some timeout occurredpublic void setHasWrongStatus(boolean hasWrongStatus)
hasWrongStatus
- True if some servers were in wrong statuspublic void setHasReplayError(boolean hasReplayError)
hasReplayError
- True if some servers had errors replaying the changepublic boolean hasTimeout()
public boolean hasWrongStatus()
public boolean hasReplayError()
public boolean processReceivedAck(ServerHandler ackingServer, AckMsg ackMsg)
processReceivedAck
in class ExpectedAcksInfo
ackingServer
- The server handler of the server that sent the ackackMsg
- The ack message to processpublic AckMsg createAck(boolean timeout)
createAck
in class ExpectedAcksInfo
timeout
- True if we call this method when the timeout occurred, that
is we did not received every expected acks in time, and thus, the timeout
flag should also be enabled in the returned ack message.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.