com.funambol.email.engine.source
Class ImapEmailSyncSource

java.lang.Object
  extended by com.funambol.framework.engine.source.AbstractSyncSource
      extended by com.funambol.email.engine.cache.CrcCachedSyncSource
          extended by com.funambol.email.engine.source.EmailSyncSource
              extended by com.funambol.email.engine.source.ImapEmailSyncSource
All Implemented Interfaces:
com.funambol.framework.engine.source.FilterableSyncSource, com.funambol.framework.engine.source.SyncSource, com.funambol.framework.tools.beans.LazyInitBean, java.io.Serializable

public final class ImapEmailSyncSource
extends EmailSyncSource
implements com.funambol.framework.engine.source.FilterableSyncSource, java.io.Serializable, com.funambol.framework.tools.beans.LazyInitBean

This class implements common methods of EmailIMAPSyncSource

version $Id: ImapEmailSyncSource.java,v 1.2 2006/08/08 11:03:58 gibi Exp $

See Also:
Serialized Form

Field Summary
protected  ImapEntityManager iem
           
protected  java.util.logging.Logger log
           
 
Fields inherited from class com.funambol.email.engine.source.EmailSyncSource
allMailboxActivation, defaultFolder, device, deviceCharset, deviceTimeZone, deviceTimeZoneDescr, draftActivation, em, filter, idFolderSpace, idSentSpace, inboxActivation, inHost, inPort, keystorePassphrase, keystorePath, mswf, outboxActivation, outHost, outPort, principal, protocol, sentActivation, smtpAuth, ssl, syncMode, trashActivation
 
Fields inherited from class com.funambol.email.engine.cache.CrcCachedSyncSource
itemsSent, jndiDataSourceName
 
Fields inherited from class com.funambol.framework.engine.source.AbstractSyncSource
howManyAdded, howManyDeleted, howManyUpdated, info, LOG_NAME, name, sourceQuery, sourceURI, type
 
Constructor Summary
ImapEmailSyncSource()
           
 
Method Summary
 com.funambol.framework.engine.SyncItem addSyncItem(com.funambol.framework.engine.SyncItem syncItem)
           
 void beginSync(com.funambol.framework.engine.source.SyncContext context)
          Begin Sync Method

before starting sync the method set the filter

main folder filter T D S O I 0 0 0 0 1 --> 1 inbox 0 0 0 1 1 --> 3 inbox + outbox 0 0 1 1 1 --> 7 inbox + outbox + sent 0 1 1 1 1 --> 15 inbox + outbox + sent + draft 1 1 1 1 1 --> 31 inbox + outbox + sent + draft + trash

time filter (timeFilter) null --> all "i.e. 20-10-2005" --> filter

size filter (sizeFilter / numbytes) 000001 --> 1 FILTER_SIZE_H 000011 --> 3 FILTER_SIZE_H_PERC 000101 --> 5 FILTER_SIZE_H_B 001111 --> 15 FILTER_SIZE_H_B_PERC 010101 --> 21 FILTER_SIZE_H_B_A 111111 --> 63 FILTER_SIZE_H_B_A_PERC

 void clearServerInfo()
           
 CrcSyncItemInfo[] getAllSyncItemInfo()
           
 com.funambol.framework.engine.SyncItemKey[] getAllSyncItemKeys()
           
 com.funambol.framework.engine.SyncItem getSyncItemFromId(com.funambol.framework.engine.SyncItemKey syncItemKey)
           
 com.funambol.framework.engine.SyncItemKey[] getSyncItemKeysFromTwin(com.funambol.framework.engine.SyncItem syncItem)
           
 void init()
          Init the syncSource
 boolean isSyncItemInFilterClause(com.funambol.framework.engine.SyncItem syncItem)
           
 boolean isSyncItemInFilterClause(com.funambol.framework.engine.SyncItemKey syncItemKey)
           
 void removeSyncItem(com.funambol.framework.engine.SyncItemKey syncItemKey, java.sql.Timestamp s, boolean softDelete)
           
 void setOperationStatus(java.lang.String operation, int statusCode, com.funambol.framework.engine.SyncItemKey[] keys)
           
 com.funambol.framework.engine.SyncItem updateSyncItem(com.funambol.framework.engine.SyncItem syncItem)
           
 
Methods inherited from class com.funambol.email.engine.source.EmailSyncSource
checkMessageIDforDrafts, createSyncItem, createSyncItem, endSync, getDefaultFolder, getDevice, getFoundationFolderFromXML, getFoundationMailFromXML, getInHost, getInPort, getKeystorePassphrase, getKeystorePath, getOutHost, getOutPort, getProtocol, getXMLFromFoundationFolder, getXMLFromFoundationMail, insertCustomFolder, insertDefaultFolder, isAllMailboxActivation, isDraftActivation, isEmailFromContent, isEmailFromKey, isInboxActivation, isOutboxActivation, isSentActivation, isSmtpAuth, isSSL, isTrashActivation, setAllMailboxActivation, setDefaultFolder, setDraftActivation, setInboxActivation, setInHost, setInPort, setKeystorePassphrase, setKeystorePath, setOutboxActivation, setOutHost, setOutPort, setProtocol, setSentActivation, setSmtpAuth, setSSL, setTrashActivation
 
Methods inherited from class com.funambol.email.engine.cache.CrcCachedSyncSource
getDeletedSyncItemKeys, getNewSyncItemKeys, getSyncItemStateFromId, getUpdatedSyncItemKeys
 
Methods inherited from class com.funambol.framework.engine.source.AbstractSyncSource
commitSync, getInfo, getName, getSourceQuery, getSourceURI, getType, setInfo, setName, setSourceURI, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.funambol.framework.engine.source.FilterableSyncSource
getSyncItemStateFromId
 
