com.funambol.email.engine.source
Class PopEmailSyncSource

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

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

This class implements common methods of EmailPOPSyncSource

version $Id: PopEmailSyncSource.java,v 1.30 2006/06/25 14:39:11 gbmiglia Exp $

See Also:
Serialized Form

Field Summary
protected  java.util.logging.Logger log
           
protected  PopEntityManager pem
           
 
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
PopEmailSyncSource()
           
 
Method Summary
 com.funambol.framework.engine.SyncItem addSyncItem(com.funambol.framework.engine.SyncItem syncItem)
          This method can only send the mail but not append the mail in the outbox and sent folder.
 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
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

pem

protected PopEntityManager pem
Constructor Detail

PopEmailSyncSource

public PopEmailSyncSource()
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
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
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
Parameters:
syncItemKey - SyncItemKey
Returns:
SyncItem
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

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
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:
SyncItemInfo[]
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
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
This method can only send the mail but not append the mail in the outbox and sent folder.

Specified by:
addSyncItem in interface com.funambol.framework.engine.source.SyncSource
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
Parameters:
syncItem - SyncItem
Returns:
SyncItem
Throws:
com.funambol.framework.engine.source.SyncSourceException


Copyright © 2003-2006 Funambol.