Class JCRLocalDropboxDrive.EventsSync
- java.lang.Object
-
- org.exoplatform.clouddrive.dropbox.JCRLocalDropboxDrive.EventsSync
-
- All Implemented Interfaces:
JCRLocalDropboxDrive.Changes,org.exoplatform.services.cms.clouddrives.CloudDrive.Command
- Enclosing class:
- JCRLocalDropboxDrive
protected class JCRLocalDropboxDrive.EventsSync extends Object implements JCRLocalDropboxDrive.Changes
An implementation ofJCRLocalCloudDrive.SyncCommandbased on an abstract deltas queue proposed and maintained by the cloud service.
-
-
Field Summary
Fields Modifier and Type Field Description protected DropboxAPIapiInternal API.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEventsSync()Create command for Template synchronization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)Process locally applied file (it can be any extra operations including the gathering of effected files/stats or chunk saving in JCR).booleancanApply(String parentId, String fileId)Answers if given file ID under its parent (by ID) already applied locally.protected voidpreSaveChunk()booleanremoved(String path)Adds the removed path to the scope of changes.protected voidsyncFiles()voidundo(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)Undo locally applied file or remove existing.
-
-
-
Field Detail
-
api
protected final DropboxAPI api
Internal API.
-
-
Constructor Detail
-
EventsSync
protected EventsSync() throws javax.jcr.RepositoryException, org.exoplatform.services.cms.clouddrives.DriveRemovedExceptionCreate command for Template synchronization.- Throws:
javax.jcr.RepositoryException- the repository exceptionorg.exoplatform.services.cms.clouddrives.DriveRemovedException- the drive removed exception
-
-
Method Detail
-
syncFiles
protected void syncFiles() throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
apply
public void apply(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local) throws javax.jcr.RepositoryException, org.exoplatform.services.cms.clouddrives.CloudDriveExceptionProcess locally applied file (it can be any extra operations including the gathering of effected files/stats or chunk saving in JCR).- Specified by:
applyin interfaceJCRLocalDropboxDrive.Changes- Parameters:
local-JCRLocalCloudFilechanged file- Throws:
javax.jcr.RepositoryException- the repository exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
undo
public void undo(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local) throws javax.jcr.RepositoryException, org.exoplatform.services.cms.clouddrives.CloudDriveExceptionUndo locally applied file or remove existing.- Specified by:
undoin interfaceJCRLocalDropboxDrive.Changes- Parameters:
local- the changed file- Throws:
javax.jcr.RepositoryException- the repository exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
removed
public boolean removed(String path) throws javax.jcr.RepositoryException, org.exoplatform.services.cms.clouddrives.CloudDriveException
Adds the removed path to the scope of changes. For a commandJCRLocalCloudDrive.AbstractCommandit effectively should add the path to its removed list.- Specified by:
removedin interfaceJCRLocalDropboxDrive.Changes- Parameters:
path- the path- Returns:
- true, if successful
- Throws:
javax.jcr.RepositoryException- the repository exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
canApply
public boolean canApply(String parentId, String fileId)
Answers if given file ID under its parent (by ID) already applied locally.- Specified by:
canApplyin interfaceJCRLocalDropboxDrive.Changes- Parameters:
parentId-StringfileId-String- Returns:
- boolean,
trueif file was already applied,falseotherwise.
-
preSaveChunk
protected void preSaveChunk() throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
-