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

public abstract class AbstractSnapshotTaskRunner extends Object implements TaskRunner
  • Constructor Details

    • AbstractSnapshotTaskRunner

      public AbstractSnapshotTaskRunner(String bridgeAppHost, String bridgeAppPort, String bridgeAppUser, String bridgeAppPass)
  • Method Details

    • 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 string
      propName - 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
    • wait

      protected void wait(int seconds)
      Pause execution
      Parameters:
      seconds - to wait