Package de.dlr.proseo.storagemgr.rest
Class ProductControllerImpl
java.lang.Object
de.dlr.proseo.storagemgr.rest.ProductControllerImpl
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<RestProductFS> createRestProductFS(RestProductFS restProductFS) Copy a file from "ingest" file system to storage manager controlled prosEO cache.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)org.springframework.http.ResponseEntity<?> Retrieve the byte stream for download of a file object in repository.getProductFiles(String storageType, String prefix) List the file/object contents of the default repository.
-
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:
createRestProductFSin interfaceProductController- 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:
getProductFilesin interfaceProductController- Parameters:
storageType- S3, POSIX or nullprefix- 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:
getObjectin interfaceProductController- 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:
deleteProductByPathInfoin interfaceProductController- 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
-