com.funambol.client.source
Class AppSyncSourceConfig

java.lang.Object
  extended by com.funambol.client.source.AppSyncSourceConfig

public class AppSyncSourceConfig
extends java.lang.Object

This class represents the configuration of an AppSyncSource. In particular it holds all the values that are kept across application resets. These values are loaded/saved using a Configuration object.


Field Summary
protected  boolean active
           
protected  AppSyncSource appSource
           
protected static java.lang.String CONF_KEY_CONFIG_VERSION
           
protected static java.lang.String CONF_KEY_PENDING_SYNC_MODE
           
protected static java.lang.String CONF_KEY_PENDING_SYNC_TYPE
           
protected static java.lang.String CONF_KEY_SOURCE_ACTIVE
           
protected static java.lang.String CONF_KEY_SOURCE_CONFIG
           
protected static java.lang.String CONF_KEY_SOURCE_ENABLED
           
protected static java.lang.String CONF_KEY_SOURCE_FULL
           
protected static java.lang.String CONF_KEY_SOURCE_SYNCED
           
protected static java.lang.String CONF_KEY_SYNC_STATUS
           
protected static java.lang.String CONF_KEY_SYNC_TIMESTAMP
           
protected static java.lang.String CONF_KEY_SYNC_TYPE
           
protected static java.lang.String CONF_KEY_SYNC_URI
           
protected static java.lang.String CONF_KEY_UPLOAD_CONTENT_VIA_HTTP
           
protected  Configuration configuration
           
protected  Customization customization
           
protected  boolean deviceFullShown
           
protected  boolean dirty
           
protected  boolean enabled
           
protected  int lastSyncStatus
           
protected  long lastSyncTimestamp
           
protected  boolean loaded
           
protected  int pendingSyncMode
           
protected  java.lang.String pendingSyncType
           
protected  boolean sourceSynced
           
protected  int syncType
           
protected  boolean uploadContentViaHttp
           
protected  java.lang.String uri
           
protected  java.lang.String version
           
 
Constructor Summary
AppSyncSourceConfig(AppSyncSource appSource, Customization customization, Configuration configuration)
           
 
Method Summary
 void commit()
           
 boolean getActive()
           
 boolean getDeviceFullShown()
           
 boolean getEnabled()
           
 int getLastSyncStatus()
           
 long getLastSyncTimestamp()
           
 int getPendingSyncMode()
          Returns a value indicating if there is a pending sync.
 java.lang.String getPendingSyncType()
          Returns a value indicating if there is a pending sync.
 boolean getSynced()
           
 int getSyncType()
           
 boolean getUploadContentViaHttp()
           
 java.lang.String getUri()
           
 boolean isDirty()
           
 void load(SourceConfig config)
           
protected  void migrateConfig(java.lang.String from, java.lang.String to, SourceConfig config)
           
