|
||||||||||
| 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.
| Method Summary | |
|---|---|
void |
disconnect()
Closes the connection to the node. |
java.util.List<ResponsibleNode> |
findSuccessor(int tag,
java.lang.String res,
URL url)
Returns the node which is responsible for the given resource. |
Node |
findSuccessorAtFloor(Floor floor,
ID key)
Returns the node which is responsible for the given key at given floor. |
java.util.ArrayList<MyFloor> |
getAllFloors()
|
Entries |
getEntriesForFloor(Floor floor)
|
Floor |
getFirstFloor()
|
ID |
getIdForFloor(Floor floor)
|
References |
getReferencesForFloor(Floor floor)
|
void |
insertEntry(Floor floor,
Entry toInsert)
Stores the given object under the given ID at given floor. |
void |
insertReplicas(Floor floor,
java.util.Set<Entry> replicatesToInsert)
Inserts replicates of the given entries for given floor. |
void |
leavesNetwork(Floor floor,
Node predecessor)
Inform all predecessor of given node that it leaves the network. |
java.util.List<Node> |
notify(Floor floor,
Node potentialPredecessor)
Requests this node's predecessor at given floor in result[0] and successor list in result[1..length-1]. |
RefsAndEntries |
notifyAndCopyEntries(Floor floor,
Node potentialPredecessor)
Requests this node's predecessor, successor list and entries at given floor. |
void |
ping()
Requests a sign of live. |
void |
removeEntry(Floor floor,
Entry entryToRemove)
Removes the given object from the list stored under the given ID at given floor. |
void |
removeReplicas(Floor floor,
ID sendingNodeID,
java.util.Set<Entry> replicasToRemove)
Removes replicates of the given entries for given floor. |
java.util.Set<Entry> |
retrieveEntries(Floor floor,
ID id)
Returns all entries stored under the given ID. |
| Methods inherited from class de.uniba.wiai.lspi.chord.com.Node |
|---|
equals, getNodeURL, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public final void disconnect()
disconnect in class Nodepublic final References getReferencesForFloor(Floor floor)
public final Entries getEntriesForFloor(Floor floor)
public final ID getIdForFloor(Floor floor)
getIdForFloor in class Nodepublic final java.util.ArrayList<MyFloor> getAllFloors()
public final Node findSuccessorAtFloor(Floor floor,
ID key)
findSuccessorAtFloor in class Nodefloor - Floor at which is searched being held.key - Key for which the successor is searched for.
public final java.util.List<ResponsibleNode> findSuccessor(int tag,
java.lang.String res,
URL url)
findSuccessor in class Nodetag - Tag for checking is the request is already processed.res - Resource for which the successor is searched for.url - URL of the node which successor is searched for.
public final java.util.List<Node> notify(Floor floor,
Node potentialPredecessor)
notify in class Node
public final RefsAndEntries notifyAndCopyEntries(Floor floor,
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(Floor floor,
Entry toInsert)
throws CommunicationException
insertEntry in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.
public final void insertReplicas(Floor floor,
java.util.Set<Entry> replicatesToInsert)
insertReplicas in class NodereplicatesToInsert - The entries that are replicated.
public final void removeEntry(Floor floor,
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(Floor floor,
ID sendingNodeID,
java.util.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 java.util.Set<Entry> retrieveEntries(Floor floor,
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(Floor floor,
Node predecessor)
leavesNetwork in class Nodepublic Floor getFirstFloor()
getFirstFloor in class Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||