com.funambol.email.engine.cache
Class CrcCachedSyncSource

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

public abstract class CrcCachedSyncSource
extends com.funambol.framework.engine.source.AbstractSyncSource
implements com.funambol.framework.engine.source.FilterableSyncSource, java.io.Serializable, com.funambol.framework.tools.beans.LazyInitBean

This class represents a SyncSource that read and store the state of the items in a support table.

See Also:
Serialized Form

Field Summary
 EmailFilter filter
           
 java.lang.String jndiDataSourceName
           
 IMailServerWrapper mswf
          wrapper for the Mail Server
 java.security.Principal principal
           
 long principalId
           
 java.util.ArrayList sentItems
          keep the items id and the result of send operation
 int syncMode
           
 java.lang.String userName
           
 
Fields inherited from class com.funambol.framework.engine.source.AbstractSyncSource
howManyAdded, howManyDeleted, howManyUpdated, info, LOG_NAME, name, sourceQuery, sourceURI, type
 
Constructor Summary
CrcCachedSyncSource()
           
 
Method Summary
 void beginSync(com.funambol.framework.engine.source.SyncContext context)
          BeginSync
abstract  void clearServerInfo()
           
 void endSync()
          End Sync Method
abstract  java.util.HashMap getAllSyncItemInfo()
           
 com.funambol.framework.engine.SyncItemKey[] getDeletedSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp to)
           
 java.util.HashMap getLocalItems()
           
 com.funambol.framework.engine.SyncItemKey[] getNewSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp to)
           
 java.util.HashMap getServerItems()
           
 char getSyncItemStateFromId(com.funambol.framework.engine.SyncItemKey syncItemKey)
           
 com.funambol.framework.engine.SyncItemKey[] getUpdatedSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp to)
           
 void init()
          Init the syncSource
 
Methods inherited from class com.funambol.framework.engine.source.AbstractSyncSource
addSyncItem, commitSync, getAllSyncItemKeys, getInfo, getName, getSourceQuery, getSourceURI, getSyncItemFromId, getSyncItemKeysFromTwin, getType, removeSyncItem, setInfo, setName, setOperationStatus, setSourceURI, setType, toString, updateSyncItem
 
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
isSyncItemInFilterClause, isSyncItemInFilterClause
 
Methods inherited from interface com.funambol.framework.engine.source.SyncSource
addSyncItem, commitSync, getAllSyncItemKeys, getInfo, getName, getSourceURI, getSyncItemFromId, getSyncItemKeysFromTwin, getType, removeSyncItem, setOperationStatus, updateSyncItem
 

Field Detail

jndiDataSourceName

public java.lang.String jndiDataSourceName

principal

public java.security.Principal principal

principalId

public long principalId

userName

public java.lang.String userName

syncMode

public int syncMode

filter

public EmailFilter filter

mswf

public IMailServerWrapper mswf
wrapper for the Mail Server


sentItems

public java.util.ArrayList sentItems
keep the items id and the result of send operation

Constructor Detail

CrcCachedSyncSource

public CrcCachedSyncSource()
Method Detail

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
Throws:
com.funambol.framework.tools.beans.BeanInitializationException

beginSync

public void beginSync(com.funambol.framework.engine.source.SyncContext context)
               throws com.funambol.framework.engine.source.SyncSourceException
BeginSync

Specified by:
beginSync in interface com.funambol.framework.engine.source.SyncSource
Parameters:
context - The sync context that includes the principal, sync mode and filter clause.
Throws:
com.funambol.framework.engine.source.SyncSourceException

endSync

public void endSync()
             throws com.funambol.framework.engine.source.SyncSourceException
End Sync Method

Specified by:
endSync in interface com.funambol.framework.engine.source.SyncSource
Throws:
com.funambol.framework.engine.source.SyncSourceException

getUpdatedSyncItemKeys

public com.funambol.framework.engine.SyncItemKey[] getUpdatedSyncItemKeys(java.sql.Timestamp since,
                                                                          java.sql.Timestamp to)
                                                                   throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getUpdatedSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
Parameters:
since - Timestamp
to - Timestamp
Returns:
SyncItemKey[]
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getNewSyncItemKeys

public com.funambol.framework.engine.SyncItemKey[] getNewSyncItemKeys(java.sql.Timestamp since,
                                                                      java.sql.Timestamp to)
                                                               throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getNewSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
Parameters:
since - Timestamp
to - Timestamp
Returns:
SyncItemKey[]
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getDeletedSyncItemKeys

public com.funambol.framework.engine.SyncItemKey[] getDeletedSyncItemKeys(java.sql.Timestamp since,
                                                                          java.sql.Timestamp to)
                                                                   throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getDeletedSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
Parameters:
since - Timestamp
to - Timestamp
Returns:
SyncItemKey[]
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getServerItems

public java.util.HashMap getServerItems()
Returns:
CrcSyncItemInfo[]

getLocalItems

public java.util.HashMap getLocalItems()
Returns:
map with all local CrcSyncItemInfo

getAllSyncItemInfo

public abstract java.util.HashMap getAllSyncItemInfo()
                                              throws com.funambol.framework.engine.source.SyncSourceException
Returns:
map with all Mail Server CrcSyncItemInfo
Throws:
com.funambol.framework.engine.source.SyncSourceException

clearServerInfo

public abstract void clearServerInfo()
                              throws com.funambol.framework.engine.source.SyncSourceException
Throws:
com.funambol.framework.engine.source.SyncSourceException

getSyncItemStateFromId

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


Copyright © 2003-2006 Funambol.