protected  void migrateSupportedSyncModes(SourceConfig config)
          This method checks if the sync type currently set for this source is still supported.
 void save()
          Saves a syncsource config to storage.
 void saveSourceSyncConfig()
           
 void setActive(boolean active)
           
 void setDeviceFullShown(boolean value)
           
 void setEnabled(boolean enabled)
           
 void setLastSyncStatus(int lastSyncStatus)
           
 void setLastSyncTimestamp(long ts)
           
 void setPendingSync(java.lang.String pendingSyncType, int pendingSyncMode)
          Sets the last (only one) pending sync.
 void setSynced(boolean sourceSynced)
           
 void setSyncType(int syncType)
           
 void setUploadContentViaHttp(boolean value)
           
 void setUri(java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_KEY_CONFIG_VERSION

protected static final java.lang.String CONF_KEY_CONFIG_VERSION
See Also:
Constant Field Values

CONF_KEY_SYNC_URI

protected static final java.lang.String CONF_KEY_SYNC_URI
See Also:
Constant Field Values

CONF_KEY_SYNC_TYPE

protected static final java.lang.String CONF_KEY_SYNC_TYPE
See Also:
Constant Field Values

CONF_KEY_SOURCE_FULL

protected static final java.lang.String CONF_KEY_SOURCE_FULL
See Also:
Constant Field Values

CONF_KEY_SOURCE_SYNCED

protected static final java.lang.String CONF_KEY_SOURCE_SYNCED
See Also:
Constant Field Values

CONF_KEY_SOURCE_ACTIVE

protected static final java.lang.String CONF_KEY_SOURCE_ACTIVE
See Also:
Constant Field Values

CONF_KEY_SOURCE_ENABLED

protected static final java.lang.String CONF_KEY_SOURCE_ENABLED
See Also:
Constant Field Values

CONF_KEY_SYNC_STATUS

protected static final java.lang.String CONF_KEY_SYNC_STATUS
See Also:
Constant Field Values

CONF_KEY_SOURCE_CONFIG

protected static final java.lang.String CONF_KEY_SOURCE_CONFIG
See Also:
Constant Field Values

CONF_KEY_UPLOAD_CONTENT_VIA_HTTP

protected static final java.lang.String CONF_KEY_UPLOAD_CONTENT_VIA_HTTP
See Also:
Constant Field Values

CONF_KEY_PENDING_SYNC_TYPE

protected static final java.lang.String CONF_KEY_PENDING_SYNC_TYPE
See Also:
Constant Field Values

CONF_KEY_PENDING_SYNC_MODE

protected static final java.lang.String CONF_KEY_PENDING_SYNC_MODE
See Also:
Constant Field Values

CONF_KEY_SYNC_TIMESTAMP

protected static final java.lang.String CONF_KEY_SYNC_TIMESTAMP
See Also:
Constant Field Values

uri

protected java.lang.String uri

enabled

protected boolean enabled

active

protected boolean active

appSource

protected AppSyncSource appSource

syncType

protected int syncType

deviceFullShown

protected boolean deviceFullShown

sourceSynced

protected boolean sourceSynced

lastSyncStatus

protected int lastSyncStatus

lastSyncTimestamp

protected long lastSyncTimestamp

dirty

protected boolean dirty

uploadContentViaHttp

protected boolean uploadContentViaHttp

pendingSyncType

protected java.lang.String pendingSyncType

pendingSyncMode

protected int pendingSyncMode

version

protected java.lang.String version

loaded

protected boolean loaded

configuration

protected Configuration configuration

customization

protected Customization customization
Constructor Detail

AppSyncSourceConfig

public AppSyncSourceConfig(AppSyncSource appSource,
                           Customization customization,
                           Configuration configuration)
Method Detail

getEnabled

public boolean getEnabled()

setEnabled

public void setEnabled(boolean enabled)

getActive

public boolean getActive()

setActive

public void setActive(boolean active)

getLastSyncStatus

public int getLastSyncStatus()

setLastSyncStatus

public void setLastSyncStatus(int lastSyncStatus)

getUri

public java.lang.String getUri()

setUri

public void setUri(java.lang.String uri)

getDeviceFullShown

public boolean getDeviceFullShown()

setDeviceFullShown

public void setDeviceFullShown(boolean value)

setSynced

public void setSynced(boolean sourceSynced)

getSynced

public boolean getSynced()

getSyncType

public int getSyncType()

setSyncType

public void setSyncType(int syncType)

getUploadContentViaHttp

public boolean getUploadContentViaHttp()

setUploadContentViaHttp

public void setUploadContentViaHttp(boolean value)

getLastSyncTimestamp

public long getLastSyncTimestamp()

setLastSyncTimestamp

public void setLastSyncTimestamp(long ts)

getPendingSyncType

public java.lang.String getPendingSyncType()
Returns a value indicating if there is a pending sync. A pending sync is a synchronization that could be performed for any reason. The value that is stored here, is the sync type (MANUAL, SCHEDULED or PUSH).

Returns:
null if there is no pending sync, a value otherwise (can be MANUAL, SCHEDULED or PUSH)

getPendingSyncMode

public int getPendingSyncMode()
Returns a value indicating if there is a pending sync. A pending sync is a synchronization that could be performed for any reason. The value that is stored here, is the sync mode (SyncML alert sync mode).

Returns:
-1 if there is no pending sync, a value otherwise (can be any value according to SyncML alert codes)

setPendingSync

public void setPendingSync(java.lang.String pendingSyncType,
                           int pendingSyncMode)
Sets the last (only one) pending sync. A pending sync is a synchronization that could not be performed for any reason. Two info are stored for this sync:

Parameters:
pendingSyncType - can be null to cancel any pending sync, or one of the values in MANUAL, SCHEDULED, PUSH
syncMode - the SyncML alert code, or -1 to cancel any pending sync

saveSourceSyncConfig

public void saveSourceSyncConfig()

save

public void save()
Saves a syncsource config to storage. Classes that extend the AppSyncSourceConfig shall always save their custom data before invoking this method, because the method before returning notifies the configuration that a source has changed.


load

public void load(SourceConfig config)

commit

public void commit()

isDirty

public boolean isDirty()

migrateConfig

protected void migrateConfig(java.lang.String from,
                             java.lang.String to,
                             SourceConfig config)

migrateSupportedSyncModes

protected void migrateSupportedSyncModes(SourceConfig config)
This method checks if the sync type currently set for this source is still supported. If not, then the source is disabled and its anchor reset. This method shall be invoked any time a client removes a sync type for a source.



Copyright © 2001-2009 Funambol.