ePOST API

rice.p2p.aggregation
Class Aggregate

java.lang.Object
  extended by rice.p2p.aggregation.Aggregate
All Implemented Interfaces:
java.io.Serializable, GCPastContent, PastContent

public class Aggregate
extends java.lang.Object
implements GCPastContent

See Also:
Serialized Form

Field Summary
protected  GCPastContent[] components
           
protected  Id myId
           
protected  Id[] pointers
           
 
Constructor Summary
Aggregate(GCPastContent[] components, Id[] pointers)
           
 
Method Summary
 PastContent checkInsert(Id id, PastContent existingContent)
          Checks if a insert operation should be allowed.
 GCPastContent getComponent(int index)
           
 byte[] getContentHash()
           
 GCPastContentHandle getHandle(GCPast local, long expiration)
          Produces a handle for this content object.
 PastContentHandle getHandle(Past local)
          Produces a handle for this content object.
 Id getId()
          Returns the Id under which this object is stored in Past.
 GCPastMetadata getMetadata(long expiration)
          Returns the metadata which should be stored with this object.
 Id[] getPointers()
           
 long getVersion()
          Returns the version number associated with this PastContent object - version numbers are designed to be monotonically increasing numbers which signify different versions of the same object.
 boolean isMutable()
          States if this content object is mutable.
 int numComponents()
           
 void setId(Id myId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

components

protected GCPastContent[] components

pointers

protected Id[] pointers

myId

protected Id myId
Constructor Detail

Aggregate

public Aggregate(GCPastContent[] components,
                 Id[] pointers)
Method Detail

setId

public void setId(Id myId)

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

getPointers

public Id[] getPointers()

numComponents

public int numComponents()

getComponent

public GCPastContent getComponent(int index)

getVersion

public long getVersion()
Description copied from interface: GCPastContent
Returns the version number associated with this PastContent object - version numbers are designed to be monotonically increasing numbers which signify different versions of the same object.

Specified by:
getVersion in interface GCPastContent
Returns:
The version number of this object

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

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

getContentHash

public byte[] getContentHash()

getHandle

public PastContentHandle getHandle(Past local)
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

getHandle

public GCPastContentHandle getHandle(GCPast local,
                                     long expiration)
Description copied from interface: GCPastContent
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 GCPastContent
Returns:
the handle

getMetadata

public GCPastMetadata getMetadata(long expiration)
Description copied from interface: GCPastContent
Returns the metadata which should be stored with this object. Allows applications to add arbitrary items into the object's metadata.

Specified by:
getMetadata in interface GCPastContent
Returns:
the handle

ePOST API

Copyright © 2001-2005 - Rice Pastry.