org.opencrx.application.airsync.server.impl
Class SyncBackend

java.lang.Object
  extended by org.opencrx.application.airsync.server.impl.SyncBackend
All Implemented Interfaces:
ISyncBackend

public class SyncBackend
extends Object
implements ISyncBackend


Constructor Summary
SyncBackend()
           
 
Method Summary
protected  Activity createActivity(ActivityGroup group, short activityClass, String name, String detailedDescription, Date scheduledStart)
           
 String createOrUpdateDataItem(SyncRequest request, String folderId, String itemId, IData data)
           
 String createOrUpdateFolder(SyncRequest request, SyncFolder folder)
           
 void deleteDataItem(SyncRequest request, String folderId, String itemId)
           
 String deleteFolder(SyncRequest request, String folderId)
           
 SyncDataItem fetchDataItem(SyncRequest request, String folderId, String itemId)
           
 AttachmentDataT getAttachementData(SyncRequest request, String attachmentId)
           
 List<SyncDataItem> getChangedDataItems(SyncRequest request, SyncCollection collection, boolean noData, int maxItems)
           
 List<SyncFolder> getChangedFolders(SyncRequest request, SyncState syncState)
           
 File getContextTempDir(SyncRequest request, File tempDir)
           
 SyncDataItem.State getDataItemState(SyncRequest request, SyncCollection collection, SyncDataItem dataItem)
           
 List<String> getDeletedDataItems(SyncRequest request, SyncCollection collection)
           
 List<SyncFolder> getDeletedFolders(SyncRequest request, SyncState syncState)
           
 List<SyncFolder> getFolders(SyncRequest request, SyncState syncState, boolean activeFoldersOnly)
           
 String getNewSyncKey(SyncRequest request, String syncKey)
           
protected  javax.jdo.PersistenceManager getPersistenceManager(SyncRequest request)
           
 SyncState getSyncState(SyncRequest request, String syncKey)
           
protected  UserHome getUserHome(SyncRequest request)
           
 String moveDataItem(SyncRequest request, String srcFolderId, String dstFolderId, String itemId)
           
 void sendMail(SyncRequest request, InputStream mimeMessage)
           
 void setDataItemReadFlag(SyncRequest request, String folderId, String itemId, boolean read)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncBackend

public SyncBackend()
Method Detail

getPersistenceManager

protected javax.jdo.PersistenceManager getPersistenceManager(SyncRequest request)
                                                      throws ServiceException
Throws:
ServiceException

getUserHome

protected UserHome getUserHome(SyncRequest request)

getSyncState

public SyncState getSyncState(SyncRequest request,
                              String syncKey)
Specified by:
getSyncState in interface ISyncBackend

getNewSyncKey

public String getNewSyncKey(SyncRequest request,
                            String syncKey)
Specified by:
getNewSyncKey in interface ISyncBackend

deleteDataItem

public void deleteDataItem(SyncRequest request,
                           String folderId,
                           String itemId)
                    throws ServiceException
Specified by:
deleteDataItem in interface ISyncBackend
Throws:
ServiceException

fetchDataItem

public SyncDataItem fetchDataItem(SyncRequest request,
                                  String folderId,
                                  String itemId)
                           throws ServiceException
Specified by:
fetchDataItem in interface ISyncBackend
Throws:
ServiceException

getAttachementData

public AttachmentDataT getAttachementData(SyncRequest request,
                                          String attachmentId)
                                   throws ServiceException
Specified by:
getAttachementData in interface ISyncBackend
Throws:
ServiceException

createActivity

protected Activity createActivity(ActivityGroup group,
                                  short activityClass,
                                  String name,
                                  String detailedDescription,
                                  Date scheduledStart)
                           throws ServiceException
Throws:
ServiceException

createOrUpdateDataItem

public String createOrUpdateDataItem(SyncRequest request,
                                     String folderId,
                                     String itemId,
                                     IData data)
                              throws ServiceException
Specified by:
createOrUpdateDataItem in interface ISyncBackend
Throws:
ServiceException

moveDataItem

public String moveDataItem(SyncRequest request,
                           String srcFolderId,
                           String dstFolderId,
                           String itemId)
                    throws ServiceException
Specified by:
moveDataItem in interface ISyncBackend
Throws:
ServiceException

setDataItemReadFlag

public void setDataItemReadFlag(SyncRequest request,
                                String folderId,
                                String itemId,
                                boolean read)
                         throws ServiceException
Specified by:
setDataItemReadFlag in interface ISyncBackend
Throws:
ServiceException

getChangedDataItems

public List<SyncDataItem> getChangedDataItems(SyncRequest request,
                                              SyncCollection collection,
                                              boolean noData,
                                              int maxItems)
                                       throws ServiceException
Specified by:
getChangedDataItems in interface ISyncBackend
Throws:
ServiceException

getDeletedDataItems

public List<String> getDeletedDataItems(SyncRequest request,
                                        SyncCollection collection)
                                 throws ServiceException
Specified by:
getDeletedDataItems in interface ISyncBackend
Throws:
ServiceException

createOrUpdateFolder

public String createOrUpdateFolder(SyncRequest request,
                                   SyncFolder folder)
Specified by:
createOrUpdateFolder in interface ISyncBackend

deleteFolder

public String deleteFolder(SyncRequest request,
                           String folderId)
Specified by:
deleteFolder in interface ISyncBackend

getFolders

public List<SyncFolder> getFolders(SyncRequest request,
                                   SyncState syncState,
                                   boolean activeFoldersOnly)
                            throws ServiceException
Throws:
ServiceException

getChangedFolders

public List<SyncFolder> getChangedFolders(SyncRequest request,
                                          SyncState syncState)
                                   throws ServiceException
Specified by:
getChangedFolders in interface ISyncBackend
Throws:
ServiceException

getDeletedFolders

public List<SyncFolder> getDeletedFolders(SyncRequest request,
                                          SyncState syncState)
                                   throws ServiceException
Specified by:
getDeletedFolders in interface ISyncBackend
Throws:
ServiceException

getDataItemState

public SyncDataItem.State getDataItemState(SyncRequest request,
                                           SyncCollection collection,
                                           SyncDataItem dataItem)
                                    throws ServiceException
Specified by:
getDataItemState in interface ISyncBackend
Throws:
ServiceException

sendMail

public void sendMail(SyncRequest request,
                     InputStream mimeMessage)
              throws ServiceException
Specified by:
sendMail in interface ISyncBackend
Throws:
ServiceException

getContextTempDir

public File getContextTempDir(SyncRequest request,
                              File tempDir)
                       throws ServiceException
Specified by:
getContextTempDir in interface ISyncBackend
Throws:
ServiceException


This software is published under the BSD license. Copyright © 2003-2010, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.