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 - ÜbersichtVerschachtelte KlassenModifizierer und TypKlasseBeschreibungprotected static enumEnumeration with valid environment variable names (available for wrapper subclasses).static classClass for raising wrapper-generated runtime exceptions
- 
FeldübersichtFelderModifizierer und TypFeldBeschreibungprotected StringAuto-created path/filename of JobOrderFile within container (according to Generic IPF Interface Specifications)protected static final StringDirectory prefix of produced output data (available for wrapper subclasses)protected StringVariables to control max cycles and wait time to check file size of fetched input filesprotected Stringprotected StringHTTP endpoint for Ingestor callback (available for wrapper subclasses)protected StringPath to Job Order File, format according to file system typeprotected StringMount point of shared local file system (available for wrapper subclasses)protected StringName of the Processing Facility this wrapper is running in (available for wrapper subclasses)protected StringShell command to run the processor (with path to Job Order File as sole parameter)protected StringPassword for prosEO Control Instance (available for wrapper subclasses)protected StringUser name for prosEO Control Instance (available for wrapper subclasses)protected static final intOrder 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 Stringprotected static final longVeraltet.protected StringDirectory for temporary/output files created by this wrapper
- 
KonstruktorübersichtKonstruktoren
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungprotected IngestorProductcreateIngestorProduct(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 StringextractProseoMessage(HttpResponseInfo responseInfo) Extracts the prosEO-compliant message from the "Warning" header, if anyprotected voidingestProduct(IngestorProduct product) Ingest the given product into the prosEO metadata database and into the backend storagestatic voidMain routine: Run BaseWrapperprotected voidpostFetchInputHook(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 voidpostProcessingHook(JobOrder joWork) Hook for mission-specific modifications to the final job order document after execution of the processor (before push of results).protected voidpreFetchInputHook(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 RestProductretrieveProductMetadata(InputOutput output) Get the product metadata for a given output elementfinal intrun()Perform processing: check parameters, parse JobOrder file, fetch input files, process, push output filesprotected voidupdateProductMetadata(InputOutput output, RestProduct productMetadata) Update the metadata for the product denoted in the given output element
- 
Felddetails- 
JOB_ORDER_IDprotected 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_TIMESTAMPVeraltet.Current timestamp used for output-file prefixes
- 
CONTAINER_JOF_PATHAuto-created path/filename of JobOrderFile within container (according to Generic IPF Interface Specifications)
- 
REL_CONTAINER_JOF_PATH
- 
CONTAINER_OUTPUTS_PATH_PREFIXDirectory prefix of produced output data (available for wrapper subclasses)
- 
ENV_JOBORDER_VERSIONPath to Job Order File, format according to file system type
- 
ENV_LOCAL_FS_MOUNTMount point of shared local file system (available for wrapper subclasses)
- 
wrapperDataDirectoryDirectory for temporary/output files created by this wrapper
- 
ENV_PROSEO_USERUser name for prosEO Control Instance (available for wrapper subclasses)
- 
ENV_PROSEO_PWPassword for prosEO Control Instance (available for wrapper subclasses)
- 
ENV_FILECHECK_MAX_CYCLESVariables to control max cycles and wait time to check file size of fetched input files
- 
ENV_FILECHECK_WAIT_TIME
- 
ENV_PROCESSING_FACILITY_NAMEName of the Processing Facility this wrapper is running in (available for wrapper subclasses)
- 
ENV_INGESTOR_ENDPOINTHTTP endpoint for Ingestor callback (available for wrapper subclasses)
- 
ENV_PROCESSOR_SHELL_COMMANDShell command to run the processor (with path to Job Order File as sole parameter)
 
- 
- 
Konstruktordetails- 
BaseWrapperpublic BaseWrapper()
 
- 
- 
Methodendetails- 
extractProseoMessageExtracts 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
 
- 
retrieveProductMetadataprotected 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
 
- 
updateProductMetadataprotected 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 for
- productMetadata- 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
 
- 
createIngestorProductCreate 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
 
- 
ingestProductIngest 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
 
- 
preFetchInputHookHook 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
 
- 
postFetchInputHookHook 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
 
- 
postProcessingHookHook 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
 
- 
runpublic 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)
 
- 
mainMain 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)
 
 
-