|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.uniba.wiai.lspi.chord.com.Endpoint
de.uniba.wiai.lspi.chord.com.local.ThreadEndpoint
public final class ThreadEndpoint
This represents the Endpoint for the protocol that can be used to
build a (local) chord network within one JVM.
| Field Summary |
|---|
| Fields inherited from class de.uniba.wiai.lspi.chord.com.Endpoint |
|---|
ACCEPT_ENTRIES, DISCONNECTED, LISTENING, METHODS_ALLOWED_IN_ACCEPT_ENTRIES, STARTED |
| Constructor Summary | |
|---|---|
ThreadEndpoint(Node node1,
URL url1)
Creates a new Endpoint for communication via Java Threads. |
|
| Method Summary | |
|---|---|
void |
crash()
Method to emulate a crash of the node that this is the endpoint for. |
boolean |
equals(java.lang.Object obj)
Overwritten from Object. |
java.util.List<ResponsibleNode> |
findSuccessor(int tag,
java.lang.String res,
URL url)
|
Node |
findSuccessorAtFloor(Floor floor,
ID key)
|
int |
hashCode()
Overwritten from Object. |
void |
insertEntry(Floor floor,
Entry entry)
|
void |
insertReplicas(Floor floor,
java.util.Set<Entry> entries)
|
void |
leavesNetwork(Floor floor,
Node predecessor)
|
java.util.List<Node> |
notify(Floor floor,
Node potentialPredecessor)
|
RefsAndEntries |
notifyAndCopyEntries(Floor floor,
Node potentialPredecessor)
|
void |
ping()
|
void |
register(InvocationListener listener)
|
void |
removeEntry(Floor floor,
Entry entry)
|
void |
removeReplicas(Floor floor,
ID sendingNodeID,
java.util.Set<Entry> entriesToRemove)
|
java.util.Set<Entry> |
retrieveEntries(Floor floor,
ID id)
|
java.lang.String |
toString()
Overwritten from Object. |
| Methods inherited from class de.uniba.wiai.lspi.chord.com.Endpoint |
|---|
acceptEntries, createEndpoint, deregister, disconnect, getEndpoint, getNode, getState, getURL, listen, register |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadEndpoint(Node node1,
URL url1)
node1 - The Nodethis endpoint invocates methods on.url1 - The URLof this endpoint. The hostname of url is the
name of the node.| Method Detail |
|---|
public void register(InvocationListener listener)
listener -
public Node findSuccessorAtFloor(Floor floor,
ID key)
throws CommunicationException
key -
key.
CommunicationException
public java.util.List<ResponsibleNode> findSuccessor(int tag,
java.lang.String res,
URL url)
throws CommunicationException
CommunicationException
public void insertEntry(Floor floor,
Entry entry)
throws CommunicationException
entry -
CommunicationException
public void removeEntry(Floor floor,
Entry entry)
throws CommunicationException
entry -
CommunicationException
public java.util.List<Node> notify(Floor floor,
Node potentialPredecessor)
throws CommunicationException
potentialPredecessor -
Node#notify(Node). See documentation
of Node.
CommunicationException
public void ping()
throws CommunicationException
CommunicationException
public java.util.Set<Entry> retrieveEntries(Floor floor,
ID id)
throws CommunicationException
id -
CommunicationException
public void leavesNetwork(Floor floor,
Node predecessor)
throws CommunicationException
predecessor -
CommunicationException
public void removeReplicas(Floor floor,
ID sendingNodeID,
java.util.Set<Entry> entriesToRemove)
throws CommunicationException
sendingNodeID - entriesToRemove -
CommunicationException
public void insertReplicas(Floor floor,
java.util.Set<Entry> entries)
throws CommunicationException
entries -
CommunicationException
public RefsAndEntries notifyAndCopyEntries(Floor floor,
Node potentialPredecessor)
throws CommunicationException
potentialPredecessor -
Node#notify(Node). See documentation
of Node.
CommunicationExceptionpublic void crash()
public boolean equals(java.lang.Object obj)
Object. Two ThreadEndpoints A and B
are equal if they are endpoints for the node with the same name. (A.name ==
B.name).
equals in class java.lang.Objectobj -
true if this equals the provided obj.public int hashCode()
Object.
hashCode in class java.lang.ObjectObject.public java.lang.String toString()
Object.
toString in class Endpoint
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||