Rice Pastry API

rice.p2p.past.testing
Class RawPastRegrTest.TestPastContent

java.lang.Object
  extended by rice.p2p.past.testing.RawPastRegrTest.TestPastContent
All Implemented Interfaces:
java.io.Serializable, PastContent, RawPastContent
Direct Known Subclasses:
RawPastRegrTest.NonMutableTestPastContent, RawPastRegrTest.VersionedTestPastContent
Enclosing class:
RawPastRegrTest

protected static class RawPastRegrTest.TestPastContent
extends java.lang.Object
implements RawPastContent

Utility class for past content objects

See Also:
Serialized Form

Field Summary
protected  RawPastContent existing
           
protected  Id id
           
static short TYPE
           
 
Constructor Summary
RawPastRegrTest.TestPastContent(Id id)
           
RawPastRegrTest.TestPastContent(InputBuffer buf, Endpoint endpoint, PastContentDeserializer pcd)
           
 
Method Summary
 PastContent checkInsert(Id id, PastContent existingContent)
          Checks if a insert operation should be allowed.
 boolean equals(java.lang.Object o)
           
 PastContentHandle getHandle(Past past)
          Produces a handle for this content object.
 Id getId()
          Returns the Id under which this object is stored in Past.
 short getType()
           
 boolean isMutable()
          States if this content object is mutable.
 void serialize(OutputBuffer buf)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final short TYPE
See Also:
Constant Field Values

id

protected Id id

existing

protected RawPastContent existing
Constructor Detail

RawPastRegrTest.TestPastContent

public RawPastRegrTest.TestPastContent(Id id)

RawPastRegrTest.TestPastContent

public RawPastRegrTest.TestPastContent(InputBuffer buf,
                                       Endpoint endpoint,
                                       PastContentDeserializer pcd)
                                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

checkInsert

public PastContent checkInsert(Id id,
                               PastContent existingContent)
                        throws PastException
Description copied from interface: PastContent
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
Returns:
null, if the operation is not allowed; else, the new object to be stored on the local node.
Throws:
PastException

getHandle

public PastContentHandle getHandle(Past past)
Description copied from interface: PastContent
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
Returns:
the handle

getId

public Id getId()
Description copied from interface: PastContent
Returns the Id under which this object is stored in Past.

Specified by:
getId in interface PastContent
Returns:
the id

isMutable

public boolean isMutable()
Description copied from interface: PastContent
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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public short getType()
Specified by:
getType in interface RawPastContent

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Specified by:
serialize in interface RawPastContent
Throws:
java.io.IOException

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection