Class NodeService

java.lang.Object
org.cdlib.mrt.s3.service.NodeService

public class NodeService extends Object
Interface for Cloud Store
Author:
dloy
  • Field Details

  • Constructor Details

    • NodeService

      public NodeService(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
    • NodeService

      public NodeService(NodeIO.AccessNode cloudNode, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
  • Method Details

    • getNodeServiceConfig

      public static NodeService getNodeServiceConfig(String config, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
    • getNodeService

      public static NodeService getNodeService(String nodeName, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
    • getNodeService

      public static NodeService getNodeService(NodeIO nodes, long node, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
    • getServiceProperties

      public Properties getServiceProperties()
    • putObject

      public CloudResponse putObject(String key, File inputFile) throws org.cdlib.mrt.utility.TException
      Upload cloud object
      Parameters:
      key - entry key to be added
      inputFile - file to be uploaded
      Returns:
      information about upload
      Throws:
      org.cdlib.mrt.utility.TException
    • putObject

      public CloudResponse putObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, File inputFile) throws org.cdlib.mrt.utility.TException
      Upload cloud object
      Parameters:
      objectID - Object identifier
      versionID - Version identifier
      fileID - File/component identifier that may contain a directory element
      inputFile - file to be uploaded
      Returns:
      information about upload
      Throws:
      org.cdlib.mrt.utility.TException
    • putManifest

      public CloudResponse putManifest(org.cdlib.mrt.core.Identifier objectID, File inputFile) throws org.cdlib.mrt.utility.TException
      Upload cloud manifest
      Parameters:
      objectID - Object identifier
      inputFile - manifest file to be uploaded
      Returns:
      information about upload
      Throws:
      org.cdlib.mrt.utility.TException
    • deleteObject

      public CloudResponse deleteObject(String key) throws org.cdlib.mrt.utility.TException
      Delete object
      Parameters:
      key - cloud object key
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • deleteObject

      public CloudResponse deleteObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID) throws org.cdlib.mrt.utility.TException
      Delete cloud object
      Parameters:
      objectID - Object identifier
      versionID - Version identifier
      fileID - File/component identifier that may contain a directory element
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • deleteManifest

      public CloudResponse deleteManifest(org.cdlib.mrt.core.Identifier objectID) throws org.cdlib.mrt.utility.TException
      Delete cloud manifest
      Parameters:
      objectID - Object identifier
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • getObject

      public InputStream getObject(org.cdlib.mrt.core.Identifier objectID, int versionID, String fileID, CloudResponse response) throws org.cdlib.mrt.utility.TException
      Retrieve cloud Object
      Parameters:
      objectID - Object identifier
      versionID - Version identifier
      fileID - File/component identifier that may contain a directory element
      response - input stream of retrieved object
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • getObject

      public InputStream getObject(String key, CloudResponse response) throws org.cdlib.mrt.utility.TException
      Retrieve cloud object
      Parameters:
      key - cloud object key for object to be returned
      response -
      Returns:
      input stream of retrieved object
      Throws:
      org.cdlib.mrt.utility.TException
    • getObject

      public void getObject(String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException
      Retrieve content into a file
      Parameters:
      key - cloud object key for object to be returned
      outFile - file to receive content
      response -
      Throws:
      org.cdlib.mrt.utility.TException
    • restoreObject

      public void restoreObject(String key, File outFile, CloudResponse response) throws org.cdlib.mrt.utility.TException
      Retrieve nearline content into a file
      Parameters:
      key - cloud object key for object to be returned
      outFile - file to receive content
      response -
      Throws:
      org.cdlib.mrt.utility.TException
    • getObjectMeta

      public Properties getObjectMeta(String key) throws org.cdlib.mrt.utility.TException
      Retrieve metadata for file
      Parameters:
      bucketName - s3 bucket - rackspace container
      fileKey - cloud object key for object to be returned
      Returns:
      exists: named properties; does not exist: null
      Throws:
      org.cdlib.mrt.utility.TException
    • getPreSigned

      public CloudResponse getPreSigned(long expirationMinutes, String key, String contentType, String contentDisp) throws org.cdlib.mrt.utility.TException
      Throws:
      org.cdlib.mrt.utility.TException
    • getManifest

      public InputStream getManifest(org.cdlib.mrt.core.Identifier objectID, CloudResponse response) throws org.cdlib.mrt.utility.TException
      Retrieve cloud manifest
      Parameters:
      objectID - Object identifier
      response -
      Returns:
      input stream of retrieved object
      Throws:
      org.cdlib.mrt.utility.TException
    • getManifest

      public InputStream getManifest(org.cdlib.mrt.core.Identifier objectID) throws org.cdlib.mrt.utility.TException
      Retrieve cloud manifest
      Parameters:
      bucketName - s3 bucket - rackspace container
      objectID - Object identifier
      Returns:
      input stream of retrieved manifest
      Throws:
      org.cdlib.mrt.utility.TException
    • getState

      public StateHandler.RetState getState() throws org.cdlib.mrt.utility.TException
      Run mini-regression
      Returns:
      completion state
      Throws:
      org.cdlib.mrt.utility.TException
    • getObjectList

      public CloudResponse getObjectList(String key) throws org.cdlib.mrt.utility.TException
      Return content that matches for the length of the key
      Parameters:
      key - prefix of content to be returned
      Returns:
      CloudResponse with list of matching entries
      Throws:
      org.cdlib.mrt.utility.TException
    • getObjectList

      public CloudResponse getObjectList(String key, int limit) throws org.cdlib.mrt.utility.TException
      Return a set number of entry metadata based on start key
      Parameters:
      key - content key of the first output
      limit - number of returned entries
      Returns:
      CloudResponse with list of sequential entries
      Throws:
      org.cdlib.mrt.utility.TException
    • validateMd5

      public CloudResponse validateMd5(String key, String inMd5) throws org.cdlib.mrt.utility.TException
      Validate that the md5 digest matches cloud object digest
      Parameters:
      key - cloud object key
      inMd5 - md5 digest value
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • validateDigest

      public CloudResponse validateDigest(String key, org.cdlib.mrt.core.MessageDigest digest, long length) throws org.cdlib.mrt.utility.TException
      Generic validation of stored content
      Parameters:
      key - cloud key
      digest - expected Digest and Digest Type
      length - expected file length
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • isAlive

      public Boolean isAlive() throws org.cdlib.mrt.utility.TException
      is service there - true=yes, false=no
      Returns:
      Throws:
      org.cdlib.mrt.utility.TException
    • isAlphaNumericKey

      public boolean isAlphaNumericKey()
      Because of earlier SDSC bug only alpha-numerics could be used in a key. true=alpha-numeric key, false=ASCII (current default)
      Returns:
    • getNodeName

      public String getNodeName()
    • setNodeName

      public void setNodeName(String nodeName)
    • getBucket

      public String getBucket()
    • getNode

      public long getNode()
    • getCloudService

      public CloudStoreInf getCloudService()
    • getServiceType

      public String getServiceType()
    • getLogger

      public org.cdlib.mrt.utility.LoggerInf getLogger()