ePOST API

rice.post.log
Class CoalescedLog

java.lang.Object
  extended by rice.post.log.Log
      extended by rice.post.log.EncryptedLog
          extended by rice.post.log.CoalescedLog
All Implemented Interfaces:
java.io.Serializable, PostData
Direct Known Subclasses:
EmailLog

public class CoalescedLog
extends EncryptedLog

Class which represents an encrypted and coalesced log in the POST system. This class is designed so that applications can simply use this as the log head, instead of the Log class, and the contents of the log will automatically be encrypted and coalesced into the provided number of discrete fragments.

Version:
$Id: CoalescedLog.java 3201 2006-04-14 13:55:54Z jstewart $
See Also:
Serialized Form

Nested Class Summary
protected  class CoalescedLog.AddCoalescedLogEntryTask
          This class encapsulates the logic needed to add a log entry to the current coalesced log.
protected  class CoalescedLog.PhantomLogEntry
          Internal class for bookkeeping log entries
 
Nested classes/interfaces inherited from class rice.post.log.Log
Log.AddLogEntryTask
 
Field Summary
protected  java.util.Vector cbuffer
           
protected  byte[] cipherPending
           
static int COALESCE_NUM
           
protected  Logger logger
           
protected  rice.post.log.CoalescedLogEntry pending
           
 
Fields inherited from class rice.post.log.EncryptedLog
cipherKey, key
 
Fields inherited from class rice.post.log.Log
buffer, children, childrenCache, location, N_TOP_ENTRIES, name, post, topEntry, topEntryReference, topEntryReferences
 
Constructor Summary
CoalescedLog(java.lang.Object name, Id location, Post post, java.security.KeyPair keyPair)
          Constructs a Log for use in POST, with the provided number of coalesced log entries.
CoalescedLog(java.lang.Object name, Id location, Post post, java.security.KeyPair keyPair, byte[] cipherKey)
          Constructs a Log for use in POST, with the provided number of coalesced log entries.
 
Method Summary
 void addLogEntry(LogEntry entry, Continuation command)
          This method appends an entry into the user's log, and updates the pointer to the top of the log to reflect the new object.
 void getActualTopEntry(Continuation command)
          This method returns the *actual* top entry in the log.
 void getLogEntryReferences(java.util.Set set, LogEntry entry, Continuation command)
          This method returns a list of all the handles stored in the folder or any subfolders.
 void getTopEntry(Continuation command)
          This method returns a reference to the most recent entry in the log, which can then be used to walk down the log.
protected  void regenerateCipherPending()
          Method which regenerates the ciphertext of the number of log entries
protected  void resetPending()
          Method which resets the nuber of entries to be zero.
protected  void retrievePending()
          Method which deserializes the encrypted yet-to-be-coalesed log entries once the key has been retrieved.
 void setKeyPair(java.security.KeyPair keyPair)
          Method which deserializes the list of yet-to-be-coalesed entries when the coalesced log is read off of the wire.
 java.lang.String toString()
           
 
Methods inherited from class rice.post.log.Log
addChildLog, buildContentHashReference, buildSecureReference, buildSignedReference, cache, getChildLog, getChildLogNames, getLocation, getName, getRealTopEntry, getTopEntryReference, removeChildLog, setName, setPost, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COALESCE_NUM

public static int COALESCE_NUM

cipherPending

protected transient byte[] cipherPending

pending

protected transient rice.post.log.CoalescedLogEntry pending

cbuffer

protected transient java.util.Vector cbuffer

logger

protected transient Logger logger
Constructor Detail

CoalescedLog

public CoalescedLog(java.lang.Object name,
                    Id location,
                    Post post,
                    java.security.KeyPair keyPair)
Constructs a Log for use in POST, with the provided number of coalesced log entries.

Parameters:
name - Some unique identifier for this log
location - The location of this log in PAST

CoalescedLog

public CoalescedLog(java.lang.Object name,
                    Id location,
                    Post post,
                    java.security.KeyPair keyPair,
                    byte[] cipherKey)
Constructs a Log for use in POST, with the provided number of coalesced log entries.

Parameters:
name - Some unique identifier for this log
location - The location of this log in PAST
Method Detail

addLogEntry

public void addLogEntry(LogEntry entry,
                        Continuation command)
This method appends an entry into the user's log, and updates the pointer to the top of the log to reflect the new object. This method returns a LogEntryReference which is a pointer to the LogEntry in PAST. Note that this method reinserts this Log into PAST in order to reflect the addition. Once this method is finished, it will call the command.receiveResult() method with a LogEntryReference for the new entry, or it may call receiveExcception if an exception occurred.

Overrides:
addLogEntry in class EncryptedLog
Parameters:
entry - The log entry to append to the log.
command - The command to run once done

getLogEntryReferences

public void getLogEntryReferences(java.util.Set set,
                                  LogEntry entry,
                                  Continuation command)
This method returns a list of all the handles stored in the folder or any subfolders. Returns a PastContentHandle[] containing all of the handles in to the provided continatuion.

Overrides:
getLogEntryReferences in class Log

getTopEntry

public void getTopEntry(Continuation command)
This method returns a reference to the most recent entry in the log, which can then be used to walk down the log.

Overrides:
getTopEntry in class EncryptedLog

getActualTopEntry

public void getActualTopEntry(Continuation command)
This method returns the *actual* top entry in the log.


resetPending

protected void resetPending()
Method which resets the nuber of entries to be zero.


regenerateCipherPending

protected void regenerateCipherPending()
Method which regenerates the ciphertext of the number of log entries


retrievePending

protected void retrievePending()
Method which deserializes the encrypted yet-to-be-coalesed log entries once the key has been retrieved.


setKeyPair

public void setKeyPair(java.security.KeyPair keyPair)
Method which deserializes the list of yet-to-be-coalesed entries when the coalesced log is read off of the wire.

Overrides:
setKeyPair in class EncryptedLog
Parameters:
keyPair - The keypair for this log

toString

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

ePOST API

Copyright © 2001-2005 - Rice Pastry.