public class AssociatedNode extends java.lang.Object implements java.lang.Comparable<AssociatedNode>
| Constructor and Description |
|---|
AssociatedNode(long MostSignificantBitsID,
long LeastSignificantBitsID,
NodeConnection nodeConnection)
Constructs a node from its numbers representing the UUID and connection
|
AssociatedNode(java.util.UUID nodeId,
NodeConnection nodeConnection)
Constructs a node from its UUID and connection
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllGroups(java.util.Set<Group> groupCollection)
Adds many groups to node´s group membership
|
boolean |
addGroup(Group group)
Adds a group to node´s group membership
|
int |
compareTo(AssociatedNode specifiedNode)
Compares this node with the specified node
|
java.util.Set<Group> |
getGroups()
Gets the Node´s group membership
|
NodeConnection |
getNodeConnection()
Gets the Node´s connection
|
java.util.UUID |
getNodeId()
Gets the nodes´ID
|
void |
removeAllGroups(java.util.Set<Group> toBeRemovedGroupCollection)
Removes all groups from node´s group membership
|
void |
setNodeConnection(NodeConnection nodeConnection)
Updates the node´s Connection
|
void |
setNodeId(java.util.UUID nodeId)
Updates the nodes´s ID
|
public AssociatedNode(java.util.UUID nodeId,
NodeConnection nodeConnection)
nodeId - node´s IDnodeConnection - nodes MR-UDP Connectionpublic AssociatedNode(long MostSignificantBitsID,
long LeastSignificantBitsID,
NodeConnection nodeConnection)
MostSignificantBitsID - The most significant bits that represents the UUIDLeastSignificantBitsID - The least significant bits that represents the UUIDnodeConnection - nodes MR-UDP Connectionpublic boolean addGroup(Group group)
group - Group to be addedpublic void addAllGroups(java.util.Set<Group> groupCollection)
groupCollection - Collection to be addedpublic void removeAllGroups(java.util.Set<Group> toBeRemovedGroupCollection)
toBeRemovedGroupCollection - Groups to be removedpublic void setNodeId(java.util.UUID nodeId)
nodeId - The new node´s IDpublic java.util.UUID getNodeId()
public void setNodeConnection(NodeConnection nodeConnection)
nodeConnection - public NodeConnection getNodeConnection()
public java.util.Set<Group> getGroups()
Groups that represents the node´s group membershippublic int compareTo(AssociatedNode specifiedNode)
compareTo in interface java.lang.Comparable<AssociatedNode>