com.funambol.exchange.engine.cache
Class ExchangeCachedSyncSource

java.lang.Object
  extended bycom.funambol.framework.engine.source.AbstractSyncSource
      extended bycom.funambol.exchange.engine.cache.ExchangeCachedSyncSource
All Implemented Interfaces:
java.io.Serializable, com.funambol.framework.engine.source.SyncSource
Direct Known Subclasses:
ExchangeSyncSource

public abstract class ExchangeCachedSyncSource
extends com.funambol.framework.engine.source.AbstractSyncSource
implements java.io.Serializable

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

See Also:
Serialized Form

Field Summary
protected  java.lang.String credentials
           
protected  java.lang.String exchangeFolder
          Property exchange folder
protected  java.lang.String exchangeHost
          Property Exchange host
protected  java.lang.String host
          Property SECC host
protected  java.util.logging.Logger log
           
protected  int port
          Property SECC Port
protected  long principalId
           
protected  int syncMode
           
protected  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
ExchangeCachedSyncSource()
           
 
Method Summary
protected  void addInExchangeItemsKeys(java.lang.String id)
          Add SyncItemKey with id to exchangeItemsKeys arrayList
protected  void addToCacheSyncItems(com.funambol.framework.engine.SyncItem[] syncItems)
          Add SyncItem array to cacheSyncItems arrayList
 void beginSync(com.funambol.framework.engine.source.SyncContext context)
          Method by the server at the begining of the sync process.
abstract  void deleteAll()
          deletes all Items from the Exchange server
 void endSync()
           
 com.funambol.framework.engine.SyncItemKey[] getAllSyncItemKeys()
           
protected  java.util.List getCachedSyncItems()
          Gets the list of cached items to be used in the package's classes and the subclasses.
protected  com.funambol.framework.engine.SyncItemKey[] getCacheSyncItemsKeys()
          find SyncItemKey array about cacheSyncItemsKeys
 com.funambol.framework.engine.SyncItemKey[] getDeletedSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp until)
           
 java.lang.String getExchangeFolder()
          Getter for property exchange folder.
abstract  Item[] getExchangeItems(java.lang.String username, java.lang.String credentials, java.lang.String exchangeFolder, java.lang.String[] ids, boolean isBeginSync)
           
protected  java.lang.String getHref(java.lang.String id, long principal)
          Return href (webdav resource name) of item
 com.funambol.framework.engine.SyncItemKey[] getNewSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp until)
           
protected  com.funambol.framework.engine.SyncItem getSyncItemById(java.lang.String id)
          find SyncItem in cacheSyncItems by id
protected  java.util.ArrayList getSyncItemKeysArrayListFromItems(Item[] items)
          return SyncItemKey ArrayList array about items
protected  com.funambol.framework.engine.SyncItemKey[] getSyncItemKeysFromItems(Item[] items)
          find SyncItemKey array about items
abstract  com.funambol.framework.engine.SyncItem[] getSyncItems(java.lang.String username, java.lang.String credentials, java.lang.String[] ids, java.lang.String exchangeFolder)
           
 char getSyncItemStateFromId(com.funambol.framework.engine.SyncItemKey syncItemKey)
           
protected  char getSyncItemStatus(java.lang.String key)
          Return SyncItem status
 com.funambol.framework.engine.SyncItemKey[] getUpdatedSyncItemKeys(java.sql.Timestamp since, java.sql.Timestamp until)
           
abstract  void initManager()
          init manager
protected  void removeInExchangeItemsKeys(java.lang.String id)
          Remove SyncItemKey with id from exchangeItemsKeys arrayList
 void setExchangeFolder(java.lang.String exchangeFolder)
          Setter for property exchange folder.
protected  void toSyncErrorNewItems(java.lang.String id)
          Add item to error new items array list
protected  void toSyncErrorRemoveItems(java.lang.String id)
          Add item to error remove items array list
protected  void toSyncErrorUpdateItems(java.lang.String id)
          Add item to error update items array list
protected  void toSyncNewItems(java.lang.String id, long crc, java.util.Date lastUpdate)
          Add item to new items array list
protected  void toSyncRemoveItems(java.lang.String id)
          Add item to remove items array list
protected  void toSyncUpdateItems(java.lang.String id, long crc, java.util.Date lastUpdate)
          Add item to update items array list
 
Methods inherited from class com.funambol.framework.engine.source.AbstractSyncSource
addSyncItem, commitSync, 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
 

Field Detail

log

protected java.util.logging.Logger log

principalId

protected long principalId

username

protected java.lang.String username

credentials

protected java.lang.String credentials

syncMode

protected int syncMode

exchangeFolder

protected java.lang.String exchangeFolder
Property exchange folder


host

protected java.lang.String host
Property SECC host


port

protected int port
Property SECC Port


exchangeHost

protected java.lang.String exchangeHost
Property Exchange host

Constructor Detail

ExchangeCachedSyncSource

public ExchangeCachedSyncSource()
Method Detail

getExchangeFolder

public java.lang.String getExchangeFolder()
Getter for property exchange folder.

Returns:
Value of property exchange folder.

setExchangeFolder

public void setExchangeFolder(java.lang.String exchangeFolder)
Setter for property exchange folder.

Parameters:
exchangeFolder - New value of property exchange folder.

beginSync

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

Method by the server at the begining of the sync process.

