com.hs.mail.imap.dao
Interface MailboxDao

All Known Implementing Classes:
MySqlMailboxDao

public interface MailboxDao

Since:
Mar 8, 2010
Author:
Won Chul Doh

Method Summary
 void addSubscription(long userID, long mailboxID, String mailboxName)
          Subscribe the mailbox.
 Mailbox createMailbox(long ownerID, String mailboxName)
          Create a mailbox with given name.
 void deleteMailbox(long ownerID, long mailboxID)
          Delete the mailbox.
 void deleteMailboxes(long ownerID)
          Delete all the mailboxes owned by the user.
 void deleteMessages(long ownerID)
          Delete all the messages owned by the user.
 void deleteMessages(long ownerID, long mailboxID)
          Delete all the messages in the mailbox.
 void deleteSubscription(long userID, String mailboxName)
          Unsubscribe the mailbox.
 void forbidSelectMailbox(long ownerID, long mailboxID)
          Set \Noselect mailbox name attribute.
 int getChildCount(long ownerID, String mailboxName)
          Get the child mailboxes count.
 List<Mailbox> getChildren(long userID, long ownerID, String mailboxName, boolean subscribed)
          Get all child mailboxes of named mailbox.
 List<PhysMessage> getDanglingMessageIDList(long ownerID)
          Get the list of physical message identifiers which will be dangling pointers (pointing messages which are already deleted) after deleting all the messages owned by the user.
 List<PhysMessage> getDanglingMessageIDList(long ownerID, long mailboxID)
          Get the list of physical message identifiers which will be dangling pointers (pointing messages which are already deleted) after expunging the mailbox.
 List<Long> getDeletedMessageIDList(long mailboxID)
          Get the deleted message's identifiers.
 long getFirstUnseenMessageID(long mailboxID)
          Get the message identifier of the first unseen message.
 Mailbox getMailbox(long ownerID, String mailboxName)
          Get the named mailbox.
 List<Long> getMailboxIDList(String mailboxName)
          Get the identifiers of mailboxes whose name match the given name.
 int getMessageCount(long mailboxID)
          Get the total message count.
 int getRecentMessageCount(long mailboxID)
          Get the recent message count.
 int getUnseenMessageCount(long mailboxID)
          Get the unseen message count.
 boolean isSubscribed(long userID, String mailboxName)
          Check whether the mailbox is subscribed.
 boolean mailboxExists(long ownerID, String mailboxName)
          Check whether the mailbox really exists.
 void renameMailbox(Mailbox source, String dest)
          Rename the mailbox.
 

Method Detail

getMailbox

Mailbox getMailbox(long ownerID,
                   String mailboxName)
Get the named mailbox.

Parameters:
ownerID - the id of the user who owns the mailbox
mailboxName - fullname of the mailbox
Returns:
Mailbox object

getChildren

List<Mailbox> getChildren(long userID,
                          long ownerID,
                          String mailboxName,
                          boolean subscribed)
Get all child mailboxes of named mailbox.

Parameters:
userID - ID of user who called this method
ownerID - ID of user who owns the mailbox
mailboxName - fullname of the parent mailbox
subscribed - If true, only subscribed mailboxes are returned
Returns:
list of child Mailbox objects

getChildCount

int getChildCount(long ownerID,
                  String mailboxName)
Get the child mailboxes count.

Parameters:
ownerID - ID of the user who owns the mailbox
mailboxName - fullname of the parent mailbox
Returns:
total number of child mailboxes

getMailboxIDList

List<Long> getMailboxIDList(String mailboxName)
Get the identifiers of mailboxes whose name match the given name.

Parameters:
mailboxName - fullname of the mailboxes to find
Returns:
list of mailbox identifiers

getDeletedMessageIDList

List<Long> getDeletedMessageIDList(long mailboxID)
Get the deleted message's identifiers.

Parameters:
mailboxID - id of the mailbox
Returns:
list of message identifies which has \Delete message flag

getDanglingMessageIDList

List<PhysMessage> getDanglingMessageIDList(long ownerID)
Get the list of physical message identifiers which will be dangling pointers (pointing messages which are already deleted) after deleting all the messages owned by the user.

Parameters:
ownerID - ID of the user
Returns:
list of PhysMessage objects

getDanglingMessageIDList

List<PhysMessage> getDanglingMessageIDList(long ownerID,
                                           long mailboxID)
Get the list of physical message identifiers which will be dangling pointers (pointing messages which are already deleted) after expunging the mailbox.

Parameters:
ownerID - ID of the user who owns the mailbox
mailboxID - ID of the mailbox
Returns:
list of PhysMessage objects

mailboxExists

boolean mailboxExists(long ownerID,
                      String mailboxName)
Check whether the mailbox really exists.

Parameters:
ownerID - ID of the user who owns the mailbox
mailboxName - fullname of the parent mailbox
Returns:
true if the mailbox exists, otherwise false

createMailbox

Mailbox createMailbox(long ownerID,
                      String mailboxName)
Create a mailbox with given name.

Parameters:
ownerID - ID of the user who owns the mailbox
mailboxName - fullname of the mailbox to create
Returns:
Mailbox object created

renameMailbox

void renameMailbox(Mailbox source,
                   String dest)
Rename the mailbox.

Parameters:
source - fullname of the mailbox to rename
dest - new name for the mailbox

deleteMailboxes

void deleteMailboxes(long ownerID)
Delete all the mailboxes owned by the user.

Parameters:
ownerID - ID of the user

deleteMailbox

void deleteMailbox(long ownerID,
                   long mailboxID)
Delete the mailbox.

Parameters:
ownerID - ID of the user
mailboxID - ID of the mailbox

deleteMessages

void deleteMessages(long ownerID)
Delete all the messages owned by the user.

Parameters:
ownerID - ID of the user

deleteMessages

void deleteMessages(long ownerID,
                    long mailboxID)
Delete all the messages in the mailbox.

Parameters:
ownerID - ID of the user
mailboxID - ID of the mailbox

forbidSelectMailbox

void forbidSelectMailbox(long ownerID,
                         long mailboxID)
Set \Noselect mailbox name attribute.

Parameters:
ownerID - ID of the user
mailboxID - ID of the mailbox

isSubscribed

boolean isSubscribed(long userID,
                     String mailboxName)
Check whether the mailbox is subscribed.

Parameters:
userID - ID of the user
mailboxID - ID of the mailbox
Returns:
true if the mailbox is subscribed, otherwise false

addSubscription

void addSubscription(long userID,
                     long mailboxID,
                     String mailboxName)
Subscribe the mailbox.

Parameters:
userID - ID of the user
mailboxID - ID of the mailbox to subscribe

deleteSubscription

void deleteSubscription(long userID,
                        String mailboxName)
Unsubscribe the mailbox.

Parameters:
userID - ID of the user
mailboxName - name of the mailbox to unsubscribe

getMessageCount

int getMessageCount(long mailboxID)
Get the total message count.

Parameters:
mailboxID - ID of the mailbox
Returns:
total number of messages

getRecentMessageCount

int getRecentMessageCount(long mailboxID)
Get the recent message count.

Parameters:
mailboxID - ID of the mailbox
Returns:
number of recent messages

getUnseenMessageCount

int getUnseenMessageCount(long mailboxID)
Get the unseen message count.

Parameters:
mailboxID - ID of the mailbox
Returns:
total number of unseen messages

getFirstUnseenMessageID

long getFirstUnseenMessageID(long mailboxID)
Get the message identifier of the first unseen message.

Parameters:
mailboxID - ID of the mailbox.
Returns:
ID of the first unseen message


Copyright © 2011. All Rights Reserved.