com.funambol.email.items.manager
Class ImapEntityManager

java.lang.Object
  extended by com.funambol.email.items.manager.EntityManager
      extended by com.funambol.email.items.manager.EntityManagerFilter
          extended by com.funambol.email.items.manager.ImapEntityManager

public class ImapEntityManager
extends EntityManagerFilter


Field Summary
 ImapEntityDAO ied
           
 ImapMailServerWrapper imsw
           
 
Fields inherited from class com.funambol.email.items.manager.EntityManager
cmsw, ed, log, timeStart, timeStop
 
Constructor Summary
ImapEntityManager()
           
ImapEntityManager(IMailServerWrapper msw_e, java.lang.String jndiDataSourceName)
           
 
Method Summary
 Email addEmail(java.lang.String FID, java.lang.String LUID, Email emailNew, java.lang.String source_uri, long principalId)
           
 Folder addFolder(java.lang.String name, java.lang.String parentId, DefaultFolder df, com.funambol.server.tools.IdSpaceGenerator idFolderSpace, java.lang.String source_uri, long principalId)
          todo understand the type of a folder (holds folders and mails)
 void clearAllItems(boolean allMailboxActivation, java.lang.String source_uri, long principalId)
          clean all folder and email except the 5 main folders
 java.lang.String[] getAllEmails(EmailFilter filter, boolean allMailboxActivation, java.lang.String source_uri, long principalId)
          todo 1 - get the mail id in all mailbox (not only in the 5 main folders) 2 - insert the filter on the default folder (on the PPC the user can choose the folder to sync)
 CrcSyncItemInfo[] getAllEmailsInfo(EmailFilter filter, boolean allMailboxActivation, java.lang.String source_uri, long principalId)
          todo get all emails info from all folders (not only from the 5 main folder)
 java.lang.String[] getAllFolders(EmailFilter filter, boolean allMailboxActivation, java.lang.String source_uri, long principalId)
          if allMailboxActivation is true the method gets the 5 main folders (inbox, outbox, sent, draft, trash) and recursively all the subforlders

if allMailboxActivation is false the method gets only the 5 main folders (inbox, outbox, sent, draft, trash)

 CrcSyncItemInfo[] getAllFoldersInfo(EmailFilter filter, boolean allMailboxActivation, java.lang.String source_uri, long principalId)
           
 java.lang.String getEmailFromClause(java.lang.String FID, java.lang.String FMID, Email ctmp, java.lang.String source_uri, long principalId)
          checks if a mail is already inserted in the db and returns the Document in the Mail Server we use header MESSAGE-ID as search criteria
 Email getEmailFromUID(EmailFilter filter, java.lang.String mailId, java.lang.String parentId, char status, java.lang.String source_uri, long pID)
           
 java.lang.String getFolderFromName(java.lang.String name, java.lang.String parentId, java.lang.String source_uri, long principalId)
          search the twin of the folder "name".
 Folder getFolderFromUID(EmailFilter filter, java.lang.String GUID, java.lang.String source_uri, long principalId)
          get folder from GUID
 boolean isEmailInFilter(EmailFilter filter, java.lang.String parentId, java.lang.String GUID, Email email)
          checks if a mail match the filter
 boolean isEmailInFilter(EmailFilter filter, java.lang.String GUID, java.lang.String parentId, java.lang.String mailId, java.lang.String source_uri, long principalId)
          checks if a mail match the filter this method gets all email in the folder considering the filter verifies if the key is in the message list
 void removeEmail(java.lang.String parentId, java.lang.String mailId, java.lang.String source_uri, long principalId)
          deletes an email
 void removeFolder(java.lang.String folderId, java.lang.String source_uri, long principalId)
          deletes a Folder
 Email updateEmail(java.lang.String FID, java.lang.String FMID, Email emailNew, java.lang.String source_uri, long principalId)
          updates a document defined by UID
 Folder updateFolder(java.lang.String parentId, java.lang.String folderId, Folder folderNew)
          updates a folder defined by folder id and parent id
 
