ePOST API

rice.email
Class SnapShot

java.lang.Object
  extended by rice.email.SnapShot
All Implemented Interfaces:
java.io.Serializable, PostData

public class SnapShot
extends java.lang.Object
implements PostData

Serves as a summary of the log chain up to the current point. Lets the email reader display the current emails without having to read through the entire chain.

Author:
Joe Montgomery
See Also:
Serialized Form

Constructor Summary
SnapShot(StoredEmail[] emails, LogEntry entry)
          Constructor for SnapShot.
 
Method Summary
 ContentHashReference buildContentHashReference(Id[] location, byte[][] key)
          This method dynamically builds an appropriate ContentHashReference for this type of PostData given a location and key.
 SecureReference buildSecureReference(Id location, byte[] key)
          This method dynamically builds an appropriate SecureReference for this type of PostData given a location and key.
 SignedReference buildSignedReference(Id location)
          This method dynamically builds an appropriate SignedReference for this type of PostData given a location.
 boolean equals(java.lang.Object o)
          Equals method
 StoredEmail[] getStoredEmails()
          Returns all of the emails that the SnapShot contains.
 LogEntry getTopEntry()
          Returns the most recent entry in the log, at the time of the snapshot
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnapShot

public SnapShot(StoredEmail[] emails,
                LogEntry entry)
Constructor for SnapShot. For the given email, creates an entry which can be used in a log chain. The next field is the next LogNode in the chain.

Parameters:
email - the email to store
top - The top of the current log
Method Detail

getStoredEmails

public StoredEmail[] getStoredEmails()
Returns all of the emails that the SnapShot contains.

Returns:
the valid emails at the point of the SnapShot

getTopEntry

public LogEntry getTopEntry()
Returns the most recent entry in the log, at the time of the snapshot

Returns:
The most recent log entry reference

equals

public boolean equals(java.lang.Object o)
Equals method

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare to
Returns:
Whether or not we are equal

buildSignedReference

public SignedReference buildSignedReference(Id location)
This method dynamically builds an appropriate SignedReference for this type of PostData given a location.

Specified by:
buildSignedReference in interface PostData
Parameters:
location - The location of the data
Returns:
A pointer to the data

buildContentHashReference

public ContentHashReference buildContentHashReference(Id[] location,
                                                      byte[][] key)
This method dynamically builds an appropriate ContentHashReference for this type of PostData given a location and key.

Specified by:
buildContentHashReference in interface PostData
Parameters:
location - The location of the data
key - The for the data
Returns:
A pointer to the data

buildSecureReference

public SecureReference buildSecureReference(Id location,
                                            byte[] key)
This method dynamically builds an appropriate SecureReference for this type of PostData given a location and key.

Specified by:
buildSecureReference in interface PostData
Parameters:
location - The location of the data
key - The for the data
Returns:
A pointer to the data

ePOST API

Copyright © 2001-2005 - Rice Pastry.