Specified by:
beginSync in interface com.funambol.framework.engine.source.SyncSource
Parameters:
context - the context of the sync
Throws:
com.funambol.framework.engine.source.SyncSourceException - if an error occurs
See Also:
SyncSource

deleteAll

public abstract void deleteAll()
                        throws com.funambol.framework.engine.source.SyncSourceException
deletes all Items from the Exchange server

Throws:
com.funambol.framework.engine.source.SyncSourceException

endSync

public void endSync()
             throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
endSync in interface com.funambol.framework.engine.source.SyncSource
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 until)
                                                               throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getNewSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getUpdatedSyncItemKeys

public com.funambol.framework.engine.SyncItemKey[] getUpdatedSyncItemKeys(java.sql.Timestamp since,
                                                                          java.sql.Timestamp until)
                                                                   throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getUpdatedSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
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 until)
                                                                   throws com.funambol.framework.engine.source.SyncSourceException
Specified by:
getDeletedSyncItemKeys in interface com.funambol.framework.engine.source.SyncSource
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
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getSyncItemStateFromId

public char getSyncItemStateFromId(com.funambol.framework.engine.SyncItemKey syncItemKey)
                            throws com.funambol.framework.engine.source.SyncSourceException
Throws:
com.funambol.framework.engine.source.SyncSourceException
See Also:
SyncSource

getExchangeItems

public abstract Item[] getExchangeItems(java.lang.String username,
                                        java.lang.String credentials,
                                        java.lang.String exchangeFolder,
                                        java.lang.String[] ids,
                                        boolean isBeginSync)
                                 throws com.funambol.framework.engine.source.SyncSourceException
Parameters:
username -
credentials -
exchangeFolder -
ids -
isBeginSync -
Returns:
items array
Throws:
com.funambol.framework.engine.source.SyncSourceException

getSyncItems

public abstract com.funambol.framework.engine.SyncItem[] getSyncItems(java.lang.String username,
                                                                      java.lang.String credentials,
                                                                      java.lang.String[] ids,
                                                                      java.lang.String exchangeFolder)
                                                               throws com.funambol.framework.engine.source.SyncSourceException
Parameters:
ids -
Returns:
items array
Throws:
com.funambol.framework.engine.source.SyncSourceException

initManager

public abstract void initManager()
                          throws com.funambol.framework.engine.source.SyncSourceException
init manager

Throws:
com.funambol.framework.engine.source.SyncSourceException

getSyncItemStatus

protected char getSyncItemStatus(java.lang.String key)
Return SyncItem status

Parameters:
key - SyncItem key

getHref

protected java.lang.String getHref(java.lang.String id,
                                   long principal)
                            throws com.funambol.framework.engine.source.SyncSourceException
Return href (webdav resource name) of item

Parameters:
id - id of item to find
principal -
Returns:
href (webdav resource name) of find item, or

null

if item not found
Throws:
com.funambol.framework.engine.source.SyncSourceException

toSyncNewItems

protected void toSyncNewItems(java.lang.String id,
                              long crc,
                              java.util.Date lastUpdate)
Add item to new items array list

Parameters:
id -
crc -
lastUpdate -

toSyncUpdateItems

protected void toSyncUpdateItems(java.lang.String id,
                                 long crc,
                                 java.util.Date lastUpdate)
Add item to update items array list

Parameters:
id -
crc -
lastUpdate -

toSyncRemoveItems

protected void toSyncRemoveItems(java.lang.String id)
Add item to remove items array list

Parameters:
id -

toSyncErrorNewItems

protected void toSyncErrorNewItems(java.lang.String id)
Add item to error new items array list

Parameters:
id -

toSyncErrorUpdateItems

protected void toSyncErrorUpdateItems(java.lang.String id)
Add item to error update items array list

Parameters:
id -

toSyncErrorRemoveItems

protected void toSyncErrorRemoveItems(java.lang.String id)
Add item to error remove items array list

Parameters:
id -

addToCacheSyncItems

protected void addToCacheSyncItems(com.funambol.framework.engine.SyncItem[] syncItems)
Add SyncItem array to cacheSyncItems arrayList

Parameters:
syncItems -

addInExchangeItemsKeys

protected void addInExchangeItemsKeys(java.lang.String id)
Add SyncItemKey with id to exchangeItemsKeys arrayList

Parameters:
id -

removeInExchangeItemsKeys

protected void removeInExchangeItemsKeys(java.lang.String id)
Remove SyncItemKey with id from exchangeItemsKeys arrayList

Parameters:
id -

getSyncItemById

protected com.funambol.framework.engine.SyncItem getSyncItemById(java.lang.String id)
find SyncItem in cacheSyncItems by id

Parameters:
id -

getCacheSyncItemsKeys

protected com.funambol.framework.engine.SyncItemKey[] getCacheSyncItemsKeys()
find SyncItemKey array about cacheSyncItemsKeys


getSyncItemKeysFromItems

protected com.funambol.framework.engine.SyncItemKey[] getSyncItemKeysFromItems(Item[] items)
find SyncItemKey array about items

Parameters:
items -

getSyncItemKeysArrayListFromItems

protected java.util.ArrayList getSyncItemKeysArrayListFromItems(Item[] items)
return SyncItemKey ArrayList array about items

Parameters:
items -

getCachedSyncItems

protected java.util.List getCachedSyncItems()

Gets the list of cached items to be used in the package's classes and the subclasses.

Returns:
the value of cacheSyncItems


Copyright © 2003-2006 Funambol.