public class LCManager
extends java.lang.Object
Constructor and Description |
---|
LCManager(TOMLayer tomLayer,
ServerViewController SVController,
java.security.MessageDigest md)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCollect(int regency,
java.security.SignedObject signedCollect)
Keep collect from an incoming SYNC message
|
void |
addLastEid(int regency,
LastEidData lastEid)
Keep last eid from an incoming SYNC message
|
void |
addStop(int regency,
int pid)
Keep information about an incoming STOP message
|
boolean |
binds(int timestamp,
byte[] value,
java.util.HashSet<CollectData> collects)
The predicate "binds".
|
boolean |
certifiedValue(int timestamp,
byte[] value,
java.util.HashSet<CollectData> collects)
The predicate "certifiedValue".
|
byte[] |
getBindValue(java.util.HashSet<CollectData> collects)
Return a value that is "bind", that is different from null, and
with a timestamp greater or equal to zero
|
java.util.HashSet<java.security.SignedObject> |
getCollects(int regency)
Get the set of collects related to a regency
|
int |
getCollectsSize(int regency)
Get the quantity of stored collect information
|
java.util.List<TOMMessage> |
getCurrentRequestTimedOut()
Get the timed out messages in this replica
|
LastEidData |
getHighestLastEid(int ts)
Gets the highest valid last eid related to the given timestamp
|
java.util.HashSet<LastEidData> |
getLastEids(int regency)
Get the set of last eids related to a regency
|
int |
getLastEidsSize(int regency)
Get the quantity of stored last eid information
|
byte[] |
getLastEidValue(int regency,
int eid)
Returns the value of the specified last eid for a given regency
|
int |
getLastReg()
The current regency
|
int |
getNewLeader() |
int |
getNextReg()
The next regency
|
int |
getStopsSize(int regency)
Get the quantity of stored STOP information
|
boolean |
hasValidProof(LastEidData led) |
boolean |
quorumHighest(int timestamp,
byte[] value,
java.util.HashSet<CollectData> collects)
The predicate "quorumHighest".
|
void |
removeCollects(int regency)
Discard collect information up to the given regency
|
void |
removeLastEids(int regency)
Discard last eid information up to the specified regency
|
void |
removeStops(int regency)
Discard information about STOP messages up to specified regency
|
java.util.HashSet<CollectData> |
selectCollects(java.util.HashSet<java.security.SignedObject> signedObjects,
int eid)
Fetchs a set of correctly signed and normalized collect data structures from the
specified original set of collects
|
java.util.HashSet<CollectData> |
selectCollects(int regency,
int eid)
Fetchs a set of correctly signed and normalized collect data structures
|
void |
setCollects(int regency,
java.util.HashSet<java.security.SignedObject> colls)
Defines the set of collects related to a regency
|
void |
setCurrentRequestTimedOut(java.util.List<TOMMessage> currentRequestTimedOut)
This is meant to keep track of timed out messages in this replica
|
void |
setLastEids(int regency,
java.util.HashSet<LastEidData> lasts)
Defines the set of last eids related to a regency
|
void |
setLastReg(int lastreg)
Set the previous regency
|
void |
setNewLeader(int leader) |
void |
setNextReg(int nextreg)
Set the next regency
|
boolean |
sound(java.util.HashSet<CollectData> collects)
The all-important predicate "sound".
|
boolean |
unbound(java.util.HashSet<CollectData> collects)
The predicate "unbound".
|
public LCManager(TOMLayer tomLayer, ServerViewController SVController, java.security.MessageDigest md)
reconfManager
- The reconfiguration manager from TOM layermd
- The message digest engine from TOM layerpublic int getNewLeader()
public void setNewLeader(int leader)
public void setCurrentRequestTimedOut(java.util.List<TOMMessage> currentRequestTimedOut)
currentRequestTimedOut
- public java.util.List<TOMMessage> getCurrentRequestTimedOut()
public void setLastReg(int lastreg)
lastreg
- current regencypublic int getLastReg()
public void setNextReg(int nextreg)
nextts
- next regencypublic int getNextReg()
public void addStop(int regency, int pid)
regency
- the next regencypid
- the process that sent the messagepublic void removeStops(int regency)
ts
- timestamp up to which to discard messagespublic int getStopsSize(int regency)
regency
- Regency to be consideredpublic void addLastEid(int regency, LastEidData lastEid)
regency
- the current regencylastEid
- the last eid datapublic void removeLastEids(int regency)
regency
- Regency up to which to discard informationpublic int getLastEidsSize(int regency)
regency
- regency to be consideredpublic java.util.HashSet<LastEidData> getLastEids(int regency)
regency
- Regency for the last eid infopublic void setLastEids(int regency, java.util.HashSet<LastEidData> lasts)
regency
- Regency for the last eid infolasts
- a set of last eid datapublic void addCollect(int regency, java.security.SignedObject signedCollect)
ts
- the current regencysignedCollect
- the signed collect datapublic void removeCollects(int regency)
regency
- Regency up to which to discard informationpublic int getCollectsSize(int regency)
regency
- Regency to be consideredpublic java.util.HashSet<java.security.SignedObject> getCollects(int regency)
regency
- Regency for collectspublic void setCollects(int regency, java.util.HashSet<java.security.SignedObject> colls)
regency
- Regency for the last eid infocolls
- a set of collect datapublic boolean sound(java.util.HashSet<CollectData> collects)
collects
- the collect data to which to apply the predicate.public boolean binds(int timestamp, byte[] value, java.util.HashSet<CollectData> collects)
timestamp
- the timestamp to search forvalue
- the value to search forcollects
- the collect data to which to apply the predicate.public byte[] getBindValue(java.util.HashSet<CollectData> collects)
collects
- Set of collects from which to determine the valuepublic boolean unbound(java.util.HashSet<CollectData> collects)
collects
- the collect data to which to apply the predicate.public boolean quorumHighest(int timestamp, byte[] value, java.util.HashSet<CollectData> collects)
timestamp
- the timestamp to search forvalue
- the value to search forcollects
- the collect data to which to apply the predicate.public boolean certifiedValue(int timestamp, byte[] value, java.util.HashSet<CollectData> collects)
timestamp
- the timestamp to search forvalue
- the value to search forcollects
- the collect data to which to apply the predicate.public java.util.HashSet<CollectData> selectCollects(int regency, int eid)
regency
- the regency from which the collects were storedeid
- the eid to which to normalize the collectspublic java.util.HashSet<CollectData> selectCollects(java.util.HashSet<java.security.SignedObject> signedObjects, int eid)
signedObjects
- original set of signed collectseid
- the eid to which to normalize the collectspublic LastEidData getHighestLastEid(int ts)
ts
- the timestamppublic boolean hasValidProof(LastEidData led)
public byte[] getLastEidValue(int regency, int eid)
regency
- the related regencyeid
- the last eid