com.funambol.syncclient.spds.source
Class SIFFileSystemSyncSource

java.lang.Object
  extended by com.funambol.syncclient.spds.source.FileSystemSyncSource
      extended by com.funambol.syncclient.spds.source.SIFFileSystemSyncSource
All Implemented Interfaces:
SyncSource

public class SIFFileSystemSyncSource
extends FileSystemSyncSource
implements SyncSource

This class implements a SyncSource that extends a FileSystemSyncSource and it's able to receive and send items in the following formats:

The clientContentType and the serverContentType specify the format of which the client and the server send the items and would receive the returned.

Version:
$Id: SIFFileSystemSyncSource.java,v 1.3 2007-12-22 18:09:17 nichele Exp $

Field Summary
 
Fields inherited from class com.funambol.syncclient.spds.source.FileSystemSyncSource
counter, DATABASE_FILE_NAME, DATABASE_HEADER, FORMAT_BASE64, isEXT3, isFAT32
 
Constructor Summary
SIFFileSystemSyncSource()
          Creates a new instance of AbstractSyncSource
 
Method Summary
protected  SyncItem[] filterSyncItems(java.security.Principal principal, java.util.Date since, char state)
          Filters the SyncItems in the synchronization database (after a refresh) based on the given principal, last sync timestamp and state (see SyncItemState).
 java.lang.String getCharset()
           
 java.lang.String getClientContentType()
           
 java.lang.String getServerContentType()
           
 java.lang.String getSourceDrive()
           
 void setCharset(java.lang.String charset)
           
 void setClientContentType(java.lang.String clientContentType)
           
 void setServerContentType(java.lang.String serverContentType)
           
 void setSourceDirectory(java.lang.String sourceDirectory)
           
 void setSourceDrive(java.lang.String sourceDrive)
           
 SyncItem setSyncItem(java.security.Principal principal, SyncItem syncItem)
          Replaces an existing SyncItem or adds a new SyncItem if it does not exist.
 
Methods inherited from class com.funambol.syncclient.spds.source.FileSystemSyncSource
beginSync, commitSync, emptyDataStore, endSync, getAllSyncItems, getDeletedSyncItems, getExistingFiles, getName, getNewSyncItems, getSourceDirectory, getSourceURI, getType, getUniqueFileName, getUpdatedSyncItems, isEncode, lastModifiedFromStateString, readFileContent, removeState, removeSyncItem, restoreSyncDB, roundTime, roundTimeEXT3, roundTimeFAT32, setEncode, setEncode, setName, setSourceURI, setState, setType, stateFromStateString, updateSyncDatabase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.funambol.syncclient.spds.engine.SyncSource
beginSync, commitSync, getAllSyncItems, getDeletedSyncItems, getName, getNewSyncItems, getSourceURI, getType, getUpdatedSyncItems, removeSyncItem
 

Constructor Detail

SIFFileSystemSyncSource

public SIFFileSystemSyncSource()
Creates a new instance of AbstractSyncSource

Method Detail

setSourceDrive

public void setSourceDrive(java.lang.String sourceDrive)
Overrides:
setSourceDrive in class FileSystemSyncSource

getSourceDrive

public java.lang.String getSourceDrive()
Overrides:
getSourceDrive in class FileSystemSyncSource

setSourceDirectory

public void setSourceDirectory(java.lang.String sourceDirectory)
Overrides:
setSourceDirectory in class FileSystemSyncSource

setCharset

public void setCharset(java.lang.String charset)

getCharset

public java.lang.String getCharset()

getClientContentType

public java.lang.String getClientContentType()

setClientContentType

public void setClientContentType(java.lang.String clientContentType)

getServerContentType

public java.lang.String getServerContentType()

setServerContentType

public void setServerContentType(java.lang.String serverContentType)

setSyncItem

public SyncItem setSyncItem(java.security.Principal principal,
                            SyncItem syncItem)
                     throws SyncException
Description copied from interface: SyncSource
Replaces an existing SyncItem or adds a new SyncItem if it does not exist. The item is also returned giving the opportunity to the source to modify its content and return the updated item (i.e. updating the id to the GUID).

Specified by:
setSyncItem in interface SyncSource
Overrides:
setSyncItem in class FileSystemSyncSource
Parameters:
principal - not used, always null
syncItem - the item to replace/add
Returns:
the inserted/updated item
Throws:
SyncException - in case of error (for instance if the underlying data store runs into problems)

filterSyncItems

protected SyncItem[] filterSyncItems(java.security.Principal principal,
                                     java.util.Date since,
                                     char state)
                              throws SyncException
Filters the SyncItems in the synchronization database (after a refresh) based on the given principal, last sync timestamp and state (see SyncItemState). If state is equals to UNKNOWN all items are returned.
Note that the current implementation ignores the principal: data do not depend on users.

Overrides:
filterSyncItems in class FileSystemSyncSource
Parameters:
principal - principal. null means any
since - last sync timestamp. null neans since ever
state - the state to use as filter
Returns:
an array of SyncItem objects whose state is equal to the given state.
Throws:
SyncException


Copyright © 2010 Funambol. All Rights Reserved.