public abstract class ExpectedAcksInfo extends Object
Modifier and Type | Field and Description |
---|---|
protected CSN |
csn
The CSN of the assured update message we want acks for.
|
protected Map<Integer,Boolean> |
expectedServersAckStatus
This gives the list of servers we are willing to wait acks from and the
information about the ack from the servers.
|
protected List<Integer> |
serversInTimeout
Facility for monitoring:
If the timeout occurs for the original update, we call createAck(true)
in the timeout code for sending back an error ack to the original server.
|
Modifier | Constructor and Description |
---|---|
protected |
ExpectedAcksInfo(CSN csn,
ServerHandler requesterServerHandler,
AssuredMode assuredMode,
List<Integer> expectedServers)
Creates a new ExpectedAcksInfo.
|
Modifier and Type | Method and Description |
---|---|
void |
completed()
Signal that treatment of this object has been completed and that it is
going to be removed from the map where it is stored.
|
abstract 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.
|
AssuredMode |
getAssuredMode()
Gets the requested assured mode for the matching update message.
|
ServerHandler |
getRequesterServer()
Gets the server handler of the server which requested the acknowledgments.
|
List<Integer> |
getTimeoutServers()
Gets the list of expected servers that did not respond in time.
|
boolean |
isCompleted()
Has the treatment of this object been completed or not?
If true is returned, one must not modify this object (useless) nor remove
it from the map where it is stored (will be or has already been done by the
other code (ack timeout code, or ack processing code)).
|
abstract boolean |
processReceivedAck(ServerHandler ackingServer,
AckMsg ackMsg)
Process the received ack from a server we are waiting an ack from.
|
protected Map<Integer,Boolean> expectedServersAckStatus
protected List<Integer> serversInTimeout
protected ExpectedAcksInfo(CSN csn, ServerHandler requesterServerHandler, AssuredMode assuredMode, List<Integer> expectedServers)
csn
- The CSN of the assured update messagerequesterServerHandler
- The server handler of the server that sent
the assured update messageassuredMode
- The assured mode requested by the assured update messageexpectedServers
- The list of servers we want an ack frompublic ServerHandler getRequesterServer()
public List<Integer> getTimeoutServers()
public AssuredMode getAssuredMode()
public abstract boolean processReceivedAck(ServerHandler ackingServer, AckMsg ackMsg)
ackingServer
- The server handler of the server that sent the ackackMsg
- The ack message to processpublic abstract AckMsg createAck(boolean timeout)
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.public boolean isCompleted()
public void completed()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.