public class PeersNode
extends java.lang.Object
Each "PeersNode" object has a leader node, corresponding the lowest destination according the ordering criteria.
The leader nodes play special roles in "SyncClock" and "ProxyManager" services.
Modifier and Type | Field and Description |
---|---|
(package private) long |
IPAsLong |
(package private) java.util.HashMap<java.lang.Integer,Destination> |
nodeEndPoints |
(package private) Destination |
nodeLeader |
Constructor and Description |
---|
PeersNode(long ip)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addDestination(Destination dest)
Adds a destination to the data structure.
|
(package private) boolean |
containsPort(int port)
Checks if a port is the data structure.
|
private void |
refreshLeader()
Assigns the leader node to the lower one according the ordering criteria.
|
(package private) boolean |
removeDestination(Destination dest)
Removes a destination from the data structure.
|
long IPAsLong
java.util.HashMap<java.lang.Integer,Destination> nodeEndPoints
Destination nodeLeader
boolean addDestination(Destination dest)
dest
- boolean containsPort(int port)
port
- private void refreshLeader()
boolean removeDestination(Destination dest)
dest
-