Methods inherited from class com.funambol.email.items.manager.EntityManagerFilter
get_H, get_HB, get_HBA, getEncodingType
 
Methods inherited from class com.funambol.email.items.manager.EntityManager
checkMessageIDforDrafts, createFoundationFolder, createFoundationMail, createMessage, hasMatchedDate, hasMatchedSize, insertCustomFolder, insertDefaultFolder, isEmail, sendEmail, setFlags, setItemFolder, setItemMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imsw

public ImapMailServerWrapper imsw

ied

public ImapEntityDAO ied
Constructor Detail

ImapEntityManager

public ImapEntityManager()

ImapEntityManager

public ImapEntityManager(IMailServerWrapper msw_e,
                         java.lang.String jndiDataSourceName)
Parameters:
msw_e - IMailServerWrapper
jndiDataSourceName - String
Method Detail

removeEmail

public void removeEmail(java.lang.String parentId,
                        java.lang.String mailId,
                        java.lang.String source_uri,
                        long principalId)
                 throws EntityException
deletes an email

Parameters:
parentId - String
mailId - String
source_uri - String
principalId - long
Throws:
EntityException

removeFolder

public void removeFolder(java.lang.String folderId,
                         java.lang.String source_uri,
                         long principalId)
                  throws EntityException
deletes a Folder

Parameters:
folderId - String
source_uri - String
principalId - long
Throws:
EntityException

updateEmail

public Email updateEmail(java.lang.String FID,
                         java.lang.String FMID,
                         Email emailNew,
                         java.lang.String source_uri,
                         long principalId)
                  throws EntityException
updates a document defined by UID

Parameters:
FID - String
FMID - String
emailNew - Email
source_uri - String
principalId - long
Returns:
Email
Throws:
EntityException

updateFolder

public Folder updateFolder(java.lang.String parentId,
                           java.lang.String folderId,
                           Folder folderNew)
                    throws EntityException
updates a folder defined by folder id and parent id

Parameters:
parentId - folder id String
folderId - mail id in folder String
folderNew - Folder
Returns:
Folder
Throws:
EntityException

clearAllItems

public void clearAllItems(boolean allMailboxActivation,
                          java.lang.String source_uri,
                          long principalId)
                   throws EntityException
clean all folder and email except the 5 main folders

Parameters:
allMailboxActivation - boolean
source_uri - String
principalId - long
Throws:
EntityException

addEmail

public Email addEmail(java.lang.String FID,
                      java.lang.String LUID,
                      Email emailNew,
                      java.lang.String source_uri,
                      long principalId)
               throws EntityException,
                      SendingException
Parameters:
FID - String
LUID - String
emailNew - Email
source_uri - String
principalId - long
Returns:
Email
Throws:
EntityException
SendingException

addFolder

public Folder addFolder(java.lang.String name,
                        java.lang.String parentId,
                        DefaultFolder df,
                        com.funambol.server.tools.IdSpaceGenerator idFolderSpace,
                        java.lang.String source_uri,
                        long principalId)
                 throws EntityException
todo understand the type of a folder (holds folders and mails)

Parameters:
name - String
parentId - String
df - DefaultFolder
idFolderSpace - IdSpaceGenerator
source_uri - String
principalId - long
Returns:
Folder
Throws:
EntityException

getAllEmails

public java.lang.String[] getAllEmails(EmailFilter filter,
                                       boolean allMailboxActivation,
                                       java.lang.String source_uri,
                                       long principalId)
                                throws EntityException
todo 1 - get the mail id in all mailbox (not only in the 5 main folders) 2 - insert the filter on the default folder (on the PPC the user can choose the folder to sync)

Parameters:
filter - EmailFilter
allMailboxActivation - boolean
source_uri - String
principalId - long
Returns:
String[]
Throws:
EntityException

getAllFolders

public java.lang.String[] getAllFolders(EmailFilter filter,
                                        boolean allMailboxActivation,
                                        java.lang.String source_uri,
                                        long principalId)
                                 throws EntityException
