|
||||||||||
| 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.com.Proxy
de.uniba.wiai.lspi.chord.com.local.ThreadProxy
public final class ThreadProxy
This class represents a Proxy for the protocol that allows
to be build a (local) chord network within one JVM.
| Constructor Summary | |
|---|---|
ThreadProxy(URL creatorURL1,
URL url)
Creates a Proxy for the jchordlocal protocol. |
|
| 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. |
ThreadEndpoint |
getEndpoint()
Get a reference to the endpoint this proxy
delegates methods to. |
Floor |
getFirstFloor()
|
ID |
getIdForFloor(Floor floor)
|
void |
insertEntry(Floor floor,
Entry entry)
Stores the given object under the given ID at given floor. |
void |
insertReplicas(Floor floor,
java.util.Set<Entry> entries)
Inserts replicates of the given entries for given floor. |
void |
invalidate()
Invalidates this proxy. |
boolean |
isValid()
Test if this Proxy is valid. |
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 entry)
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> entriesToRemove)
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. |
java.lang.String |
toString()
|
| Methods inherited from class de.uniba.wiai.lspi.chord.com.Proxy |
|---|
createConnection |
| Methods inherited from class de.uniba.wiai.lspi.chord.com.Node |
|---|
equals, getNodeURL, hashCode |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadProxy(URL creatorURL1,
URL url)
throws CommunicationException
jchordlocal protocol. The host
name part of urlis the name of the node in the
jchordlocal protocol.
creatorURL1 - url - The URLof the node this proxy represents.
CommunicationException| Method Detail |
|---|
public boolean isValid()
true if this Proxy is valid.public void invalidate()
public ThreadEndpoint getEndpoint()
throws CommunicationException
endpoint this proxy
delegates methods to. If there is no endpoint a
exception is thrown.
endpoint this proxy
delegates methods to.
CommunicationException - If there is no endpoint this exception is thrown.
public Node findSuccessorAtFloor(Floor floor,
ID key)
throws CommunicationException
Node
findSuccessorAtFloor in class Nodefloor - Floor at which is searched being held.key - Key for which the successor is searched for.
CommunicationException
public java.util.List<ResponsibleNode> findSuccessor(int tag,
java.lang.String res,
URL url)
throws CommunicationException
Node
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.
CommunicationException
public void insertEntry(Floor floor,
Entry entry)
throws CommunicationException
Node
insertEntry in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.
public void removeEntry(Floor floor,
Entry entry)
throws CommunicationException
Node
removeEntry in class Nodeentry - The entry to remove from the dht.
CommunicationException - Thrown if an unresolvable communication failure occurs.public java.lang.String toString()
toString in class Node
public java.util.List<Node> notify(Floor floor,
Node potentialPredecessor)
throws CommunicationException
Node
notify in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.
public void ping()
throws CommunicationException
Node
ping in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.
public java.util.Set<Entry> retrieveEntries(Floor floor,
ID id)
throws CommunicationException
Node
retrieveEntries in class NodeSet of entries associated with id.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public void leavesNetwork(Floor floor,
Node predecessor)
throws CommunicationException
Node
leavesNetwork in class NodeCommunicationException - Thrown if an unresolvable communication failure occurs.
public void removeReplicas(Floor floor,
ID sendingNodeID,
java.util.Set<Entry> entriesToRemove)
throws CommunicationException
Node
removeReplicas in class NodesendingNodeID - ID of sending node; if entriesToRemove is empty, all replicas
with ID smaller than the sending node's ID are removedentriesToRemove - 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 void insertReplicas(Floor floor,
java.util.Set<Entry> entries)
throws CommunicationException
Node
insertReplicas in class Nodeentries - The entries that are replicated.
CommunicationException - Thrown if an unresolvable communication failure occurs.
public RefsAndEntries notifyAndCopyEntries(Floor floor,
Node potentialPredecessor)
throws CommunicationException
Node
notifyAndCopyEntries in class NodepotentialPredecessor - Remote node which invokes this method
CommunicationExceptionpublic void disconnect()
Node
disconnect in class Nodepublic ID getIdForFloor(Floor floor)
getIdForFloor in class Node
public Floor getFirstFloor()
throws CommunicationException
getFirstFloor in class NodeCommunicationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||