Methods inherited from interface com.funambol.framework.engine.source.SyncSource
commitSync, endSync, getDeletedSyncItemKeys, getInfo, getName, getNewSyncItemKeys, getSourceURI, getType, getUpdatedSyncItemKeys
 

Field Detail

log

protected java.util.logging.Logger log

iem

protected ImapEntityManager iem
Constructor Detail

ImapEmailSyncSource

public ImapEmailSyncSource()
Method Detail

beginSync

public void beginSync(com.funambol.framework.engine.source.SyncContext context)
               throws com.funambol.framework.engine.source.SyncSourceException
Description copied from class: EmailSyncSource
Begin Sync Method

before starting sync the method set the filter

main folder filter

time filter (timeFilter)

size filter (sizeFilter / numbytes)

Specified by:
beginSync in interface com.funambol.framework.engine.source.SyncSource
Overrides:
beginSync in class EmailSyncSource
Parameters:
context - SyncContext
Throws:
com.funambol.framework.engine.source.SyncSourceException

init

public void init()
          throws com.funambol.framework.tools.beans.BeanInitializationException
Init the syncSource

Specified by:
init in interface com.funambol.framework.tools.beans.LazyInitBean
Overrides:
init in class CrcCachedSyncSource
Throws:
com.funambol.framework.tools.beans.BeanInitializationException

isSyncItemInFilterClause

public boolean isSyncItemInFilterClause(com.funambol.framework.engine.SyncItem syncItem)
                                 throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
isSyncItemInFilterClause in interface com.funambol.framework.engine.source.FilterableSyncSource
Parameters:
syncItem - SyncItem
Returns:
boolean
Throws:
com.funambol.framework.engine.source.SyncSourceException

isSyncItemInFilterClause

public boolean isSyncItemInFilterClause(com.funambol.framework.engine.SyncItemKey syncItemKey)
                                 throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
isSyncItemInFilterClause in interface com.funambol.framework.engine.source.FilterableSyncSource
Parameters:
syncItemKey - SyncItemKey
Returns:
boolean
Throws:
com.funambol.framework.engine.source.SyncSourceException

setOperationStatus

public void setOperationStatus(java.lang.String operation,
                               int statusCode,
                               com.funambol.framework.engine.SyncItemKey[] keys)
Specified by:
setOperationStatus in interface com.funambol.framework.engine.source.SyncSource
Specified by:
setOperationStatus in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
operation - String
statusCode - int
keys - SyncItemKey[]

removeSyncItem

public void removeSyncItem(com.funambol.framework.engine.SyncItemKey syncItemKey,
                           java.sql.Timestamp s,
                           boolean softDelete)
                    throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
removeSyncItem in interface com.funambol.framework.engine.source.SyncSource
Specified by:
removeSyncItem in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
syncItemKey - SyncItemKey
s - Timestamp
softDelete - boolean
Throws:
com.funambol.framework.engine.source.SyncSourceException

getSyncItemFromId

public com.funambol.framework.engine.SyncItem getSyncItemFromId(com.funambol.framework.engine.SyncItemKey syncItemKey)
                                                         throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getSyncItemFromId in interface com.funambol.framework.engine.source.SyncSource
Specified by:
getSyncItemFromId in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
syncItemKey - SyncItemKey
Returns:
SyncItem
Throws:
com.funambol.framework.engine.source.SyncSourceException

getAllSyncItemKeys

public com.funambol.framework.engine.SyncItemKey[] getAllSyncItemKeys()
                                                               throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getAllSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
Specified by:
getAllSyncItemKeys in class com.funambol.framework.engine.source.AbstractSyncSource
Returns:
SyncItemKey[]
Throws:
com.funambol.framework.engine.source.SyncSourceException

getAllSyncItemInfo

public CrcSyncItemInfo[] getAllSyncItemInfo()
                                     throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getAllSyncItemInfo in class CrcCachedSyncSource
Returns:
CrcSyncItemInfo[]
Throws:
com.funambol.framework.engine.source.SyncSourceException

clearServerInfo

public void clearServerInfo()
                     throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
clearServerInfo in class CrcCachedSyncSource
Throws:
com.funambol.framework.engine.source.SyncSourceException

getSyncItemKeysFromTwin

public com.funambol.framework.engine.SyncItemKey[] getSyncItemKeysFromTwin(com.funambol.framework.engine.SyncItem syncItem)
                                                                    throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getSyncItemKeysFromTwin in interface com.funambol.framework.engine.source.SyncSource
Specified by:
getSyncItemKeysFromTwin in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
syncItem - SyncItem
Returns:
SyncItemKey[]
Throws:
com.funambol.framework.engine.source.SyncSourceException

addSyncItem

public com.funambol.framework.engine.SyncItem addSyncItem(com.funambol.framework.engine.SyncItem syncItem)
                                                   throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
addSyncItem in interface com.funambol.framework.engine.source.SyncSource
Specified by:
addSyncItem in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
syncItem - SyncItem
Returns:
SyncItem
Throws:
com.funambol.framework.engine.source.SyncSourceException

updateSyncItem

public com.funambol.framework.engine.SyncItem updateSyncItem(com.funambol.framework.engine.SyncItem syncItem)
                                                      throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
updateSyncItem in interface com.funambol.framework.engine.source.SyncSource
Specified by:
updateSyncItem in class com.funambol.framework.engine.source.AbstractSyncSource
Parameters:
syncItem - SyncItem
Returns:
SyncItem
Throws:
com.funambol.framework.engine.source.SyncSourceException


Copyright © 2003-2006 Funambol.