Klasse BaseWrapper

java.lang.Object
de.dlr.proseo.basewrap.BaseWrapper

public class BaseWrapper extends Object
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 Klassen
    Modifizierer und Typ
    Klasse
    Beschreibung
    protected static enum 
    Enumeration with valid environment variable names (available for wrapper subclasses).
    static class 
    Class for raising wrapper-generated runtime exceptions
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    protected 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 files
    protected String
     
    protected String
    HTTP endpoint for Ingestor callback (available for wrapper subclasses)
    protected String
    Path to Job Order File, format according to file system type
    protected 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
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected 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 checksumTime
    protected String
    Extracts the prosEO-compliant message from the "Warning" header, if any
    protected void
    Ingest the given product into the prosEO metadata database and into the backend storage
    static void
    main(String[] args)
    Main routine: Run BaseWrapper
    protected void
    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
    Hook for mission-specific modifications to the final job order document after execution of the processor (before push of results).
    protected void
    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
    Get the product metadata for a given output element
    final int
    run()
    Perform processing: check parameters, parse JobOrder file, fetch input files, process, push output files
    protected void
    updateProductMetadata(InputOutput output, RestProduct productMetadata)
    Update the metadata for the product denoted in the given output element

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • JOB_ORDER_ID

      protected static final int JOB_ORDER_ID
      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)
    • WRAPPER_TIMESTAMP

      @Deprecated protected static final long WRAPPER_TIMESTAMP
      Veraltet.
      Current timestamp used for output-file prefixes
    • CONTAINER_JOF_PATH

      protected String CONTAINER_JOF_PATH
      Auto-created path/filename of JobOrderFile within container (according to Generic IPF Interface Specifications)
    • REL_CONTAINER_JOF_PATH

      protected String REL_CONTAINER_JOF_PATH
    • CONTAINER_OUTPUTS_PATH_PREFIX

      protected static final String CONTAINER_OUTPUTS_PATH_PREFIX
      Directory prefix of produced output data (available for wrapper subclasses)
    • ENV_JOBORDER_VERSION

      protected String ENV_JOBORDER_VERSION
      Path to Job Order File, format according to file system type
    • ENV_LOCAL_FS_MOUNT

      protected String ENV_LOCAL_FS_MOUNT
      Mount point of shared local file system (available for wrapper subclasses)
    • wrapperDataDirectory

      protected String wrapperDataDirectory
      Directory for temporary/output files created by this wrapper
    • ENV_PROSEO_USER

      protected String ENV_PROSEO_USER
      User name for prosEO Control Instance (available for wrapper subclasses)
    • ENV_PROSEO_PW

      protected String ENV_PROSEO_PW
      Password for prosEO Control Instance (available for wrapper subclasses)
    • ENV_FILECHECK_MAX_CYCLES

      protected String ENV_FILECHECK_MAX_CYCLES
      Variables to control max cycles and wait time to check file size of fetched input files
    • ENV_FILECHECK_WAIT_TIME

      protected String ENV_FILECHECK_WAIT_TIME
    • ENV_PROCESSING_FACILITY_NAME

      protected String ENV_PROCESSING_FACILITY_NAME
      Name of the Processing Facility this wrapper is running in (available for wrapper subclasses)
    • ENV_INGESTOR_ENDPOINT

      protected String ENV_INGESTOR_ENDPOINT
      HTTP endpoint for Ingestor callback (available for wrapper subclasses)
    • ENV_PROCESSOR_SHELL_COMMAND

      protected String 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

      protected String extractProseoMessage(HttpResponseInfo responseInfo)
      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 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
    • createIngestorProduct

      protected 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 checksumTime
      Parameter:
      outputFilePath - path to the output file
      Gibt zurück:
      a REST interface product for ingestion with ingestion information set
    • ingestProduct

      protected void ingestProduct(IngestorProduct product)
      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

      protected void preFetchInputHook(JobOrder jobOrderDoc) throws BaseWrapper.WrapperException
      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

      protected void postFetchInputHook(JobOrder jobOrderDoc) throws BaseWrapper.WrapperException
      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

      protected void postProcessingHook(JobOrder joWork) throws BaseWrapper.WrapperException
      Hook for mission-specific modifications to the final job order document after execution of the processor (before push of results). Intended for
      1. Adding additional output files to the output list as desired (e. g. log files, job order file)
      2. 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)
      Note: The first (non-archive) output file is taken as the (main) product file, subsequent files are interpreted as auxiliary files. Intended for override by mission-specific wrapper classes, NO-OP in BaseWrapper.
      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

      public static void main(String[] args)
      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)