Package org.exoplatform.clouddrive.cmis
Class JCRLocalCMISDrive.Sync
- java.lang.Object
-
- org.exoplatform.clouddrive.cmis.JCRLocalCMISDrive.Sync
-
- All Implemented Interfaces:
org.exoplatform.services.cms.clouddrives.CloudDrive.Command
- Enclosing class:
- JCRLocalCMISDrive
protected class JCRLocalCMISDrive.Sync extends Object
A facadeJCRLocalCloudDrive.SyncCommandimplementation. This command will choose an actual type of the synchronization depending on the CMIS repository capabilities (Changes Log support).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJCRLocalCMISDrive.Sync.ChangesAlgorithmAn implementation of sync based on an CMIS change log.protected classJCRLocalCMISDrive.Sync.TraversingAlgorithmCMIS drive sync based on all remote files traversing: we do compare all remote files with locals by its change log and fetch an item if the logs differ.
-
Field Summary
Fields Modifier and Type Field Description protected CMISAPIapiInternal API.protected JCRLocalCMISDrive.Sync.ChangesAlgorithmchangesLogThe changes log.protected org.exoplatform.services.cms.clouddrives.CloudDriveExceptionpreSyncErrorThe pre sync error.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSync()Instantiates a new sync.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcleanMoved(javax.jcr.Node fileNode, String parentId)Deprecated.protected voidcleanRenamed(javax.jcr.Node fileNode, String fileName)Remove a fact of local rename of the file from given name.protected voidpreSaveChunk()protected voidpreSyncFiles()protected voidsyncFiles()protected booleanwasMoved(javax.jcr.Node fileNode, String changeParentId)Deprecated.protected booleanwasRenamed(javax.jcr.Node fileNode, String changeName)Check if the file was renamed locally from given name.
-
-
-
Field Detail
-
api
protected final CMISAPI api
Internal API.
-
preSyncError
protected org.exoplatform.services.cms.clouddrives.CloudDriveException preSyncError
The pre sync error.
-
changesLog
protected JCRLocalCMISDrive.Sync.ChangesAlgorithm changesLog
The changes log.
-
-
Method Detail
-
preSyncFiles
protected void preSyncFiles() throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException, InterruptedException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryExceptionInterruptedException
-
syncFiles
protected void syncFiles() throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException, InterruptedException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryExceptionInterruptedException
-
preSaveChunk
protected void preSaveChunk() throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
wasRenamed
protected boolean wasRenamed(javax.jcr.Node fileNode, String changeName) throws javax.jcr.RepositoryExceptionCheck if the file was renamed locally from given name. Such check actual when we receive remote changes happened before a local rename of the file.- Parameters:
fileNode- the file nodechangeName- the change name- Returns:
- true, if successful
- Throws:
javax.jcr.RepositoryException- the repository exception
-
cleanRenamed
protected void cleanRenamed(javax.jcr.Node fileNode, String fileName) throws javax.jcr.RepositoryExceptionRemove a fact of local rename of the file from given name. This method should be called when syncing from remote to local.- Parameters:
fileNode- the file nodefileName- the file name- Throws:
javax.jcr.RepositoryException- the repository exception
-
wasMoved
@Deprecated protected boolean wasMoved(javax.jcr.Node fileNode, String changeParentId) throws javax.jcr.RepositoryException
Deprecated.Check if the file was moved locally from given parent. Such check actual when we receive remote changes happened before a local move of the file.- Parameters:
fileNode- the file nodechangeParentId- the change parent id- Returns:
- true, if successful
- Throws:
javax.jcr.RepositoryException- the repository exception
-
cleanMoved
@Deprecated protected void cleanMoved(javax.jcr.Node fileNode, String parentId) throws javax.jcr.RepositoryException
Deprecated.Remove a fact of local move of the file from given parent. This method should be called when syncing from remote to local.- Parameters:
fileNode- the file nodeparentId- the parent id- Throws:
javax.jcr.RepositoryException- the repository exception
-
-