Class AbstractSnapshotTaskRunner
java.lang.Object
org.duracloud.snapshottask.snapshot.AbstractSnapshotTaskRunner
- All Implemented Interfaces:
TaskRunner
- Direct Known Subclasses:
GetRestoreTaskRunner,GetSnapshotContentsTaskRunner,GetSnapshotHistoryTaskRunner,GetSnapshotsTaskRunner,GetSnapshotsTotalsTaskRunner,GetSnapshotTaskRunner,RequestRestoreSnapshotTaskRunner,RestartSnapshotTaskRunner,RestoreSnapshotTaskRunner,SpaceModifyingSnapshotTaskRunner
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSnapshotTaskRunner(String bridgeAppHost, String bridgeAppPort, String bridgeAppUser, String bridgeAppPass) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected RestHttpHelperprotected Stringprotected Stringprotected Stringprotected Stringprotected StringgetMessageValue(String json) A helper method that extracts the "message" property from the json string.protected <T> TgetValueFromJson(String json, String propName) A helper method that takes a json string and extracts the value of the specified property.protected MapjsonStringToMap(String json) A helper method that converts a json string into a map object.protected voidwait(int seconds) Pause executionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.duracloud.storage.provider.TaskRunner
getName, performTask
-
Constructor Details
-
AbstractSnapshotTaskRunner
-
-
Method Details
-
getBridgeAppHost
-
getBridgeAppPort
-
getBridgeAppUser
-
getBridgeAppPass
-
buildBridgeBaseURL
-
createRestHelper
-
getValueFromJson
A helper method that takes a json string and extracts the value of the specified property.- Type Parameters:
T- The type for the value expected to be returned.- Parameters:
json- the json stringpropName- the name of the property to extract- Returns:
- the value of the specified property
- Throws:
IOException
-
jsonStringToMap
A helper method that converts a json string into a map object.- Parameters:
json- the json string- Returns:
- a map representing the json string.
- Throws:
IOException
-
getMessageValue
A helper method that extracts the "message" property from the json string.- Parameters:
json- the json string- Returns:
- the value of the "message" field.
- Throws:
IOException
-
wait
protected void wait(int seconds) Pause execution- Parameters:
seconds- to wait
-