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

java.lang.Object
  extended by de.uniba.wiai.lspi.chord.com.Endpoint
      extended by de.uniba.wiai.lspi.chord.com.rmi.RMIEndpoint
All Implemented Interfaces:
RemoteNode, Remote

public final class RMIEndpoint
extends Endpoint
implements RemoteNode


Field Summary
 
Fields inherited from class de.uniba.wiai.lspi.chord.com.Endpoint
ACCEPT_ENTRIES, DISCONNECTED, endpoints, LISTENING, METHODS_ALLOWED_IN_ACCEPT_ENTRIES, node, STARTED, url
 
Constructor Summary
RMIEndpoint(Node node1, URL url1)
           
 
Method Summary
protected  void closeConnections()
          This method has to be overwritten by sub classes and is invoked by Endpoint.disconnect()to close all connections from the chord network.
protected  void entriesAcceptable()
          This method has to be overwritten by subclasses.
 de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo findSuccessor(ID key)
           
 ID getNodeID()
           
 void insertEntry(Entry entryToInsert)
           
 void insertReplicas(Set<Entry> entries)
           
 void leavesNetwork(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo predecessor)
           
 List<de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo> notify(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo potentialPredecessor)
           
 de.uniba.wiai.lspi.chord.com.rmi.RemoteRefsAndEntries notifyAndCopyEntries(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo potentialPredecessor)
           
protected  void openConnections()
          To implemented by sub classes.
 void ping()
           
 void removeEntry(Entry entryToRemove)
           
 void removeReplicas(ID sendingNode, Set<Entry> replicasToRemove)
           
 Set<Entry> retrieveEntries(ID id)
           
 
Methods inherited from class de.uniba.wiai.lspi.chord.com.Endpoint
acceptEntries, createEndpoint, deregister, disconnect, getEndpoint, getNode, getState, getURL, listen, notify, register, setState, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMIEndpoint

public RMIEndpoint(Node node1,
                   URL url1)
Method Detail

closeConnections

protected void closeConnections()
Description copied from class: Endpoint
This method has to be overwritten by sub classes and is invoked by Endpoint.disconnect()to close all connections from the chord network.

Specified by:
closeConnections in class Endpoint

entriesAcceptable

protected void entriesAcceptable()
Description copied from class: Endpoint
This method has to be overwritten by subclasses. It is called from Endpoint.acceptEntries()to indicate that entries can now be accepted. So maybe if an endpoint queues incoming requests for storage or removal of entries this requests can be answered when endpoint changes it state to ACCEPT_ENTRIES.

Specified by:
entriesAcceptable in class Endpoint

openConnections

protected void openConnections()
Description copied from class: Endpoint
To implemented by sub classes. This method is called by Endpoint.listen()to make it possible for other chord nodes to connect to the node on that this endpoint invocates methods. TODO: This method may throw an exception when starting to listen for incoming connections.

Specified by:
openConnections in class Endpoint

findSuccessor

public de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo findSuccessor(ID key)
                                                              throws CommunicationException,
                                                                     RemoteException
Specified by:
findSuccessor in interface RemoteNode
Returns:
Throws:
CommunicationException
RemoteException

getNodeID

public ID getNodeID()
             throws RemoteException
Specified by:
getNodeID in interface RemoteNode
Returns:
Throws:
RemoteException

insertEntry

public void insertEntry(Entry entryToInsert)
                 throws RemoteException,
                        CommunicationException
Specified by:
insertEntry in interface RemoteNode
Throws:
RemoteException
CommunicationException

insertReplicas

public void insertReplicas(Set<Entry> entries)
                    throws RemoteException,
                           CommunicationException
Specified by:
insertReplicas in interface RemoteNode
Throws:
RemoteException
CommunicationException

leavesNetwork

public void leavesNetwork(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo predecessor)
                   throws RemoteException,
                          CommunicationException
Specified by:
leavesNetwork in interface RemoteNode
Throws:
RemoteException
CommunicationException

notify

public List<de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo> notify(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo potentialPredecessor)
                                                             throws RemoteException,
                                                                    CommunicationException
Specified by:
notify in interface RemoteNode
Returns:
Throws:
RemoteException
CommunicationException

notifyAndCopyEntries

public de.uniba.wiai.lspi.chord.com.rmi.RemoteRefsAndEntries notifyAndCopyEntries(de.uniba.wiai.lspi.chord.com.rmi.RemoteNodeInfo potentialPredecessor)
                                                                           throws RemoteException,
                                                                                  CommunicationException
Specified by:
notifyAndCopyEntries in interface RemoteNode
Returns:
Throws:
RemoteException
CommunicationException

ping

public void ping()
          throws RemoteException
Specified by:
ping in interface RemoteNode
Throws:
RemoteException

removeEntry

public void removeEntry(Entry entryToRemove)
                 throws RemoteException,
                        CommunicationException
Specified by:
removeEntry in interface RemoteNode
Throws:
RemoteException
CommunicationException

removeReplicas

public void removeReplicas(ID sendingNode,
                           Set<Entry> replicasToRemove)
                    throws RemoteException,
                           CommunicationException
Specified by:
removeReplicas in interface RemoteNode
Throws:
RemoteException
CommunicationException

retrieveEntries

public Set<Entry> retrieveEntries(ID id)
                           throws RemoteException,
                                  CommunicationException
Specified by:
retrieveEntries in interface RemoteNode
Returns:
Throws:
RemoteException
CommunicationException


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