Package de.dlr.proseo.ingestor.rest
Klasse ProductManager
java.lang.Object
de.dlr.proseo.ingestor.rest.ProductManager
Service methods required to create, modify and delete products in the prosEO
database, and to query the database about such products
- Autor:
- Dr. Thomas Bassler
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) IngestorConfiguration
Ingestor configuration -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcountProducts
(String mission, String[] productClass, String mode, String fileClass, String quality, String startTimeFrom, String startTimeTo, String genTimeFrom, String genTimeTo, Long jobStepId) Get the number of products available, possibly filtered by mission, product class, production mode, file class, quality and time rangescreateProduct
(RestProduct product) Create a product from the given Json object (does NOT create associated product files!)void
Delete a product by IDdownloadProductById
(Long id, Long fromByte, Long toByte) Get the primary data file (or ZIP file, if available) for the product as data stream (optionally range-restricted), returns a redirection link to the Storage Manager of a random Processing FacilityfindEquivalentProduct
(RestProduct product) Find any product equivalent to the given product (i. e. fulfilling the Product::equals() conditions).getDownloadTokenById
(Long id, String fileName) Get a JSON Web Token for creating a download link to a Storage ManagergetProductById
(Long id) Find the product with the given IDgetProductByUuid
(String uuid) Find the product with the given universally unique product identifiergetProducts
(String mission, String[] productClass, String mode, String fileClass, String quality, String startTimeFrom, String startTimeTo, String genTimeFrom, String genTimeTo, Integer recordFrom, Integer recordTo, Long jobStepId, String[] orderBy) List of all products filtered by mission, product class, , production mode, file class, quality and time rangesmodifyProduct
(Long id, RestProduct product) Update the product with the given ID with the attribute values of the given Json object.
-
Felddetails
-
ingestorConfig
Ingestor configuration
-
-
Konstruktordetails
-
ProductManager
public ProductManager()
-
-
Methodendetails
-
deleteProductById
@Transactional(isolation=REPEATABLE_READ) public void deleteProductById(Long id) throws javax.persistence.EntityNotFoundException, IllegalStateException, SecurityException, RuntimeException Delete a product by ID- Parameter:
id
- the ID of the product to delete- Löst aus:
javax.persistence.EntityNotFoundException
- if the product to delete does not exist in the databaseIllegalStateException
- if the product to delete still as files at some Processing FacilitySecurityException
- if a cross-mission data access was attemptedRuntimeException
- if the deletion was not performed as expected
-
getProducts
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public List<RestProduct> getProducts(String mission, String[] productClass, String mode, String fileClass, String quality, String startTimeFrom, String startTimeTo, String genTimeFrom, String genTimeTo, Integer recordFrom, Integer recordTo, Long jobStepId, String[] orderBy) throws javax.persistence.NoResultException, SecurityException List of all products filtered by mission, product class, , production mode, file class, quality and time ranges- Parameter:
mission
- the mission code (will be set to logged in mission, if not given; otherwise must match logged in mission)productClass
- an array of product typesmode
- the processing modefileClass
- the file classquality
- the qualitystartTimeFrom
- earliest sensing start timestartTimeTo
- latest sensing start timegenTimeFrom
- earliest generation timegenTimeTo
- latest generation timerecordFrom
- first record of filtered and ordered result to returnrecordTo
- last record of filtered and ordered result to returnjobStepId
- get input products of job steporderBy
- an array of strings containing a column name and an optional sort direction (ASC/DESC), separated by white space- Gibt zurück:
- a list of products
- Löst aus:
javax.persistence.NoResultException
- if no products matching the given search criteria could be foundSecurityException
- if a cross-mission data access was attempted
-
countProducts
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public String countProducts(String mission, String[] productClass, String mode, String fileClass, String quality, String startTimeFrom, String startTimeTo, String genTimeFrom, String genTimeTo, Long jobStepId) throws SecurityException Get the number of products available, possibly filtered by mission, product class, production mode, file class, quality and time ranges- Parameter:
mission
- the mission code (will be set to logged in mission, if not given; otherwise must match logged in mission)productClass
- an array of product typesmode
- the processing modefileClass
- the file classquality
- the qualitystartTimeFrom
- earliest sensing start timestartTimeTo
- latest sensing start timegenTimeFrom
- earliest generation timegenTimeTo
- latest generation timejobStepId
- get input products of job step- Gibt zurück:
- the number of products found as string
- Löst aus:
SecurityException
- if a cross-mission data access was attempted
-
createProduct
@Transactional(isolation=REPEATABLE_READ) public RestProduct createProduct(RestProduct product) throws IllegalArgumentException, SecurityException Create a product from the given Json object (does NOT create associated product files!)- Parameter:
product
- the Json object to create the product from- Gibt zurück:
- a Json object corresponding to the product after persistence (with ID and version for all contained objects)
- Löst aus:
IllegalArgumentException
- if any of the input data was invalidSecurityException
- if a cross-mission data access was attempted
-
findEquivalentProduct
Find any product equivalent to the given product (i. e. fulfilling the Product::equals() conditions).- Parameter:
product
- the product example to search for- Gibt zurück:
- a product with the same characteristics or null, if no such product can be found
-
getProductById
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public RestProduct getProductById(Long id) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Find the product with the given ID- Parameter:
id
- the ID to look for- Gibt zurück:
- a Json object corresponding to the product found
- Löst aus:
IllegalArgumentException
- if no product ID was givenjavax.persistence.NoResultException
- if no product with the given ID existsSecurityException
- if a cross-mission data access was attempted
-
modifyProduct
@Transactional(isolation=REPEATABLE_READ) public RestProduct modifyProduct(Long id, RestProduct product) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, ConcurrentModificationException, SecurityException Update the product with the given ID with the attribute values of the given Json object. This method will NOT modify associated product files.- Parameter:
id
- the ID of the product to updateproduct
- a Json object containing the modified (and unmodified) attributes- Gibt zurück:
- a Json object corresponding to the product after modification (with ID and version for all contained objects)
- Löst aus:
javax.persistence.EntityNotFoundException
- if no product with the given ID existsIllegalArgumentException
- if any of the input data was invalidConcurrentModificationException
- if the product has been modified since retrieval by the clientSecurityException
- if a cross-mission data access was attempted
-
getProductByUuid
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public RestProduct getProductByUuid(String uuid) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Find the product with the given universally unique product identifier- Parameter:
uuid
- the UUID to look for- Gibt zurück:
- a Json object corresponding to the product found
- Löst aus:
IllegalArgumentException
- if no or an invalid product UUID was givenjavax.persistence.NoResultException
- if no product with the given UUID existsSecurityException
- if a cross-mission data access was attempted
-
downloadProductById
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public String downloadProductById(Long id, Long fromByte, Long toByte) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Get the primary data file (or ZIP file, if available) for the product as data stream (optionally range-restricted), returns a redirection link to the Storage Manager of a random Processing Facility- Parameter:
id
- the ID of the product to downloadfromByte
- the first byte of the data stream to download (optional, default is file start, i.e. byte 0)toByte
- the last byte of the data stream to download (optional, default is file end, i.e. file size - 1)- Gibt zurück:
- a redirect URL for the HTTP Location header
- Löst aus:
IllegalArgumentException
- if no product ID was givenjavax.persistence.NoResultException
- if no product with the given ID exists or if it does not have a data fileSecurityException
- if a cross-mission data access was attempted
-
getDownloadTokenById
@Transactional(isolation=REPEATABLE_READ) public String getDownloadTokenById(Long id, String fileName) throws IllegalArgumentException, javax.persistence.NoResultException, SecurityException Get a JSON Web Token for creating a download link to a Storage Manager- Parameter:
id
- the ID of the product to downloadfileName
- the name of the file to download (default primary data file or ZIP file, if available)- Gibt zurück:
- the signed JSON Web Token (JWS) as per RFC 7515 and RFC 7519
- Löst aus:
IllegalArgumentException
- if no product ID was givenjavax.persistence.NoResultException
- if no product with the given ID or no file with the given name existsSecurityException
- if a cross-mission data access was attempted
-