Rice Pastry API

rice.past
Class PASTServiceImpl

java.lang.Object
  |
  +--rice.past.PASTServiceImpl
All Implemented Interfaces:
Application, PASTService, RMClient

Deprecated. This version of PAST has been deprecated - please use the version located in the rice.p2p.past package.

public class PASTServiceImpl
extends java.lang.Object
implements PASTService, Application, RMClient

Version:
$Id: PASTServiceImpl.java,v 1.20 2003/07/23 19:01:51 amislove Exp $
Author:
Charles Reis, Alan Mislove, Ansley Post

Field Summary
protected  java.util.Hashtable commandTable
          Deprecated. The table used to store commands waiting for a response.
static boolean DEBUG
          Deprecated. Whether to print debugging statements.
 
Constructor Summary
PASTServiceImpl(rice.p2p.commonapi.Node node, rice.persistence.StorageManager storage, java.lang.String instance)
          Deprecated. Builds a new PASTService to run on the given PastryNode, given a Storage object (to persistedly store objects) and a cache used to cache objects.
 
Method Summary
protected  void _handleResponseMessage(rice.past.messaging.PASTMessage msg)
          Deprecated. Receives a response message after a request has been sent and gives it to the appropriate command.
protected  void _sendRequestMessage(rice.past.messaging.PASTMessage msg, rice.Continuation command)
          Deprecated. Sends a request message and stores the given command to be executed when the response is received.
protected  void debug(java.lang.String message)
          Deprecated. Prints a debugging message to System.out if the DEBUG flag is turned on.
 void delete(rice.p2p.commonapi.Id id, rice.Continuation command)
          Deprecated. Reclaims the storage used by the object with the given ID.
 void deliver(rice.p2p.commonapi.Id id, rice.p2p.commonapi.Message msg)
          Deprecated. Called by pastry when a message arrives for this application.
 void exists(rice.p2p.commonapi.Id id, rice.Continuation command)
          Deprecated. Determines whether an object is currently stored at the given ID.
 void fetch(rice.pastry.IdSet keySet)
          Deprecated. This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also
 boolean forward(rice.p2p.commonapi.RouteMessage message)
          Deprecated. This method is invoked on applications when the underlying node is about to forward the given message with the provided target to the specified next hop.
 rice.p2p.commonapi.Id getId()
          Deprecated. Returns the Node
 rice.rm.RM getRM()
          Deprecated. Return the RM
 rice.persistence.StorageManager getStorage()
          Deprecated. Returns the StorageManager object
 void insert(rice.p2p.commonapi.Id id, java.io.Serializable obj, rice.Continuation command)
          Deprecated. Inserts an object with the given ID into distributed storage.
 void isResponsible(rice.pastry.IdRange range)
          Deprecated. This upcall is to notify the application of the range of keys for which it is responsible.
 void lookup(rice.p2p.commonapi.Id id, rice.Continuation command)
          Deprecated. Retrieves the object and all associated updates with the given ID.
 void rmIsReady(rice.rm.RM rm)
          Deprecated. This upcall is simply to denote that the underlying replica manager (rm) is ready.
 rice.pastry.IdSet scan(rice.pastry.IdRange range)
          Deprecated. This upcall should return the set of keys that the application currently stores in this range.
 void sendMessage(rice.past.messaging.PASTMessage msg)
          Deprecated. Sends a message to a remote PAST node (either a request or response).
 void update(rice.p2p.commonapi.NodeHandle handle, boolean joined)
          Deprecated. This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Deprecated. 
Whether to print debugging statements.


commandTable

protected java.util.Hashtable commandTable
Deprecated. 
The table used to store commands waiting for a response. Maps PASTMessageID to Continuation.

Constructor Detail

PASTServiceImpl

public PASTServiceImpl(rice.p2p.commonapi.Node node,
                       rice.persistence.StorageManager storage,
                       java.lang.String instance)
Deprecated. 
Builds a new PASTService to run on the given PastryNode, given a Storage object (to persistedly store objects) and a cache used to cache objects.

Parameters:
node - the node to run on
storage - The Storage object to use for storage and caching
instance - The instance name for Past to use
Method Detail

getStorage

public rice.persistence.StorageManager getStorage()
Deprecated. 
Returns the StorageManager object

Returns:
This PAST's StorageManager object

getId

public rice.p2p.commonapi.Id getId()
Deprecated. 
Returns the Node

Returns:
This PAST's Node

getRM

public rice.rm.RM getRM()
Deprecated. 
Return the RM

Returns:
The Rm

deliver

