Class ProductControllerImpl

java.lang.Object
de.dlr.proseo.storagemgr.rest.ProductControllerImpl
All Implemented Interfaces:
ProductController

@Component public class ProductControllerImpl extends Object implements ProductController
Spring MVC controller for the prosEO Storage Manager; implements the services required to manage any object storage, e. g. a storage based on the AWS S3 API
Author:
Dr. Thomas Bassler, Denys Chaykovskiy, Hubert Asamer
  • Constructor Details

    • ProductControllerImpl

      public ProductControllerImpl()
  • Method Details

    • createRestProductFS

      public org.springframework.http.ResponseEntity<RestProductFS> createRestProductFS(RestProductFS restProductFS)
      Copy a file from "ingest" file system to storage manager controlled prosEO cache. Source and target are defined in the restProductFS structure. Upload is restricted to the default backend storage path/bucket.
      Specified by:
      createRestProductFS in interface ProductController
      Parameters:
      restProductFS - the ingest file information
      Returns:
      a response entity containing HTTP status CREATED and the ingest file information updated with the file paths after ingestion on success, or HTTP status INTERNAL_SERVER_ERROR and an error message
    • getProductFiles

      public org.springframework.http.ResponseEntity<List<String>> getProductFiles(String storageType, String prefix)
      List the file/object contents of the default repository.
      Specified by:
      getProductFiles in interface ProductController
      Parameters:
      storageType - S3, POSIX or null
      prefix - Path information
      Returns:
      a response entity containing HTTP status OK or PARTIAL_CONTENT and list of file (object) paths on success, or HTTP status INTERNAL_SERVER_ERROR and an error message
    • getObject

      public org.springframework.http.ResponseEntity<?> getObject(String encodedPathInfo, String token, Long fromByte, Long toByte)
      Retrieve the byte stream for download of a file object in repository.
      Specified by:
      getObject in interface ProductController
      Parameters:
      token - a JSON Web Token authenticating the download (obtained from Ingestor)
      fromByte - The first byte of the data stream to download (default is file start, i.e. byte 0)
      toByte - The last byte of the data stream to download (default is file end, i.e. file size - 1)
      pathInfo - the file path as S3/ALLUXIO/POSIX string for download
      Returns:
      a response entity containing HTTP status OK or PARTIAL_CONTENT and the byte stream on success, or HTTP status NOT_FOUND and an error message, or HTTP status INTERNAL_SERVER_ERROR and an error message
    • deleteProductByPathInfo

      public org.springframework.http.ResponseEntity<RestProductFS> deleteProductByPathInfo(String pathInfo)
      Delete object(s) from the default storage (deleting from other storages is not supported, as they are not managed by the called Storage Manager instance)
      Specified by:
      deleteProductByPathInfo in interface ProductController
      Parameters:
      pathInfo - path to the object or directory
      Returns:
      a response entity containing HTTP status OK and the full metadata of the deleted object, or HTTP status NOT_FOUND and an error message, or HTTP status INTERNAL_SERVER_ERROR and an error message