Package de.dlr.proseo.basewrap
Klasse BaseWrapper
java.lang.Object
de.dlr.proseo.basewrap.BaseWrapper
prosEO Base Processor Wrapper - for processors conforming to ESA's "Generic
IPF Interface Specification" (MMFI-GSEG-EOPG-TN-07-0003, V.1.8)
- Autor:
- Hubert Asamer, Dr. Thomas Bassler *
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungprotected static enum
Enumeration with valid environment variable names (available for wrapper subclasses).static class
Class for raising wrapper-generated runtime exceptions -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected String
Auto-created path/filename of JobOrderFile within container (according to Generic IPF Interface Specifications)protected static final String
Directory prefix of produced output data (available for wrapper subclasses)protected String
Variables to control max cycles and wait time to check file size of fetched input filesprotected String
protected String
HTTP endpoint for Ingestor callback (available for wrapper subclasses)protected String
Path to Job Order File, format according to file system typeprotected String
Mount point of shared local file system (available for wrapper subclasses)protected String
Name of the Processing Facility this wrapper is running in (available for wrapper subclasses)protected String
Shell command to run the processor (with path to Job Order File as sole parameter)protected String
Password for prosEO Control Instance (available for wrapper subclasses)protected String
User name for prosEO Control Instance (available for wrapper subclasses)protected static final int
Order ID for job order file (according to Generic IPF Interface Specifications, sec. 4.2.2); limited to 31 bits (int), because some IPFs cannot handle larger order IDs (apparently they take the word "integer" literally)protected String
protected static final long
Veraltet.protected String
Directory for temporary/output files created by this wrapper -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected IngestorProduct
createIngestorProduct
(Path outputFilePath) Create a REST interface product for product ingestion from the given output file path; sets attributes mountPoint, filePath, productFileName, fileSize, checksum and checksumTimeprotected String
extractProseoMessage
(HttpResponseInfo responseInfo) Extracts the prosEO-compliant message from the "Warning" header, if anyprotected void
ingestProduct
(IngestorProduct product) Ingest the given product into the prosEO metadata database and into the backend storagestatic void
Main routine: Run BaseWrapperprotected void
postFetchInputHook
(JobOrder jobOrderDoc) Hook for mission-specific modifications to the job order document after fetching input data Intended for override by mission-specific wrapper classes, NO-OP in BaseWrapper.protected void
postProcessingHook
(JobOrder joWork) Hook for mission-specific modifications to the final job order document after execution of the processor (before push of results).protected void
preFetchInputHook
(JobOrder jobOrderDoc) Hook for mission-specific modifications to the job order document before fetching input data Intended for override by mission-specific wrapper classes, NO-OP in BaseWrapper.protected RestProduct
retrieveProductMetadata
(InputOutput output) Get the product metadata for a given output elementfinal int
run()
Perform processing: check parameters, parse JobOrder file, fetch input files, process, push output filesprotected void
updateProductMetadata
(InputOutput output, RestProduct productMetadata) Update the metadata for the product denoted in the given output element
-
Felddetails
-
JOB_ORDER_ID
protected static final int JOB_ORDER_IDOrder ID for job order file (according to Generic IPF Interface Specifications, sec. 4.2.2); limited to 31 bits (int), because some IPFs cannot handle larger order IDs (apparently they take the word "integer" literally) -
WRAPPER_TIMESTAMP
Veraltet.Current timestamp used for output-file prefixes -
CONTAINER_JOF_PATH
Auto-created path/filename of JobOrderFile within container (according to Generic IPF Interface Specifications) -
REL_CONTAINER_JOF_PATH
-
CONTAINER_OUTPUTS_PATH_PREFIX
Directory prefix of produced output data (available for wrapper subclasses) -
ENV_JOBORDER_VERSION
Path to Job Order File, format according to file system type -
ENV_LOCAL_FS_MOUNT
Mount point of shared local file system (available for wrapper subclasses) -
wrapperDataDirectory
Directory for temporary/output files created by this wrapper -
ENV_PROSEO_USER
User name for prosEO Control Instance (available for wrapper subclasses) -
ENV_PROSEO_PW
Password for prosEO Control Instance (available for wrapper subclasses) -
ENV_FILECHECK_MAX_CYCLES
Variables to control max cycles and wait time to check file size of fetched input files -
ENV_FILECHECK_WAIT_TIME
-
ENV_PROCESSING_FACILITY_NAME
Name of the Processing Facility this wrapper is running in (available for wrapper subclasses) -
ENV_INGESTOR_ENDPOINT
HTTP endpoint for Ingestor callback (available for wrapper subclasses) -
ENV_PROCESSOR_SHELL_COMMAND
Shell command to run the processor (with path to Job Order File as sole parameter)
-
-
Konstruktordetails
-
BaseWrapper
public BaseWrapper()
-
-
Methodendetails
-
extractProseoMessage
Extracts the prosEO-compliant message from the "Warning" header, if any- Parameter:
responseInfo
- the response info object received from RestOps::restApiCall- Gibt zurück:
- the prosEO-compliant message, if there is one, or the unchanged warning header, if there is one, or null otherwise
-
retrieveProductMetadata
protected RestProduct retrieveProductMetadata(InputOutput output) throws BaseWrapper.WrapperException Get the product metadata for a given output element- Parameter:
output
- the output element from the Job Order file to get the metadata for- Gibt zurück:
- a REST interface product
- Löst aus:
BaseWrapper.WrapperException
- if an error occurs in the communication to the Ingestor, or the output element does not contain a product ID, or the product cannot be found
-
updateProductMetadata
protected void updateProductMetadata(InputOutput output, RestProduct productMetadata) throws BaseWrapper.WrapperException Update the metadata for the product denoted in the given output element- Parameter:
output
- the output element from the Job Order file to update the metadata forproductMetadata
- a REST interface product specifying the updated metadata- Löst aus:
BaseWrapper.WrapperException
- if an error occurs in the communication to the Ingestor, or the output element does not contain a product ID
-
createIngestorProduct
Create a REST interface product for product ingestion from the given output file path; sets attributes mountPoint, filePath, productFileName, fileSize, checksum and checksumTime- Parameter:
outputFilePath
- path to the output file- Gibt zurück:
- a REST interface product for ingestion with ingestion information set
-
ingestProduct
Ingest the given product into the prosEO metadata database and into the backend storage- Parameter:
product
- a REST interface product for product ingestion- Löst aus:
BaseWrapper.WrapperException
- if an error occurs in the communication to the Ingestor
-
preFetchInputHook
Hook for mission-specific modifications to the job order document before fetching input data Intended for override by mission-specific wrapper classes, NO-OP in BaseWrapper.- Parameter:
jobOrderDoc
- the job order document to modify- Löst aus:
BaseWrapper.WrapperException
- if some error occurred which forces wrapper termination
-
postFetchInputHook
Hook for mission-specific modifications to the job order document after fetching input data Intended for override by mission-specific wrapper classes, NO-OP in BaseWrapper.- Parameter:
jobOrderDoc
- the job order document to modify- Löst aus:
BaseWrapper.WrapperException
- if some error occurred which forces wrapper termination
-
postProcessingHook
Hook for mission-specific modifications to the final job order document after execution of the processor (before push of results). Intended for- Adding additional output files to the output list as desired (e. g. log files, job order file)
- Packaging multiple files into a single ZIP file for delivery via the PRIP if desired (add an output file with File_Name_Type "Archive", using Java constant InputOutput.FN_TYPE_ARCHIVE)
- Parameter:
joWork
- the job order document to modify- Löst aus:
BaseWrapper.WrapperException
- if some error occurred which forces wrapper termination
-
run
public final int run()Perform processing: check parameters, parse JobOrder file, fetch input files, process, push output files- Gibt zurück:
- the program exit code (OK or FAILURE)
-
main
Main routine: Run BaseWrapper- Parameter:
args
- first string argument is class name of actual Wrapper class (must be a subclass of BaseWrapper or BaseWrapper itself; default is to use BaseWrapper)
-