de.uniba.wiai.lspi.chord.com.rmi
Class RMIProxy

java.lang.Object
  extended by de.uniba.wiai.lspi.chord.com.Node
      extended by de.uniba.wiai.lspi.chord.com.Proxy
          extended by de.uniba.wiai.lspi.chord.com.rmi.RMIProxy

public final class RMIProxy
extends Proxy


Field Summary
 
Fields inherited from class de.uniba.wiai.lspi.chord.com.Node
nodeID, nodeURL
 
Method Summary
static RMIProxy create(URL localURL, URL url)
           
 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 entryToInsert)
          Stores the given object under the given ID.
 void insertReplicas(Set<Entry> entries)
          Inserts replicates of the given entries.
 void leavesNetwork(Node predecessor)
          Inform a node that its predecessor leaves the network.
 List<Node> notify(Node predecessor)
          Requests this node's predecessor in result[0] and successor list in result[1..length-1].
 RefsAndEntries notifyAndCopyEntries(Node predecessor)
          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 sendingNode, Set<Entry> replicasToRemove)
          Removes replicates of the given entries.
 Set<Entry> retrieveEntries(ID id)
          Returns all entries stored under the given ID.
 void testConnection()
           
 
Methods inherited from class de.uniba.wiai.lspi.chord.com.Proxy
createConnection
 
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

create

public static RMIProxy create(URL localURL,
                              URL url)
                       throws CommunicationException
Parameters:
localURL -
url -
Returns:
Throws:
CommunicationException

disconnect

public void disconnect()
Description copied from class: Node
Closes the connection to the node.

Specified by:
disconnect in class Node

testConnection

public void testConnection()
                    throws CommunicationException
Throws:
CommunicationException

findSuccessor

public Node findSuccessor(ID key)
                   throws CommunicationException
Description copied from class: Node
Returns the Chord node which is responsible for the given key.

Specified by:
findSuccessor in class Node
Parameters:
key - Key for which the successor is searched for.
Returns:
Responsible node.
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

insertEntry

public void insertEntry(Entry entryToInsert)
                 throws CommunicationException
Description copied from class: Node
Stores the given object under the given ID.

Specified by:
insertEntry in class Node
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

insertReplicas

public void insertReplicas(Set<Entry> entries)
                    throws CommunicationException
Description copied from class: Node
Inserts replicates of the given entries.

Specified by:
insertReplicas in class Node
Parameters:
entries - The entries that are replicated.
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

leavesNetwork

public void leavesNetwork(Node predecessor)
                   throws CommunicationException
Description copied from class: Node
Inform a node that its predecessor leaves the network.

Specified by:
leavesNetwork in class Node
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

notify

public List<Node> notify(Node predecessor)
                  throws CommunicationException
Description copied from class: Node
Requests this node's predecessor in result[0] and successor list in result[1..length-1]. This method is invoked by another node which thinks it is this node's predecessor.

Specified by:
notify in class Node
Returns:
A list containing the predecessor at first position of the list and the successors in the rest of the list.
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

notifyAndCopyEntries

public RefsAndEntries notifyAndCopyEntries(Node predecessor)
                                    throws CommunicationException
Description copied from class: Node
Requests this node's predecessor, successor list and entries.

Specified by:
notifyAndCopyEntries in class Node
Parameters:
predecessor - Remote node which invokes this method
Returns:
References to predecessor and successors and the entries this node will be responsible for.
Throws:
CommunicationException

ping

public void ping()
          throws CommunicationException
Description copied from class: Node
Requests a sign of live. This method is invoked by another node which thinks it is this node's successor.

Specified by:
ping in class Node
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

removeEntry

public void removeEntry(Entry entryToRemove)
                 throws CommunicationException
Description copied from class: Node
Removes the given object from the list stored under the given ID.

Specified by:
removeEntry in class Node
Parameters:
entryToRemove - The entry to remove from the dht.
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

removeReplicas

public void removeReplicas(ID sendingNode,
                           Set<Entry> replicasToRemove)
                    throws CommunicationException
Description copied from class: Node
Removes replicates of the given entries.

Specified by:
removeReplicas in class Node
Parameters:
sendingNode - ID of sending node; if entriesToRemove is empty, all replicas with ID smaller than the sending node's ID are removed
replicasToRemove - Replicas to remove; if empty, all replicas with ID smaller than the sending node's ID are removed
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.

retrieveEntries

public Set<Entry> retrieveEntries(ID id)
                           throws CommunicationException
Description copied from class: Node
Returns all entries stored under the given ID.

Specified by:
retrieveEntries in class Node
Returns:
A Set of entries associated with id.
Throws:
CommunicationException - Thrown if an unresolvable communication failure occurs.


Copyright © 2004-2008 Karsten Loesing, Sven Kaffille - Distributed and Mobile Systems Group, Lehrstuhl für Praktische Informatik, Universität Bamberg. All Rights Reserved.