org.apache.james.imapserver
Class SimpleFolderRecord

java.lang.Object
  |
  +--org.apache.james.imapserver.SimpleFolderRecord
All Implemented Interfaces:
FolderRecord, org.apache.avalon.framework.activity.Initializable, java.io.Serializable

public class SimpleFolderRecord
extends java.lang.Object
implements FolderRecord, java.io.Serializable, org.apache.avalon.framework.activity.Initializable

Object representing the record of a folder in an IMAP on an IMAP Host.

Version:
0.1 on 14 Dec 2000
Author:
Charles Benett
See Also:
Serialized Form

Constructor Summary
SimpleFolderRecord(java.lang.String mailboxName, java.lang.String user, java.lang.String absName)
          Constructor Records the full name, including namespace, of this mailbox relative, to a specified user, and the absolute name..
 
Method Summary
 java.lang.String getAbsoluteName()
          Returns the absolute name of this mailbox.
 int getExists()
          Indicates number of messages in folder
 java.lang.String getFullName()
          Returns the full name, including namespace, of this mailbox.
 int getHighestUid()
          Returns current highest assigned uid value
 int getRecent()
          Indicates no of messages with \Recent flag set
 int getUidValidity()
          Returns current uid validity value
 int getUnseen(java.lang.String user)
          Indicates the number of unseen messages for the specified user.
 java.lang.String getUser()
          Returns the user in whose namespace the mailbox existed.
 boolean hasLookupRights(java.lang.String user)
          Indicates if given user has lookup rights for this mailbox.
 boolean hasReadRights(java.lang.String user)
          Indicates if given user has read rights for this mailbox.
 void initialize()
           
 boolean isDeleted()
          Returns whether mailbox has been deleted.
 boolean isMarked()
          Indicates if the mailbox is marked.
 boolean isNameInUse()
          Returns unavailability of name for a new mailbox.
 boolean isNotSelectableByAnyone()
           
 boolean isSelectable(java.lang.String user)
          A folder is selectable by a given user if both it is not NotSelectableByAnyone and the named user has read rights.
 void setDeleted(boolean state)
          Records if the corresponding mailbox has been deleted.
 void setExists(int num)
          Set number of messages in this folder
 void setHighestUid(int uid)
          Records the highest assigned Unique Identifier Value for this mailbox.
 void setLookupRights(java.util.Set users)
          Record which users have LookupRights.
 void setMarked(boolean mark)
          Record if mailbox is marked.
 void setNameInUse(boolean state)
          Records if this mailbox name is currently in use.
 void setNotSelectableByAnyone(boolean state)
          Mark this mailbox as not selectable by anyone.
 void setReadRights(java.util.Set users)
          Record which users have ReadRights.
 void setRecent(int num)
          Set number of messages in this folder with Recent flag set
 void setUidValidity(int uidV)
          Records the Unique Identifier Validity Value for this mailbox.
 void setUnseenbyUser(java.util.Map unseen)
          Set map of users versus number of messages in this folder without \Seen flag set for them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFolderRecord

public SimpleFolderRecord(java.lang.String mailboxName,
                          java.lang.String user,
                          java.lang.String absName)
Constructor Records the full name, including namespace, of this mailbox relative, to a specified user, and the absolute name..
Parameters:
mailboxName - String mailbox hierarchical name including namespace
user - String a user. An empty user parameter indicates that the mailbox name is absolute.
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable

getFullName

public java.lang.String getFullName()
Description copied from interface: FolderRecord
Returns the full name, including namespace, of this mailbox. Example 1: '#mail.projectBonzi' Example 2: '#shared.projectBonzi'
Specified by:
getFullName in interface FolderRecord

getUser

public java.lang.String getUser()
Description copied from interface: FolderRecord
Returns the user in whose namespace the mailbox existed. Example 1: 'fred.flintstone' Example 2: ''
Specified by:
getUser in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
user - String a user.An empty string indicates that the mailbox name is absolute.

getAbsoluteName

public java.lang.String getAbsoluteName()
Description copied from interface: FolderRecord
Returns the absolute name of this mailbox. The absolute name is user-independent and unique for a given host. Example 1: 'privatemail.fred.flintstone.projectBonzi' Example 2: '#shared.projectBonzi'
Specified by:
getAbsoluteName in interface FolderRecord

setNameInUse

public void setNameInUse(boolean state)
Description copied from interface: FolderRecord
Records if this mailbox name is currently in use. The mailbox name is in use when a mailbox with this name has been created. Implementations that allow shared mailboxes may encounter a sate where the mailbox has been deleted but there are clients who were already connected to the mailbox. In this case the name remains in use until all clients have either de-selected the mailbox or been disconnected from the server.
Specified by:
setNameInUse in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
state - boolean true when mailbox created, false when name no longer in use.

