Package org.exoplatform.clouddrive.cmis
Class JCRLocalCMISDrive.Sync.ChangesAlgorithm
- java.lang.Object
-
- org.exoplatform.clouddrive.cmis.JCRLocalCMISDrive.Sync.ChangesAlgorithm
-
- Enclosing class:
- JCRLocalCMISDrive.Sync
protected class JCRLocalCMISDrive.Sync.ChangesAlgorithm extends Object
An implementation of sync based on an CMIS change log.
-
-
Field Summary
Fields Modifier and Type Field Description protected CMISAPI.ChangesIteratorchangesChanges from drive to apply.
-
Constructor Summary
Constructors Modifier Constructor Description protectedChangesAlgorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddeleteFile(String fileId, Set<String> parentIds)Remove file's node.protected CMISAPI.ChangeTokengetLastChangeToken()Gets the last change token.protected voidsyncFiles(CMISAPI.ChangeToken fromChangeToken)Sync files.protected voidupdateFile(org.apache.chemistry.opencmis.client.api.CmisObject file, Set<String> parentIds, boolean isFolder)Create or update file's node.
-
-
-
Field Detail
-
changes
protected CMISAPI.ChangesIterator changes
Changes from drive to apply.
-
-
Method Detail
-
getLastChangeToken
protected CMISAPI.ChangeToken getLastChangeToken()
Gets the last change token.- Returns:
- the last change token
-
syncFiles
protected void syncFiles(CMISAPI.ChangeToken fromChangeToken) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
Sync files.- Parameters:
fromChangeToken- the from change token- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exceptionjavax.jcr.RepositoryException- the repository exception
-
deleteFile
protected void deleteFile(String fileId, Set<String> parentIds) throws javax.jcr.RepositoryException, org.exoplatform.services.cms.clouddrives.CloudDriveException
Remove file's node.- Parameters:
fileId-StringparentIds- set of Ids of parents (folders)- Throws:
javax.jcr.RepositoryException- the repository exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
updateFile
protected void updateFile(org.apache.chemistry.opencmis.client.api.CmisObject file, Set<String> parentIds, boolean isFolder) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryExceptionCreate or update file's node.- Parameters:
file-CmisObjectparentIds- set of Ids of parents (folders)isFolder- the is folder- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exceptionjavax.jcr.RepositoryException- the repository exception
-
-