|
|||||||||
| 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
public abstract class Node
Provides methods which remote nodes can invoke.
| Field Summary | |
|---|---|
protected ID |
nodeID
This is the id of this node. |
protected URL |
nodeURL
This is the url of this node. |
| Constructor Summary | |
|---|---|
Node()
|
|
| Method Summary | |
|---|---|
abstract void |
disconnect()
Closes the connection to the node. |
boolean |
equals(Object arg0)
|
abstract Node |
findSuccessor(ID key)
Returns the Chord node which is responsible for the given key. |
ID |
getNodeID()
Returns the ID of a node. |
URL |
getNodeURL()
|
int |
hashCode()
|
abstract void |
insertEntry(Entry entryToInsert)
Stores the given object under the given ID. |
abstract void |
insertReplicas(Set<Entry> entries)
Inserts replicates of the given entries. |
abstract void |
leavesNetwork(Node predecessor)
Inform a node that its predecessor leaves the network. |
abstract List<Node> |
notify(Node potentialPredecessor)
Requests this node's predecessor in result[0] and successor list in result[1..length-1]. |
abstract RefsAndEntries |
notifyAndCopyEntries(Node potentialPredecessor)
Requests this node's predecessor, successor list and entries. |
abstract void |
ping()
Requests a sign of live. |
abstract void |
removeEntry(Entry entryToRemove)
Removes the given object from the list stored under the given ID. |
abstract void |
removeReplicas(ID sendingNode,
Set<Entry> replicasToRemove)
Removes replicates of the given entries. |
abstract Set<Entry> |
retrieveEntries(ID id)
Returns all entries stored under the given ID. |
protected void |
setNodeID(ID nodeID)
|
protected void |
setNodeURL(URL nodeURL)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ID nodeID
protected URL nodeURL
| Constructor Detail |
|---|
public Node()
| Method Detail |
|---|
public final boolean equals(Object arg0)
equals in class Objectpublic final int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic final ID getNodeID()
CommunicationException - If something goes wrong when contacting the node.public final URL getNodeURL()
public abstract Node findSuccessor(ID key)
throws CommunicationException
key - Key for which the successor is searched for.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract List<Node> notify(Node potentialPredecessor)
throws CommunicationException
potentialPredecessor -
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract RefsAndEntries notifyAndCopyEntries(Node potentialPredecessor)
throws CommunicationException
potentialPredecessor - Remote node which invokes this method
CommunicationException
public abstract void ping()
throws CommunicationException
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract void insertEntry(Entry entryToInsert)
throws CommunicationException
entryToInsert -
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract void insertReplicas(Set<Entry> entries)
throws CommunicationException
entries - The entries that are replicated.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract void removeEntry(Entry entryToRemove)
throws CommunicationException
entryToRemove - The entry to remove from the dht.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract void removeReplicas(ID sendingNode,
Set<Entry> replicasToRemove)
throws CommunicationException
sendingNode - 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
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract Set<Entry> retrieveEntries(ID id)
throws CommunicationException
id -
Set of entries associated with id.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public abstract void leavesNetwork(Node predecessor)
throws CommunicationException
predecessor -
CommunicationException - Thrown if an unresolvable communication failure occurs.public abstract void disconnect()
protected final void setNodeID(ID nodeID)
nodeID - the nodeID to setprotected final void setNodeURL(URL nodeURL)
nodeURL - the nodeURL to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||