Class AbstractSnapshotTaskRunner
- java.lang.Object
-
- org.duracloud.snapshottask.snapshot.AbstractSnapshotTaskRunner
-
- All Implemented Interfaces:
TaskRunner
- Direct Known Subclasses:
GetRestoreTaskRunner,GetSnapshotContentsTaskRunner,GetSnapshotHistoryTaskRunner,GetSnapshotsTaskRunner,GetSnapshotTaskRunner,RequestRestoreSnapshotTaskRunner,RestartSnapshotTaskRunner,RestoreSnapshotTaskRunner,SpaceModifyingSnapshotTaskRunner
public abstract class AbstractSnapshotTaskRunner extends Object implements TaskRunner
-
-
Constructor Summary
Constructors Constructor Description AbstractSnapshotTaskRunner(String bridgeAppHost, String bridgeAppPort, String bridgeAppUser, String bridgeAppPass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildBridgeBaseURL()protected RestHttpHelpercreateRestHelper()protected StringgetBridgeAppHost()protected StringgetBridgeAppPass()protected StringgetBridgeAppPort()protected StringgetBridgeAppUser()protected 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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.duracloud.storage.provider.TaskRunner
getName, performTask
-
-
-
-
Method Detail
-
getBridgeAppHost
protected String getBridgeAppHost()
-
getBridgeAppPort
protected String getBridgeAppPort()
-
getBridgeAppUser
protected String getBridgeAppUser()
-
getBridgeAppPass
protected String getBridgeAppPass()
-
buildBridgeBaseURL
protected String buildBridgeBaseURL()
-
createRestHelper
protected RestHttpHelper createRestHelper()
-
getValueFromJson
protected <T> T getValueFromJson(String json, String propName) throws IOException
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
protected Map jsonStringToMap(String json) throws IOException
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
protected String getMessageValue(String json) throws IOException
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
-
-