ePOST API

rice.email.proxy.mailbox.postbox
Class PostFlagList

java.lang.Object
  extended by rice.email.proxy.mailbox.postbox.PostFlagList
All Implemented Interfaces:
FlagList

public class PostFlagList
extends java.lang.Object
implements FlagList


Field Summary
protected  PostMessage message
          The internal message which the flag list holds the flags for
protected  java.util.HashSet sessionFlags
          Any session flags, which are not permanently stored.
 
Fields inherited from interface rice.email.proxy.mailbox.FlagList
ANSWERED_FLAG, DELETED_FLAG, DRAFT_FLAG, FLAGGED_FLAG, RECENT_FLAG, SEEN_FLAG
 
Constructor Summary
protected PostFlagList(PostMessage message)
          Protected constructor which takes in the wrapped message.
 
Method Summary
 void commit()
          Causes any changes in this FlagList's state to be written to the associated Mailbox.
static PostFlagList get(PostMessage msg)
          Method by which other classes can get the flag list for a given message
 java.util.List getFlags()
          Returns a vector containing all of the flags
 java.util.Set getSessionFlags()
          Returns a vector containing all of the session flags
 boolean isAnswered()
          Gets the Answered attribute of the Flags object
 boolean isDeleted()
          Gets the Deleted attribute of the Flags object
 boolean isDraft()
          Gets the Draft attribute of the Flags object
 boolean isFlagged()
          Gets the Flagged attribute of the Flags object
 boolean isRecent()
          Gets the Recent attribute of the Flags object
 boolean isSeen()
          Gets the Seen attribute of the Flags object
 boolean isSessionFlagSet(java.lang.String flag)
          Returns whether or not the given session flag is set
 boolean isSet(java.lang.String flag)
          Returns whether or not the given flag is set
 void setAnswered(boolean value)
          Sets the Answered attribute of the Flags object
 void setDeleted(boolean value)
          Sets the Deleted attribute of the Flags object
 void setDraft(boolean value)
          Sets the Draft attribute of the Flags object
 void setFlag(java.lang.String flag, boolean value)
          Sets the given flag, if value is true, removes it otherwise
 void setFlagged(boolean value)
          Sets the Flagged attribute of the Flags object
 void setRecent(boolean value)
          Sets the Recent attribute of the Flags object
 void setSeen(boolean value)
          Sets the Seen attribute of the Flags object
 void setSessionFlag(java.lang.String flag, boolean value)
          Sets the given session flag, if value is true, removes it otherwise
 java.lang.String toFlagString()
          Returns a string representation of the flags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected PostMessage message
The internal message which the flag list holds the flags for


sessionFlags

protected java.util.HashSet sessionFlags
Any session flags, which are not permanently stored. NOTE: Currently, this is not implemented on a per-session basis, so all sessions will see each other's flags. Too bad.

Constructor Detail

PostFlagList

protected PostFlagList(PostMessage message)
Protected constructor which takes in the wrapped message. This constructor does *NOT* set the recent flag.

Method Detail

get

public static PostFlagList get(PostMessage msg)
Method by which other classes can get the flag list for a given message

Parameters:
msg - The message to wrap
Returns:
The flag list for the message

commit

public void commit()
            throws MailboxException
Causes any changes in this FlagList's state to be written to the associated Mailbox. This allows colapsing several changes into one disk write, one SQL command, etc.

Specified by:
commit in interface FlagList
Throws:
MailboxException

isDeleted

public boolean isDeleted()
Gets the Deleted attribute of the Flags object

Specified by:
isDeleted in interface FlagList
Returns:
The Deleted value

isAnswered

public boolean isAnswered()
Gets the Answered attribute of the Flags object

Specified by:
isAnswered in interface FlagList
Returns:
The Answered value

isSeen

public boolean isSeen()
Gets the Seen attribute of the Flags object

Specified by:
isSeen in interface FlagList
Returns:
The Seen value

isFlagged

public boolean isFlagged()
Gets the Flagged attribute of the Flags object

Specified by:
isFlagged in interface FlagList
Returns:
The Flagged value

isDraft

public boolean isDraft()
Gets the Draft attribute of the Flags object

Specified by:
isDraft in interface FlagList
Returns:
The Draft value

isSet

public boolean isSet(java.lang.String flag)
Returns whether or not the given flag is set

Specified by:
isSet in interface FlagList
Parameters:
flag - The flag to check
Returns:
Whether or not it is set

setDeleted

public void setDeleted(boolean value)
Sets the Deleted attribute of the Flags object

Specified by:
setDeleted in interface FlagList
Parameters:
value - The new Deleted value

setAnswered

public void setAnswered(boolean value)
Sets the Answered attribute of the Flags object

Specified by:
setAnswered in interface FlagList
Parameters:
value - The new Answered value

setSeen

public void setSeen(boolean value)
Sets the Seen attribute of the Flags object

Specified by:
setSeen in interface FlagList
Parameters:
value - The new Seen value

setFlagged

public void setFlagged(boolean value)
Sets the Flagged attribute of the Flags object

Specified by:
setFlagged in interface FlagList
Parameters:
value - The new Flagged value

setDraft

public void setDraft(boolean value)
Sets the Draft attribute of the Flags object

Specified by:
setDraft in interface FlagList
Parameters:
value - The new Draft value

setFlag

public void setFlag(java.lang.String flag,
                    boolean value)
Sets the given flag, if value is true, removes it otherwise

Specified by:
setFlag in interface FlagList
Parameters:
flag - The flag
value - The value

isRecent

public boolean isRecent()
Gets the Recent attribute of the Flags object

Specified by:
isRecent in interface FlagList
Returns:
The Recent value

setRecent

public void setRecent(boolean value)
Sets the Recent attribute of the Flags object

Specified by:
setRecent in interface FlagList
Parameters:
value - The new Recent value

isSessionFlagSet

public boolean isSessionFlagSet(java.lang.String flag)
Returns whether or not the given session flag is set

Parameters:
flag - The flag to check
Returns:
Whether or not it's set

setSessionFlag

public void setSessionFlag(java.lang.String flag,
                           boolean value)
Sets the given session flag, if value is true, removes it otherwise

Parameters:
flag - The flag
value - The value

getFlags

public java.util.List getFlags()
Returns a vector containing all of the flags

Specified by:
getFlags in interface FlagList
Returns:
A Vector containing all of the flags

getSessionFlags

public java.util.Set getSessionFlags()
Returns a vector containing all of the session flags

Returns:
A Vector containing all of the session flags

toFlagString

public java.lang.String toFlagString()
Returns a string representation of the flags

Specified by:
toFlagString in interface FlagList
Returns:
THe flags, in string form

ePOST API

Copyright © 2001-2005 - Rice Pastry.