Package de.dlr.proseo.ingestor.rest
Klasse ProductIngestor
java.lang.Object
de.dlr.proseo.ingestor.rest.ProductIngestor
Services required to ingest products from pickup points into the prosEO
database, and to create, read, updated and delete product file metadata
- Autor:
- Dr. Thomas Bassler
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) IngestorConfiguration
Ingestor configuration(Package privat) ProductManager
Product Manager(Package privat) org.springframework.boot.web.client.RestTemplateBuilder
REST template builder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
deleteProductFile
(Long productId, ProcessingFacility facility, Boolean eraseFiles) Delete a product file for a product from a given processing facility (metadata and actual data file(s))void
Delete all product (files) with eviction time older than t.getFacilityByName
(String facilityName) /** Find a processing facility by name (transaction wrapper for repository method)getProductFile
(Long productId, ProcessingFacility facility) Get the product file metadata for a product at a given processing facilityingestProductFile
(Long productId, ProcessingFacility facility, RestProductFile productFile, String user, String password) Create the metadata of a new product file for a product at a given processing facility (it is assumed that the files themselves are already pushed to the Storage Manager)ingestProducts
(ProcessingFacility facility, boolean copyFiles, List<IngestorProduct> ingestorProducts, String user, String password) Ingest all given products into the storage manager of the given processing facility.modifyProductFile
(Long productId, ProcessingFacility facility, RestProductFile productFile) Update the product file metadata for a product at a given processing facility
-
Felddetails
-
rtb
@Autowired org.springframework.boot.web.client.RestTemplateBuilder rtbREST template builder -
ingestorConfig
Ingestor configuration -
productManager
Product Manager
-
-
Konstruktordetails
-
ProductIngestor
public ProductIngestor()
-
-
Methodendetails
-
getFacilityByName
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public ProcessingFacility getFacilityByName(String facilityName) /** Find a processing facility by name (transaction wrapper for repository method)- Parameter:
facilityName
- the name of the facility to retrieve- Gibt zurück:
- the processing facility found or null, if no such processing facility exists
-
ingestProducts
public List<RestProduct> ingestProducts(ProcessingFacility facility, boolean copyFiles, List<IngestorProduct> ingestorProducts, String user, String password) throws IllegalArgumentException, javax.ws.rs.ProcessingException, SecurityException Ingest all given products into the storage manager of the given processing facility. If the ID of a product to ingest is null or 0 (zero), then the product will be created, otherwise a matching product will be looked up and updated NOTE: Datatabase transactions are programmatically, therefore no '@Transactional' annotation here.- Parameter:
facility
- the processing facility to ingest products tocopyFiles
- indicates, whether to copy the files to a different storage area (default "true"; only applicable if source and target storage type are the same)ingestorProducts
- a list of product descriptions with product file locationsuser
- the username to pass on to the Production Plannerpassword
- the password to pass on to the Production Planner- Gibt zurück:
- a Json representation of the product updated and/or created including their product files
- Löst aus:
IllegalArgumentException
- if the product ingestion failed (typically due to an error in the Json input)javax.ws.rs.ProcessingException
- if the communication with the Storage Manager failsSecurityException
- if a cross-mission data access was attempted
-
getProductFile
@Transactional(isolation=REPEATABLE_READ, readOnly=true) public RestProductFile getProductFile(Long productId, ProcessingFacility facility) throws javax.persistence.NoResultException, SecurityException Get the product file metadata for a product at a given processing facility- Parameter:
productId
- the ID of the product to retrievefacility
- the processing facility to retrieve the product file metadata for- Gibt zurück:
- the Json representation of the product file metadata
- Löst aus:
javax.persistence.NoResultException
- if no product file for the given product ID exists at the given processing facilitySecurityException
- if a cross-mission data access was attempted
-
ingestProductFile
@Transactional(isolation=REPEATABLE_READ) public RestProductFile ingestProductFile(Long productId, ProcessingFacility facility, RestProductFile productFile, String user, String password) throws IllegalArgumentException, SecurityException Create the metadata of a new product file for a product at a given processing facility (it is assumed that the files themselves are already pushed to the Storage Manager)- Parameter:
productId
- the ID of the product to retrievefacility
- the processing facility, in which the files have been storedproductFile
- the REST product file to storeuser
- the username to pass on to the Production Plannerpassword
- the password to pass on to the Production Planner- Gibt zurück:
- the updated REST product file (with ID and version)
- Löst aus:
IllegalArgumentException
- if the product cannot be found, or if the data for the product file is invalid (also, if a product file for the given processing facility already exists)SecurityException
- if a cross-mission data access was attempted
-
deleteProductFile
@Transactional(isolation=REPEATABLE_READ) public void deleteProductFile(Long productId, ProcessingFacility facility, Boolean eraseFiles) throws javax.persistence.EntityNotFoundException, RuntimeException, javax.ws.rs.ProcessingException, IllegalArgumentException, SecurityException Delete a product file for a product from a given processing facility (metadata and actual data file(s))- Parameter:
productId
- the ID of the product to retrievefacility
- the processing facility, from which the files shall be deletederaseFiles
- erase the data file(s) from the storage area (default "true")- Löst aus:
javax.persistence.EntityNotFoundException
- if the product or the product file could not be foundRuntimeException
- if the deletion failedjavax.ws.rs.ProcessingException
- if the communication with the Storage Manager failsIllegalArgumentException
- if the product currently satisfies a product query for the given processing facilitySecurityException
- if a cross-mission data access was attempted
-
deleteProductFilesOlderThan
Delete all product (files) with eviction time older than t.- Parameter:
t
- The Instant for eviction time
-
modifyProductFile
@Transactional(isolation=REPEATABLE_READ) public RestProductFile modifyProductFile(Long productId, ProcessingFacility facility, RestProductFile productFile) throws javax.persistence.EntityNotFoundException, IllegalArgumentException, ConcurrentModificationException, SecurityException Update the product file metadata for a product at a given processing facility- Parameter:
productId
- the ID of the product to retrievefacility
- the processing facility, in which the files have been storedproductFile
- the REST product file to store- Gibt zurück:
- the updated REST product file (with ID and version)
- Löst aus:
IllegalArgumentException
- if the product cannot be found, or if the data for the product file is invalid (also, if a product file for the given processing facility already exists)ConcurrentModificationException
- if the product file was modified since its retrieval by the clientSecurityException
- if a cross-mission data access was attemptedjavax.persistence.EntityNotFoundException
-