public void deliver(rice.p2p.commonapi.Id id,
                    rice.p2p.commonapi.Message msg)
Deprecated. 
Called by pastry when a message arrives for this application.

Specified by:
deliver in interface Application
Parameters:
id - The destination id of the incoming message
msg - the message that is arriving.

forward

public boolean forward(rice.p2p.commonapi.RouteMessage message)
Deprecated. 
This method is invoked on applications when the underlying node is about to forward the given message with the provided target to the specified next hop. Applications can change the contents of the message, specify a different nextHop (through re-routing), or completely terminate the message.

Specified by:
forward in interface Application
Parameters:
message - The message being sent, containing an internal message along with a destination key and nodeHandle next hop.
Returns:
Whether or not to forward the message further

update

public void update(rice.p2p.commonapi.NodeHandle handle,
                   boolean joined)
Deprecated. 
This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call.

Specified by:
update in interface Application
Parameters:
handle - The handle that has joined/left
joined - Whether the node has joined or left

sendMessage

public void sendMessage(rice.past.messaging.PASTMessage msg)
Deprecated. 
Sends a message to a remote PAST node (either a request or response).

Parameters:
msg - PASTMessage to send

_sendRequestMessage

protected void _sendRequestMessage(rice.past.messaging.PASTMessage msg,
                                   rice.Continuation command)
Deprecated. 
Sends a request message and stores the given command to be executed when the response is received.

Parameters:
msg - Request to send
command - Command to execute when the result is received

_handleResponseMessage

protected void _handleResponseMessage(rice.past.messaging.PASTMessage msg)
Deprecated. 
Receives a response message after a request has been sent and gives it to the appropriate command.


insert

public void insert(rice.p2p.commonapi.Id id,
                   java.io.Serializable obj,
                   rice.Continuation command)
Deprecated. 
Inserts an object with the given ID into distributed storage. Asynchronously returns a boolean as the result to the provided InsertResultCommand, indicating whether the insert was successful.

Specified by:
insert in interface PASTService
Parameters:
id - Pastry key identifying the object to be stored
obj - Persistable object to be stored
command - Command to be performed when the result is received

lookup

public void lookup(rice.p2p.commonapi.Id id,
                   rice.Continuation command)
Deprecated. 
Retrieves the object and all associated updates with the given ID. Asynchronously returns a StorageObject as the result to the provided Continuation.

Specified by:
lookup in interface PASTService
Parameters:
id - Pastry key of original object
command - Command to be performed when the result is received

exists

public void exists(rice.p2p.commonapi.Id id,
                   rice.Continuation command)
Deprecated. 
Determines whether an object is currently stored at the given ID. Asynchronously returns a boolean as the result to the provided Continuation, indicating whether the object exists.

Specified by:
exists in interface PASTService
Parameters:
id - Pastry key of original object
command - Command to be performed when the result is received

delete

public void delete(rice.p2p.commonapi.Id id,
                   rice.Continuation command)
Deprecated. 
Reclaims the storage used by the object with the given ID. Asynchronously returns a boolean as the result to the provided Continuation, indicating whether the delete was successful.

Specified by:
delete in interface PASTService
Parameters:
id - Pastry key of original object
command - Command to be performed when the result is received

fetch

public void fetch(rice.pastry.IdSet keySet)
Deprecated. 
This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also

Specified by:
fetch in interface RMClient
Parameters:
keySet - The keys to fetch

rmIsReady

public void rmIsReady(rice.rm.RM rm)
Deprecated. 
This upcall is simply to denote that the underlying replica manager (rm) is ready.

Specified by:
rmIsReady in interface RMClient
Parameters:
rm - The rm which is now ready

isResponsible

public void isResponsible(rice.pastry.IdRange range)
Deprecated. 
This upcall is to notify the application of the range of keys for which it is responsible. The application might choose to react to call by calling a scan(complement of this range) to the persistance manager and get the keys for which it is not responsible and call delete on the persistance manager for those objects

Specified by:
isResponsible in interface RMClient
Parameters:
range - The range this node is now responseable for

scan

public rice.pastry.IdSet scan(rice.pastry.IdRange range)
Deprecated. 
This upcall should return the set of keys that the application currently stores in this range. Should return a empty IdSet (not null), in the case that no keys belong to this range

Specified by:
scan in interface RMClient
Parameters:
range - the requested range
Returns:
The set of contained ids in the given range

debug

protected void debug(java.lang.String message)
Deprecated. 
Prints a debugging message to System.out if the DEBUG flag is turned on.

Parameters:
message - The message to print

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection