ePOST API

rice.email.log
Class EmailLog

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

public class EmailLog
extends CoalescedLog

This represents the head of an email log, representing a folder.

Author:
Alan Mislove
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class rice.post.log.CoalescedLog
CoalescedLog.AddCoalescedLogEntryTask, CoalescedLog.PhantomLogEntry
 
Nested classes/interfaces inherited from class rice.post.log.Log
Log.AddLogEntryTask
 
Field Summary
static int DEFAULT_UID
           
 
Fields inherited from class rice.post.log.CoalescedLog
cbuffer, cipherPending, COALESCE_NUM, logger, 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
protected EmailLog(EmailLog unreconciled, java.security.KeyPair pair)
          This constructor should only be used for constructing a reconciled log
  EmailLog(java.lang.Object name, Id location, Post post, java.security.KeyPair pair)
          Constructor for SnapShot.
 
Method Summary
 void addSubscription(java.lang.String sub, Continuation command)
          Adds a subscriptions to the log
 void decrementExists()
          Decrements the number of messages which exist in this folder
 void decrementExists(int num)
          Decrements the number of messages which exist in this folder
 void decrementRecent()
          Decrements the number of messages which exist in this folder
 void dump()
           
 void dumpAll()
           
 int getBufferSize()
          Returns the number elements in the new entry buffer
 long getCreationTime()
          Returns the time (in milliseconds) that this email log was created.
 int getEntries()
          Returns the number of log entries since a snapshot
 int getExists()
          Returns the number of messages which exist in this folder
 int getNextUID()
          Returns the next available UID, and increments the UID counter.
 int getRecent()
          Returns the number of messages which are recent in this folder
 void getSnapshot(Continuation command)
          Returns the most recent snapshot reference
 ContentHashReference getSnapshotReference()
          Returns the reference to the most recent snapshot
 ContentHashReference[] getSnapshotReferences()
          Returns the reference to the most recent snapshot array
 void getSubscriptions(Continuation command)
          Returns the list of subscriptions in the log
 void incrementEntries()
          Increments the number of entries since a snapshot
 void incrementExists()
          Increments the number of messages which exist in this folder
 void incrementExists(int num)
          Increments the number of messages which exist in this folder
 void incrementRecent()
          Increments the number of messages which exist in this folder
 int peekNextUID()
          Returns the next UID, and doesn't increment the UID counter.
 void reconcile(EmailLog otherLog, java.security.KeyPair keyPair, Continuation command)
           
 void removeSubscription(java.lang.String sub, Continuation command)
          Adds a subscriptions to the log
 void resetEntries()
          Resets the number of entries since a snapshot
 void setExists(int num)
          Sets the number of messages which exist in this folder
 void setSnapshot(SnapShot[] newsnapshots, Continuation command)
          Sets the newest snapshot
 
Methods inherited from class rice.post.log.CoalescedLog
addLogEntry, getActualTopEntry, getLogEntryReferences, getTopEntry, regenerateCipherPending, resetPending, retrievePending, setKeyPair, 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

DEFAULT_UID

public static int DEFAULT_UID
Constructor Detail

EmailLog

public EmailLog(java.lang.Object name,
                Id location,
                Post post,
                java.security.KeyPair pair)
Constructor for SnapShot.

Parameters:
name - The name of this log
location - The location where this log is stored
post - The current local post service

EmailLog

protected EmailLog(EmailLog unreconciled,
                   java.security.KeyPair pair)
This constructor should only be used for constructing a reconciled log

Parameters:
unreconciled -
base -
pair -
Method Detail

getSnapshotReference

public ContentHashReference getSnapshotReference()
Returns the reference to the most recent snapshot

Returns:
The most recent log snapshot ref

getSnapshotReferences

public ContentHashReference[] getSnapshotReferences()
Returns the reference to the most recent snapshot array

Returns:
The most recent log snapshot ref

getSubscriptions

public void getSubscriptions(Continuation command)
Returns the list of subscriptions in the log

Parameters:
command - the work to perform after this call.

addSubscription

public void addSubscription(java.lang.String sub,
                            Continuation command)
Adds a subscriptions to the log

Parameters:
command - the work to perform after this call.
sub - The subscription to add

removeSubscription

public void removeSubscription(java.lang.String sub,
                               Continuation command)
Adds a subscriptions to the log

Parameters:
command - the work to perform after this call.
sub - The subscription to add

getBufferSize

public int getBufferSize()
Returns the number elements in the new entry buffer

Returns:
The number of pending adds

getEntries

public int getEntries()
Returns the number of log entries since a snapshot

Returns:
The number of log entries since a snapshot

incrementEntries

public void incrementEntries()
Increments the number of entries since a snapshot


resetEntries

public void resetEntries()
Resets the number of entries since a snapshot


setSnapshot

public void setSnapshot(SnapShot[] newsnapshots,
                        Continuation command)
Sets the newest snapshot

Parameters:
snapshot - The snapshot

getSnapshot

public void getSnapshot(Continuation command)
Returns the most recent snapshot reference


dump

public void dump()

dumpAll

public void dumpAll()

getExists

public int getExists()
Returns the number of messages which exist in this folder

Returns:
The number of messages which exists in the folder

setExists

public void setExists(int num)
Sets the number of messages which exist in this folder

Parameters:
num - The new number of messages

incrementExists

public void incrementExists()
Increments the number of messages which exist in this folder


incrementExists

public void incrementExists(int num)
Increments the number of messages which exist in this folder

Parameters:
num - The number to increment by

decrementExists

public void decrementExists()
Decrements the number of messages which exist in this folder


decrementExists

public void decrementExists(int num)
Decrements the number of messages which exist in this folder

Parameters:
num - The number to increment by

getRecent

public int getRecent()
Returns the number of messages which are recent in this folder

Returns:
The number of messages which are recent in the folder

incrementRecent

public void incrementRecent()
Increments the number of messages which exist in this folder


decrementRecent

public void decrementRecent()
Decrements the number of messages which exist in this folder


peekNextUID

public int peekNextUID()
Returns the next UID, and doesn't increment the UID counter.

Returns:
The next UID.

getNextUID

public int getNextUID()
Returns the next available UID, and increments the UID counter.

Returns:
The next UID.

getCreationTime

public long getCreationTime()
Returns the time (in milliseconds) that this email log was created.

Returns:
The creation time

reconcile

public void reconcile(EmailLog otherLog,
                      java.security.KeyPair keyPair,
                      Continuation command)

ePOST API

Copyright © 2001-2005 - Rice Pastry.