Rice Pastry API

rice.p2p.past
Class ContentHashPastContent

java.lang.Object
  extended byrice.p2p.past.ContentHashPastContent
All Implemented Interfaces:
PastContent, java.io.Serializable
Direct Known Subclasses:
DistPastTestContent, MyPastContent

public abstract class ContentHashPastContent
extends java.lang.Object
implements PastContent

Version:
$Id: ContentHashPastContent.java,v 1.9 2005/08/03 01:45:34 jstewart Exp $
Author:
Peter Druschel, Alan Mislove
See Also:
Serialized Form

Field Summary
protected  Id myId
          DESCRIBE THE FIELD
 
Constructor Summary
ContentHashPastContent(Id myId)
          Constructor for ContentHashPastContent.
 
Method Summary
 PastContent checkInsert(Id id, PastContent existingContent)
          Checks if a insert operation should be allowed.
 PastContentHandle getHandle(Past local)
          Produces a handle for this content object.
 Id getId()
          Returns the Id under which this object is stored in Past.
 boolean isMutable()
          States if this content object is mutable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myId

protected Id myId
DESCRIBE THE FIELD

Constructor Detail

ContentHashPastContent

public ContentHashPastContent(Id myId)
Constructor for ContentHashPastContent.

Parameters:
myId - DESCRIBE THE PARAMETER
Method Detail

getHandle

public PastContentHandle getHandle(Past local)
Produces a handle for this content object. The handle is retrieved and returned to the client as a result of the Past.lookupHandles() method.

Specified by:
getHandle in interface PastContent
Parameters:
local - The local past service
Returns:
the handle

getId

public Id getId()
Returns the Id under which this object is stored in Past.

Specified by:
getId in interface PastContent
Returns:
the id

isMutable

public boolean isMutable()
States if this content object is mutable. Mutable objects are not subject to dynamic caching in Past.

Specified by:
isMutable in interface PastContent
Returns:
true if this object is mutable, else false

checkInsert

public PastContent checkInsert(Id id,
                               PastContent existingContent)
                        throws PastException
Checks if a insert operation should be allowed. Invoked when a Past node receives an insert request and it is a replica root for the id; invoked on the object to be inserted. This method determines the effect of an insert operation on an object that already exists: it computes the new value of the stored object, as a function of the new and the existing object.

Specified by:
checkInsert in interface PastContent
Parameters:
id - the key identifying the object
existingContent - DESCRIBE THE PARAMETER
Returns:
null, if the operation is not allowed; else, the new object to be stored on the local node.
Throws:
PastException - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection