|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.uniba.wiai.lspi.chord.com.Node
de.uniba.wiai.lspi.chord.service.impl.NodeImpl
public final class NodeImpl
Implements all operations which can be invoked remotely by other nodes.
| Field Summary |
|---|
| Fields inherited from class de.uniba.wiai.lspi.chord.com.Node |
|---|
nodeID, nodeURL |
| Method Summary | |
|---|---|
void |
disconnect()
Closes the connection to the node. |
Node |
findSuccessor(ID key)
Returns the Chord node which is responsible for the given key. |
void |
insertEntry(Entry toInsert)
Stores the given object under the given ID. |
void |
insertReplicas(Set<Entry> replicatesToInsert)
Inserts replicates of the given entries. |
void |
leavesNetwork(Node predecessor)
Inform a node that its predecessor leaves the network. |
List<Node> |
notify(Node potentialPredecessor)
Requests this node's predecessor in result[0] and successor list in result[1..length-1]. |
RefsAndEntries |
notifyAndCopyEntries(Node potentialPredecessor)
Requests this node's predecessor, successor list and entries. |
void |
ping()
Requests a sign of live. |
void |
removeEntry(Entry entryToRemove)
Removes the given object from the list stored under the given ID. |
void |
removeReplicas(ID sendingNodeID,
Set<Entry> replicasToRemove)
Removes replicates of the given entries. |
Set<Entry> |
retrieveEntries(ID id)
Returns all entries stored under the given ID. |
| Methods inherited from class de.uniba.wiai.lspi.chord.com.Node |
|---|
equals, getNodeID, getNodeURL, hashCode, setNodeID, setNodeURL, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public final void disconnect()
disconnect in class Nodepublic final Node findSuccessor(ID key)
findSuccessor in class Nodekey - Key for which the successor is searched for.
public final List<Node> notify(Node potentialPredecessor)
notify in class Node
public final RefsAndEntries notifyAndCopyEntries(Node potentialPredecessor)
throws CommunicationException
notifyAndCopyEntries in class NodepotentialPredecessor - Remote node which invokes this method
CommunicationExceptionpublic final void ping()
ping in class Node
public final void insertEntry(Entry toInsert)
throws CommunicationException
insertEntry in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.public final void insertReplicas(Set<Entry> replicatesToInsert)
insertReplicas in class NodereplicatesToInsert - The entries that are replicated.
public final void removeEntry(Entry entryToRemove)
throws CommunicationException
removeEntry in class NodeentryToRemove - The entry to remove from the dht.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public final void removeReplicas(ID sendingNodeID,
Set<Entry> replicasToRemove)
removeReplicas in class NodesendingNodeID - ID of sending node; if entriesToRemove is empty, all replicas
with ID smaller than the sending node's ID are removedreplicasToRemove - Replicas to remove; if empty, all replicas with ID smaller
than the sending node's ID are removed
public final Set<Entry> retrieveEntries(ID id)
throws CommunicationException
retrieveEntries in class NodeSet of entries associated with id.
CommunicationException - Thrown if an unresolvable communication failure occurs.public final void leavesNetwork(Node predecessor)
leavesNetwork in class Node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||