ePOST API

rice.post.log
Class LogEntry

java.lang.Object
  extended by rice.post.log.LogEntry
All Implemented Interfaces:
java.io.Serializable, PostData
Direct Known Subclasses:
CoalescedLog.PhantomLogEntry, EmailLogEntry

public abstract class LogEntry
extends java.lang.Object
implements PostData

Abstract class for all entries in the log. Each application using post should implement a class hierarchy of log entries relevant to the semantics of that system.

Version:
$Id: LogEntry.java 2808 2005-11-22 14:38:49Z jeffh $
See Also:
Serialized Form

Field Summary
protected  Logger logger
           
protected  Post post
           
protected  LogEntryReference previousEntryReference
           
protected  LogEntryReference[] previousEntryReferences
           
protected  PostEntityAddress user
           
 
Constructor Summary
LogEntry()
          Constructs a LogEntry
 
Method Summary
 ContentHashReference buildContentHashReference(Id[] location, byte[][] key)
          Builds a LogEntryReference object to this log, given a location and the encryption key
 SecureReference buildSecureReference(Id location, byte[] key)
          This method is not supported (you CAN NOT store a log as a secure block).
 SignedReference buildSignedReference(Id location)
          This method is not supported (you CAN NOT store a log entry as a public-key signed block).
protected  boolean contains(LogEntry entry)
          Returns whether or not this coaleseced log entry contains the provided entry
 LogEntry getCachedPreviousEntry()
          Returns the cached previous entry, if it exists and is in memory.
 void getPreviousEntry(Continuation command)
          Returns the reference to the previous entry in the log
 LogEntryReference getPreviousEntryReference()
          Returns the reference to the previous entry in the log
protected  void getRealPreviousEntry(Continuation command)
          Returns the reference to the previous entry in the log
 boolean hasPreviousEntry()
          Returns whether or not this log entry has a previous log entry
 void setPreviousEntryReferences(LogEntryReference[] ref)
          Sets the reference to the previous entry in the log
 void setUser(PostEntityAddress user)
          Sets the user of this log entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

protected PostEntityAddress user

previousEntryReference

protected LogEntryReference previousEntryReference

previousEntryReferences

protected LogEntryReference[] previousEntryReferences

post

protected transient Post post

logger

protected transient Logger logger
Constructor Detail

LogEntry

public LogEntry()
Constructs a LogEntry

Method Detail

contains

protected boolean contains(LogEntry entry)
Returns whether or not this coaleseced log entry contains the provided entry

Parameters:
entry - The entry to search for
Returns:
Whetehr or not this entry contains it

setUser

public void setUser(PostEntityAddress user)
Sets the user of this log entry

Parameters:
user - The user who created this entry

setPreviousEntryReferences

public void setPreviousEntryReferences(LogEntryReference[] ref)
Sets the reference to the previous entry in the log

Parameters:
ref - A reference to the previous log entry

getPreviousEntryReference

public LogEntryReference getPreviousEntryReference()
Returns the reference to the previous entry in the log

Returns:
A reference to the previous log entry

hasPreviousEntry

public boolean hasPreviousEntry()
Returns whether or not this log entry has a previous log entry

Returns:
Whether or not this log entry has a previous

getPreviousEntry

public void getPreviousEntry(Continuation command)
Returns the reference to the previous entry in the log


getCachedPreviousEntry

public LogEntry getCachedPreviousEntry()
Returns the cached previous entry, if it exists and is in memory. Otherwise, it returns null.

Returns:
The cached previous entry

getRealPreviousEntry

protected final void getRealPreviousEntry(Continuation command)
Returns the reference to the previous entry in the log


buildSignedReference

public SignedReference buildSignedReference(Id location)
This method is not supported (you CAN NOT store a log entry as a public-key signed block).

Specified by:
buildSignedReference in interface PostData
Parameters:
location - The location of this object.
Returns:
A pointer to the data
Throws:
IllegalArgument - Always

buildContentHashReference

public ContentHashReference buildContentHashReference(Id[] location,
                                                      byte[][] key)
Builds a LogEntryReference object to this log, given a location and the encryption key

Specified by:
buildContentHashReference in interface PostData
Parameters:
location - The location of the stored data
key - The key used to encrypt this object
Returns:
A LogEntryReference to this object

buildSecureReference

public SecureReference buildSecureReference(Id location,
                                            byte[] key)
This method is not supported (you CAN NOT store a log as a secure block).

Specified by:
buildSecureReference in interface PostData
Parameters:
location - The location of the data
key - The for the data
Returns:
A pointer to the data
Throws:
java.lang.IllegalArgumentException - Always

ePOST API

Copyright © 2001-2005 - Rice Pastry.