isNameInUse

public boolean isNameInUse()
Description copied from interface: FolderRecord
Returns unavailability of name for a new mailbox.
Specified by:
isNameInUse in interface FolderRecord

setDeleted

public void setDeleted(boolean state)
Description copied from interface: FolderRecord
Records if the corresponding mailbox has been deleted.
Specified by:
setDeleted in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
state - boolean true when mailbox deleted, false when created

isDeleted

public boolean isDeleted()
Description copied from interface: FolderRecord
Returns whether mailbox has been deleted. A deleted mailbox is an invalid argument to any IMAP command..
Specified by:
isDeleted in interface FolderRecord

setUidValidity

public void setUidValidity(int uidV)
Description copied from interface: FolderRecord
Records the Unique Identifier Validity Value for this mailbox.
Specified by:
setUidValidity in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
uidValidity - int the uid validity value must be incremented if the current uid values overlap uid values of this or a previous incarnation of the mailbox.

getUidValidity

public int getUidValidity()
Description copied from interface: FolderRecord
Returns current uid validity value
Specified by:
getUidValidity in interface FolderRecord

setHighestUid

public void setHighestUid(int uid)
Description copied from interface: FolderRecord
Records the highest assigned Unique Identifier Value for this mailbox.
Specified by:
setHighestUid in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
uid - int the highest uid assigned to a message in this mailbox.

getHighestUid

public int getHighestUid()
Description copied from interface: FolderRecord
Returns current highest assigned uid value
Specified by:
getHighestUid in interface FolderRecord

setLookupRights

public void setLookupRights(java.util.Set users)
Description copied from interface: FolderRecord
Record which users have LookupRights.
Specified by:
setLookupRights in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
users - Set of Strings, one per user with Lookup rights

hasLookupRights

public boolean hasLookupRights(java.lang.String user)
Description copied from interface: FolderRecord
Indicates if given user has lookup rights for this mailbox. Need lookup rights to be included in a List response.
Specified by:
hasLookupRights in interface FolderRecord

setReadRights

public void setReadRights(java.util.Set users)
Description copied from interface: FolderRecord
Record which users have ReadRights.
Specified by:
setReadRights in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
users - Set of Strings, one per user with read rights

hasReadRights

public boolean hasReadRights(java.lang.String user)
Description copied from interface: FolderRecord
Indicates if given user has read rights for this mailbox. Need read rights for user to select or examine mailbox.
Specified by:
hasReadRights in interface FolderRecord

setMarked

public void setMarked(boolean mark)
Description copied from interface: FolderRecord
Record if mailbox is marked.
Specified by:
setMarked in interface FolderRecord

isMarked

public boolean isMarked()
Description copied from interface: FolderRecord
Indicates if the mailbox is marked. Usually means unseen mail.
Specified by:
isMarked in interface FolderRecord

setNotSelectableByAnyone

public void setNotSelectableByAnyone(boolean state)
Description copied from interface: FolderRecord
Mark this mailbox as not selectable by anyone. Example folders at the roots of hierarchies, e. #mail for each user.
Specified by:
setNotSelectableByAnyone in interface FolderRecord
Following copied from interface: org.apache.james.imapserver.FolderRecord
Parameters:
state - true if folder is not selectable by anyone

isNotSelectableByAnyone

public boolean isNotSelectableByAnyone()
Specified by:
isNotSelectableByAnyone in interface FolderRecord

isSelectable

public boolean isSelectable(java.lang.String user)
Description copied from interface: FolderRecord
A folder is selectable by a given user if both it is not NotSelectableByAnyone and the named user has read rights.
Specified by:
isSelectable in interface FolderRecord

setExists

public void setExists(int num)
Description copied from interface: FolderRecord
Set number of messages in this folder
Specified by:
setExists in interface FolderRecord

getExists

public int getExists()
Description copied from interface: FolderRecord
Indicates number of messages in folder
Specified by:
getExists in interface FolderRecord

setRecent

public void setRecent(int num)
Description copied from interface: FolderRecord
Set number of messages in this folder with Recent flag set
Specified by:
setRecent in interface FolderRecord

getRecent

public int getRecent()
Description copied from interface: FolderRecord
Indicates no of messages with \Recent flag set
Specified by:
getRecent in interface FolderRecord

setUnseenbyUser

public void setUnseenbyUser(java.util.Map unseen)
Description copied from interface: FolderRecord
Set map of users versus number of messages in this folder without \Seen flag set for them
Specified by:
setUnseenbyUser in interface FolderRecord

getUnseen

public int getUnseen(java.lang.String user)
Description copied from interface: FolderRecord
Indicates the number of unseen messages for the specified user.
Specified by:
getUnseen in interface FolderRecord


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.