Package org.duracloud.client.task
Class SnapshotTaskClientImpl
- java.lang.Object
-
- org.duracloud.client.task.SnapshotTaskClientImpl
-
- All Implemented Interfaces:
SnapshotTaskClient
public class SnapshotTaskClientImpl extends Object implements SnapshotTaskClient
Implements the snapshot task client interface by making task calls through a ContentStore.- Author:
- Bill Branan Date: 8/8/14
-
-
Constructor Summary
Constructors Constructor Description SnapshotTaskClientImpl(ContentStore contentStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CleanupSnapshotTaskResultcleanupSnapshot(String spaceId)Cleans up content that is no longer needed now that the snapshot has been transferred successfully.CompleteRestoreTaskResultcompleteRestore(String spaceId, int daysToExpire)Performs setup necessary to expire content which has been restored.CompleteSnapshotTaskResultcompleteSnapshot(String spaceId)Completes the snapshot.CreateSnapshotTaskResultcreateSnapshot(String spaceId, String description, String userEmail)Begins the process of creating a snapshot by collecting the necessary information and passing it down to the snapshot bridge application.GetRestoreTaskResultgetRestore(String restoreId)Gets the status and details of a snapshot restore action based on the ID of the restore.GetRestoreTaskResultgetRestoreBySnapshot(String snapshotId)Gets the status and details of a snapshot restore action based on the ID of the original snapshot.GetSnapshotTaskResultgetSnapshot(String snapshotId)Gets the status and details of a snapshot action.GetSnapshotContentsTaskResultgetSnapshotContents(String snapshotId, int pageNumber, int pageSize, String prefix)Gets the list of content items that are contained in the snapshot.GetSnapshotHistoryTaskResultgetSnapshotHistory(String snapshotId, int pageNumber, int pageSize)Gets the list of history items that are contained in the snapshot.GetSnapshotListTaskResultgetSnapshots()Gets a listing of snapshots which are accessible to this accountRequestRestoreSnapshotTaskResultrequestRestoreSnapshot(String snapshotId, String userEmail)Sends a snapshot restore request to the DuraCloud Admin.RestoreSnapshotTaskResultrestoreSnapshot(String snapshotId, String userEmail)Begins the process of restoring a snapshot by creating a landing space and informing the snapshot bridge application that a restore action needs to be performed.
-
-
-
Constructor Detail
-
SnapshotTaskClientImpl
public SnapshotTaskClientImpl(ContentStore contentStore)
-
-
Method Detail
-
createSnapshot
public CreateSnapshotTaskResult createSnapshot(String spaceId, String description, String userEmail) throws ContentStoreException
Begins the process of creating a snapshot by collecting the necessary information and passing it down to the snapshot bridge application. Along the way, the space provided is also set to read-only so that changes cannot be made to the content.- Specified by:
createSnapshotin interfaceSnapshotTaskClient- Parameters:
spaceId- the ID of the space where the content to snapshot residesdescription- of the snapshotuserEmail- address to inform when the snapshot is complete- Returns:
- results
- Throws:
ContentStoreException- on error
-
getSnapshot
public GetSnapshotTaskResult getSnapshot(String snapshotId) throws ContentStoreException
Gets the status and details of a snapshot action.- Specified by:
getSnapshotin interfaceSnapshotTaskClient- Parameters:
snapshotId- the ID of the snapshot to retrieve- Returns:
- results
- Throws:
ContentStoreException- on error
-
cleanupSnapshot
public CleanupSnapshotTaskResult cleanupSnapshot(String spaceId) throws ContentStoreException
Cleans up content that is no longer needed now that the snapshot has been transferred successfully. This call should be made before the completeSnapshot call.- Specified by:
cleanupSnapshotin interfaceSnapshotTaskClient- Returns:
- Throws:
ContentStoreException
-
completeSnapshot
public CompleteSnapshotTaskResult completeSnapshot(String spaceId) throws ContentStoreException
Completes the snapshot. The cleanupSnapshot call should be made and all content should have been removed from the snapshot space prior to this call being made.- Specified by:
completeSnapshotin interfaceSnapshotTaskClient- Parameters:
spaceId- the ID of the space that hosted the snapshot content- Returns:
- results
- Throws:
ContentStoreException- on error
-
getSnapshots
public GetSnapshotListTaskResult getSnapshots() throws ContentStoreException
Gets a listing of snapshots which are accessible to this account- Specified by:
getSnapshotsin interfaceSnapshotTaskClient- Returns:
- results
- Throws:
ContentStoreException- on error
-
getSnapshotContents
public GetSnapshotContentsTaskResult getSnapshotContents(String snapshotId, int pageNumber, int pageSize, String prefix) throws ContentStoreException
Gets the list of content items that are contained in the snapshot. This is the same as the list of content that existed in the original space at the moment the snapshot was initiated.- Specified by:
getSnapshotContentsin interfaceSnapshotTaskClient- Parameters:
snapshotId- the ID of the snapshot to retrievepageNumber- the page number of result set pagespageSize- the maximum number of content items to include in the result setprefix- an optional prefix used to find content items- Returns:
- list of content items
- Throws:
ContentStoreException- on error
-
getSnapshotHistory
public GetSnapshotHistoryTaskResult getSnapshotHistory(String snapshotId, int pageNumber, int pageSize) throws ContentStoreException
Description copied from interface:SnapshotTaskClientGets the list of history items that are contained in the snapshot.- Specified by:
getSnapshotHistoryin interfaceSnapshotTaskClient- Parameters:
snapshotId- the ID of the snapshot to retrievepageNumber- the page number of result set pagespageSize- the maximum number of content items to include in the result set- Returns:
- list of history items
- Throws:
ContentStoreException- on error
-
restoreSnapshot
public RestoreSnapshotTaskResult restoreSnapshot(String snapshotId, String userEmail) throws ContentStoreException
Begins the process of restoring a snapshot by creating a landing space and informing the snapshot bridge application that a restore action needs to be performed.- Specified by:
restoreSnapshotin interfaceSnapshotTaskClient- Parameters:
snapshotId- the ID of the snapshot to restoreuserEmail- address to inform when restoration is complete- Returns:
- results
- Throws:
ContentStoreException- on error
-
requestRestoreSnapshot
public RequestRestoreSnapshotTaskResult requestRestoreSnapshot(String snapshotId, String userEmail) throws ContentStoreException
Sends a snapshot restore request to the DuraCloud Admin.- Specified by:
requestRestoreSnapshotin interfaceSnapshotTaskClient- Parameters:
snapshotId- the ID of the snapshot to restoreuserEmail- address to inform when restore starts and completes.- Returns:
- results
- Throws:
ContentStoreException- on error
-
completeRestore
public CompleteRestoreTaskResult completeRestore(String spaceId, int daysToExpire) throws ContentStoreException
Performs setup necessary to expire content which has been restored.- Specified by:
completeRestorein interfaceSnapshotTaskClient- Parameters:
spaceId- the ID of the space to which content was restoreddaysToExpire- length of time before restored content expires (in days)- Returns:
- results
- Throws:
ContentStoreException- on error
-
getRestore
public GetRestoreTaskResult getRestore(String restoreId) throws ContentStoreException
Gets the status and details of a snapshot restore action based on the ID of the restore.- Specified by:
getRestorein interfaceSnapshotTaskClient- Returns:
- results
- Throws:
ContentStoreException- on error
-
getRestoreBySnapshot
public GetRestoreTaskResult getRestoreBySnapshot(String snapshotId) throws ContentStoreException
Gets the status and details of a snapshot restore action based on the ID of the original snapshot.- Specified by:
getRestoreBySnapshotin interfaceSnapshotTaskClient- Returns:
- results
- Throws:
ContentStoreException- on error
-
-