com.funambol.email.items.dao
Class PopEntityDAO

java.lang.Object
  extended bycom.funambol.email.items.dao.EntityDAO
      extended bycom.funambol.email.items.dao.PopEntityDAO

public class PopEntityDAO
extends EntityDAO

This class implements methods to access data in Mail Server datastore.


Field Summary
 
Fields inherited from class com.funambol.email.items.dao.EntityDAO
jndiDataSourceName, log
 
Constructor Summary
PopEntityDAO()
           
PopEntityDAO(java.lang.String jndiDataSourceName)
           
 
Method Summary
 java.lang.String addSentEmail(java.lang.String FID, java.lang.String messageID, javax.mail.Message msg, com.funambol.server.tools.IdSpaceGenerator idSentSpace, java.lang.String source_uri, long principalId)
          insert an email in the fnbl_email_sentpop table
 javax.mail.Message[] getAllEmailsInbox(com.sun.mail.pop3.POP3Folder f)
          gets all Messages NOTE: in the pop protocol this feature doesn't work
SearchTerm st = new ReceivedDateTerm(ComparisonTerm.GE, filter.getTime());
messages = f.search(st);
so we have to use a manual filter
 javax.mail.Message[] getAllEmailsInbox(com.sun.mail.pop3.POP3Folder f, EmailFilter filter, java.util.Locale loc)
          gets all Messages NOTE: in the pop protocol this feature doesn't work
SearchTerm st = new ReceivedDateTerm(ComparisonTerm.GE, filter.getTime());
messages = f.search(st);
so we have to use a manual filter
 java.lang.String[] getAllEmailsSent(EmailFilter filter, java.lang.String source_uri, long principalId)
           
 ItemMessage getEmailFromMessageID(java.lang.String message_id, javax.mail.Session s, java.lang.String source_uri, long principalId)
          serch a document using the header Message-ID
 javax.mail.Message getEmailInboxFromUID(com.sun.mail.pop3.POP3Folder f, javax.mail.Message[] messages, java.lang.String uid)
          serch a document using UID; for POP3 protocol UID is String I have to use a custome getMessageByUID because there is not a folder.getMessageByUID method like in the imap protocol
 javax.mail.Message getEmailSentFromUID(java.lang.String GUID, javax.mail.Session s, java.lang.String source_uri, long principalId)
           
 void removeAllEmail(com.sun.mail.pop3.POP3Folder f)
           
 void removeEmail(javax.mail.Message msg)
           
 void removeEmail(com.sun.mail.pop3.POP3Folder f, java.lang.String uid)
           
 void removeEmail(java.lang.String GUID, java.lang.String source_uri, long principalId)
           
 
Methods inherited from class com.funambol.email.items.dao.EntityDAO
checkMessageIDforDrafts, getAllEmailsInbox, getDefaultFolder, getFolderFromUID, getFullPathFromFID, getFullPathFromGUID, getGUIDFromFullPath, getMaxEmailNumber, getTimeFilteredItems, insertCustomFolder, insertDefaultFolderInDB, insertDefaultFolderInMailServer, insertFolder, insertInvalidItemInCache, removeEmailFromInbox, removeEmailFromServerItems, removeFolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopEntityDAO

public PopEntityDAO()

PopEntityDAO

public PopEntityDAO(java.lang.String jndiDataSourceName)
Parameters:
jndiDataSourceName - String
Method Detail

addSentEmail

public java.lang.String addSentEmail(java.lang.String FID,
                                     java.lang.String messageID,
                                     javax.mail.Message msg,
                                     com.funambol.server.tools.IdSpaceGenerator idSentSpace,
                                     java.lang.String source_uri,
                                     long principalId)
                              throws EntityException
insert an email in the fnbl_email_sentpop table

Parameters:
FID - IMAPFolder ID
messageID - header Message-ID
msg - Message
idSentSpace - The GUID generator
source_uri - The SyncSource URI.
principalId - The principal ID.
Returns:
GUID String
Throws:
EntityException

getAllEmailsInbox

public javax.mail.Message[] getAllEmailsInbox(com.sun.mail.pop3.POP3Folder f,
                                              EmailFilter filter,
                                              java.util.Locale loc)
                                       throws EntityException
gets all Messages NOTE: in the pop protocol this feature doesn't work
SearchTerm st = new ReceivedDateTerm(ComparisonTerm.GE, filter.getTime());
messages = f.search(st);
so we have to use a manual filter

Parameters:
f - POP3Folder
filter - EmailFilter
loc - Locale
Returns:
Message[]
Throws:
EntityException

getAllEmailsInbox

public javax.mail.Message[] getAllEmailsInbox(com.sun.mail.pop3.POP3Folder f)
                                       throws EntityException
gets all Messages NOTE: in the pop protocol this feature doesn't work
SearchTerm st = new ReceivedDateTerm(ComparisonTerm.GE, filter.getTime());
messages = f.search(st);
so we have to use a manual filter

Parameters:
f - POP3Folder
Returns:
Message[]
Throws:
EntityException

getAllEmailsSent

public java.lang.String[] getAllEmailsSent(EmailFilter filter,
                                           java.lang.String source_uri,
                                           long principalId)
                                    throws EntityException
Parameters:
filter -
source_uri - the SyncSource URI.
principalId - The principal ID.
Returns:
The items fulfilling the filter requirements as an Array of Strings.
Throws:
EntityException

removeEmail

public void removeEmail(javax.mail.Message msg)
                 throws EntityException
Throws:
EntityException

removeEmail

public void removeEmail(com.sun.mail.pop3.POP3Folder f,
                        java.lang.String uid)
                 throws EntityException
Parameters:
f - IMAPFolder
uid - long
Throws:
EntityException

removeAllEmail

public void removeAllEmail(com.sun.mail.pop3.POP3Folder f)
                    throws EntityException
Parameters:
f - POP3Folder
Throws:
EntityException

getEmailInboxFromUID

public javax.mail.Message getEmailInboxFromUID(com.sun.mail.pop3.POP3Folder f,
                                               javax.mail.Message[] messages,
                                               java.lang.String uid)
                                        throws EntityException
serch a document using UID; for POP3 protocol UID is String I have to use a custome getMessageByUID because there is not a folder.getMessageByUID method like in the imap protocol

Parameters:
f - POP3Folder
uid - String
Returns:
Message
Throws:
EntityException

getEmailSentFromUID

public javax.mail.Message getEmailSentFromUID(java.lang.String GUID,
                                              javax.mail.Session s,
                                              java.lang.String source_uri,
                                              long principalId)
                                       throws EntityException
Parameters:
GUID - the Global Unique ID.
s - The session info to the backend.
source_uri - the SyncSource URI.
principalId - The principal ID.
Returns:
Message
Throws:
EntityException

removeEmail

public void removeEmail(java.lang.String GUID,
                        java.lang.String source_uri,
                        long principalId)
                 throws EntityException
Parameters:
GUID - the Global Unique ID.
source_uri - the SyncSource URI.
principalId - The principal ID.
Throws:
EntityException

getEmailFromMessageID

public ItemMessage getEmailFromMessageID(java.lang.String message_id,
                                         javax.mail.Session s,
                                         java.lang.String source_uri,
                                         long principalId)
                                  throws EntityException
serch a document using the header Message-ID

Parameters:
message_id - String
s - Session
source_uri - String
principalId - long
Returns:
ItemMessage
Throws:
EntityException


Copyright © 2003-2006 Funambol.