if allMailboxActivation is true the method gets the 5 main folders (inbox, outbox, sent, draft, trash) and recursively all the subforlders

if allMailboxActivation is false the method gets only the 5 main folders (inbox, outbox, sent, draft, trash)

Parameters:
filter - EmailFilter
allMailboxActivation - boolean
source_uri - String
principalId - long
Returns:
String[]
Throws:
EntityException

getAllEmailsInfo

public CrcSyncItemInfo[] getAllEmailsInfo(EmailFilter filter,
                                          boolean allMailboxActivation,
                                          java.lang.String source_uri,
                                          long principalId)
                                   throws EntityException
todo get all emails info from all folders (not only from the 5 main folder)

Parameters:
filter - EmailFilter
allMailboxActivation - boolean
source_uri - String
principalId - long
Returns:
CrcSyncItemInfo[]
Throws:
EntityException

getAllFoldersInfo

public CrcSyncItemInfo[] getAllFoldersInfo(EmailFilter filter,
                                           boolean allMailboxActivation,
                                           java.lang.String source_uri,
                                           long principalId)
                                    throws EntityException
Parameters:
filter - EmailFilter
allMailboxActivation - boolean
source_uri - String
principalId - long
Returns:
CrcSyncItemInfo[]
Throws:
EntityException

isEmailInFilter

public boolean isEmailInFilter(EmailFilter filter,
                               java.lang.String GUID,
                               java.lang.String parentId,
                               java.lang.String mailId,
                               java.lang.String source_uri,
                               long principalId)
                        throws EntityException
checks if a mail match the filter this method gets all email in the folder considering the filter verifies if the key is in the message list

Parameters:
filter - EmailFilter
GUID - String
parentId - String
mailId - String
source_uri - String
principalId - long
Returns:
true if the mail match the filter clause
Throws:
EntityException

isEmailInFilter

public boolean isEmailInFilter(EmailFilter filter,
                               java.lang.String parentId,
                               java.lang.String GUID,
                               Email email)
                        throws EntityException
checks if a mail match the filter

Parameters:
filter - EmailFilter
parentId - String
GUID - String
email - Email
Returns:
true if the message match the filter
Throws:
EntityException

getEmailFromUID

public Email getEmailFromUID(EmailFilter filter,
                             java.lang.String mailId,
                             java.lang.String parentId,
                             char status,
                             java.lang.String source_uri,
                             long pID)
                      throws EntityException
Parameters:
filter - EmailFilter
mailId - mail id; String
parentId - parent id; String
status - status of the item; char
source_uri - String
pID - princiapal ID long
Returns:
Email
Throws:
EntityException

getFolderFromUID

public Folder getFolderFromUID(EmailFilter filter,
                               java.lang.String GUID,
                               java.lang.String source_uri,
                               long principalId)
                        throws EntityException
get folder from GUID

Parameters:
filter - EmailFilter
GUID - folder id (parentid + / + folderid)
source_uri - String
principalId - long
Returns:
Folder
Throws:
EntityException

getFolderFromName

public java.lang.String getFolderFromName(java.lang.String name,
                                          java.lang.String parentId,
                                          java.lang.String source_uri,
                                          long principalId)
                                   throws EntityException
search the twin of the folder "name". if the folder already exists the method returns the GUID

Parameters:
name - String
parentId - String
source_uri - String
principalId - long
Returns:
com.funambol.email.pdi.folder.Folder
Throws:
EntityException

getEmailFromClause

public java.lang.String getEmailFromClause(java.lang.String FID,
                                           java.lang.String FMID,
                                           Email ctmp,
                                           java.lang.String source_uri,
                                           long principalId)
                                    throws EntityException
checks if a mail is already inserted in the db and returns the Document in the Mail Server we use header MESSAGE-ID as search criteria

Parameters:
FID - String
FMID - String
ctmp - Email
source_uri - String
principalId - long
Returns:
Email
Throws:
EntityException


Copyright © 2003-2006 Funambol.