Class InputWedge

All Implemented Interfaces:
Bootstrappable, Configurable, FileListenerInterface, Runnable

public class InputWedge extends ProductBuilder implements Runnable, Bootstrappable, FileListenerInterface
Read messages from files or a poll directory, and push products into PDL. The input messages are converted to Quakeml using the FileToQuakemlConverter interface, then sent as Quakeml based products. Much of the configuration can be supplied using either a configuration file, or command line arguments.
  • Field Details

    • PARSER_CLASS_PROPERTY

      public static final String PARSER_CLASS_PROPERTY
      Property for parser class
      See Also:
    • DEFAULT_PARSER_CLASS

      public static final String DEFAULT_PARSER_CLASS
      Default parser class
      See Also:
    • VALIDATE_PROPERTY

      public static final String VALIDATE_PROPERTY
      Property for validate
      See Also:
    • DEFAULT_VALIDATE

      public static final String DEFAULT_VALIDATE
      Default status of validate
      See Also:
    • SEND_ORIGIN_WHEN_PHASES_EXIST_PROPERTY

      public static final String SEND_ORIGIN_WHEN_PHASES_EXIST_PROPERTY
      Property for sendOriginWhenPhasesExist
      See Also:
    • DEFAULT_SEND_ORIGIN_WHEN_PHASES_EXIST

      public static final String DEFAULT_SEND_ORIGIN_WHEN_PHASES_EXIST
      Default status of sendOrigin...
      See Also:
    • SEND_MECHANISM_WHEN_PHASES_EXIST_PROPERTY

      public static final String SEND_MECHANISM_WHEN_PHASES_EXIST_PROPERTY
      Property for sendMechanismWhenPhasesExist
      See Also:
    • DEFAULT_SEND_MECHANISM_WHEN_PHASES_EXIST

      public static final String DEFAULT_SEND_MECHANISM_WHEN_PHASES_EXIST
      Default status of sendMechanism...
      See Also:
    • CREATE_INTERNAL_PRODUCTS_PROPERTY

      public static final String CREATE_INTERNAL_PRODUCTS_PROPERTY
      Whether created products should be converted to internal types.
      See Also:
    • DEFAULT_CREATE_INTERNAL_PRODUCTS

      public static final String DEFAULT_CREATE_INTERNAL_PRODUCTS
      Default status of CREATE_INTERNAL_PRODUCTS
      See Also:
    • CREATE_SCENARIO_PRODUCTS_PROPERTY

      public static final String CREATE_SCENARIO_PRODUCTS_PROPERTY
      Whether created products should be converted to scenario types.
      See Also:
    • DEFAULT_CREATE_SCENARIO_PRODUCTS

      public static final String DEFAULT_CREATE_SCENARIO_PRODUCTS
      Default status of CREATE_SCENARIO_PRODUCTS
      See Also:
    • POLLER_CLASS_PROPERTY

      public static final String POLLER_CLASS_PROPERTY
      See Also:
    • DO_BUFFER_FIX_PROPERTY

      public static final String DO_BUFFER_FIX_PROPERTY
      Property for doBufferFix
      See Also:
    • DEFAULT_DO_BUFFER_FIX

      public static final String DEFAULT_DO_BUFFER_FIX
      Default status of DO_BUFFER_FIX property
      See Also:
    • HELP_ARGUMENT

      public static final String HELP_ARGUMENT
      Argument for help
      See Also:
    • POLL_ARGUMENT

      public static final String POLL_ARGUMENT
      Argument for poll
      See Also:
    • TEST_ARGUMENT

      public static final String TEST_ARGUMENT
      Argument for testing
      See Also:
    • FILE_ARGUMENT

      public static final String FILE_ARGUMENT
      Argument for file
      See Also:
    • SENDERS_ARGUMENT

      public static final String SENDERS_ARGUMENT
      Argument for servers
      See Also:
    • ATTACH_ARGUMENT

      public static final String ATTACH_ARGUMENT
      Argument for attach
      See Also:
  • Constructor Details

    • InputWedge

      public InputWedge() throws Exception
      Empty constructor
      Throws:
      Exception - if error occurs
  • Method Details

    • configure

      public void configure(Config config) throws Exception
      Description copied from class: DefaultConfigurable
      Process configuration settings. Called before startup().
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ProductBuilder
      Parameters:
      config - the Config object with settings.
      Throws:
      Exception - if configuration exceptions occur.
    • startup

      public void startup() throws Exception
      Description copied from class: DefaultConfigurable
      Start any processing/background threads.
      Specified by:
      startup in interface Configurable
      Overrides:
      startup in class ProductBuilder
      Throws:
      Exception - if exceptions occur while starting.
    • shutdown

      public void shutdown() throws Exception
      Description copied from class: DefaultConfigurable
      Stop any processing/background threads.
      Specified by:
      shutdown in interface Configurable
      Overrides:
      shutdown in class ProductBuilder
      Throws:
      Exception - if exceptions occur while starting.
    • parseAndSend

      public Map<ProductId,Map<ProductSender,Exception>> parseAndSend(File file, Map<String,Content> attachContent) throws Exception
      Gets products from file and iterates through each product During iteration, sets type to internal/scenario if createInternalProducts or createScenarioProducts is true. Attaches Content files to product, Sends product
      Parameters:
      file - File containing products
      attachContent - Map of String and Content
      Returns:
      Map of product IDs and sent products
      Throws:
      Exception - if error occurs
    • onFile

      public void onFile(File file) throws Exception
      Parses given file, looking for send exceptions and reports statistics
      Specified by:
      onFile in interface FileListenerInterface
      Parameters:
      file - to parse and look for errors
      Throws:
      Exception
    • onFile

      public void onFile(File file, Map<String,Content> attachContent) throws Exception
      Throws:
      Exception
    • getProductCreator

      public ProductCreator getProductCreator()
      Returns:
      productCreator
    • setProductCreator

      public void setProductCreator(ProductCreator productCreator)
      Parameters:
      productCreator - to set
    • getPoller

      public Poller getPoller()
      Returns:
      poller
    • setPoller

      public void setPoller(Poller poller)
      Parameters:
      poller - to set
    • isCreateInternalProducts

      public boolean isCreateInternalProducts()
      Returns:
      the createInternalProducts
    • setCreateInternalProducts

      public void setCreateInternalProducts(boolean createInternalProducts)
      Parameters:
      createInternalProducts - the createInternalProducts to set
    • isCreateScenarioProducts

      public boolean isCreateScenarioProducts()
      Returns:
      the createScenarioProducts
    • setCreateScenarioProducts

      public void setCreateScenarioProducts(boolean createScenarioProducts)
      Parameters:
      createScenarioProducts - the createScenarioProducts to set
    • run

      public void run(String[] args) throws Exception
      Bootstrappable interface.
      Specified by:
      run in interface Bootstrappable
      Parameters:
      args - array of command line arguments.
      Throws:
      Exception - Exception
    • printUsage

      public static void printUsage()
      Usage for interface
    • run

      public void run()
      Specified by:
      run in interface Runnable