Class ShakeMapIndexerWedge

  • All Implemented Interfaces:
    NotificationIndexCleanup.Listener, NotificationListener, Configurable

    @Deprecated
    public class ShakeMapIndexerWedge
    extends DefaultNotificationListener
    Deprecated.
    Legacy interface to trigger pre-Indexer ShakeMap processing. The Old ShakeMap Indexer is no longer used, and this class is deprecated. When a shakemap product arrives, it is only processed if one of these is true:
    • doesn't already exist
    • from preferred source (product source = eventsource)
    • from same source as before
    When processing a shakemap:
    1. remove previous version
    2. unpack new version, if not a delete
    3. trigger legacy indexer
    4. send tracker update
    Configurable properties:
    indexerCommand
    The shakemap indexer command to run. Defaults to /home/www/vhosts/earthquake/cron/shakemap_indexer.php .
    shakemapDirectory
    The shakemap event directory. Defaults to /home/www/vhosts/earthquake/htdocs/earthquakes/shakemap .
    timeout
    How long in milliseconds the indexer is allowed to run before being terminated.
    • Field Detail

      • SHAKEMAP_INDEXER_COMMAND_PROPERTY

        public static final java.lang.String SHAKEMAP_INDEXER_COMMAND_PROPERTY
        Deprecated.
        Configurable property.
        See Also:
        Constant Field Values
      • DEFAULT_SHAKEMAP_INDEXER_COMMAND

        public static final java.lang.String DEFAULT_SHAKEMAP_INDEXER_COMMAND
        Deprecated.
        The shakemap indexer command to execute.
        See Also:
        Constant Field Values
      • COMMAND_TIMEOUT_PROPERTY

        public static final java.lang.String COMMAND_TIMEOUT_PROPERTY
        Deprecated.
        Configurable property for command timeout.
        See Also:
        Constant Field Values
      • DEFAULT_COMMAND_TIMEOUT

        public static final java.lang.String DEFAULT_COMMAND_TIMEOUT
        Deprecated.
        Default command timeout.
        See Also:
        Constant Field Values
      • SHAKEMAP_DIRECTORY_PROPERTY

        public static final java.lang.String SHAKEMAP_DIRECTORY_PROPERTY
        Deprecated.
        Configurable property for shakemap directory.
        See Also:
        Constant Field Values
      • DEFAULT_SHAKEMAP_DIRECTORY

        public static final java.lang.String DEFAULT_SHAKEMAP_DIRECTORY
        Deprecated.
        Default shakemap directory.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ShakeMapIndexerWedge

        public ShakeMapIndexerWedge()
        Deprecated.
        Create a new ShakeMapIndexerWedge. Sets up the includeTypes list to contain "shakemap".
    • Method Detail

      • onProduct

        public void onProduct​(Product product)
                       throws java.lang.Exception
        Deprecated.
        Receive a ShakeMap from Product Distribution.
        Overrides:
        onProduct in class DefaultNotificationListener
        Parameters:
        product - a shakemap type product.
        Throws:
        java.lang.Exception - if error occurs
      • runIndexer

        public int runIndexer​(java.lang.String network,
                              java.lang.String code,
                              boolean delete)
                       throws java.lang.Exception
        Deprecated.
        Run the shakemap indexer. If network and code are omitted, all events are updated.
        Parameters:
        network - the network to update.
        code - the code to update.
        delete - whether indexer is handling a delete (true) or update (false).
        Returns:
        -1 if indexer does not complete within max(1, getAttemptCount()) times, or exit code if indexer completes.
        Throws:
        java.io.IOException - if IO error occurs
        java.lang.Exception
      • getEventDirectory

        public java.io.File getEventDirectory​(ShakeMap shakemap)
                                       throws java.lang.Exception
        Deprecated.
        Get the directory for a particular shakemap.
        Parameters:
        shakemap - the shakemap to find a directory for.
        Returns:
        the shakemap directory.
        Throws:
        java.lang.Exception - if error occurs
      • translateShakeMapSource

        public java.lang.String translateShakeMapSource​(java.lang.String eventSource)
        Deprecated.
        Translate from an event source to the old style shakemap source. Driven by the SOURCE_TRANSLATION_MAP.
        Parameters:
        eventSource - the event network.
        Returns:
        the shakemap network.
      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Deprecated.
        Configure this shakemap indexer.
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class DefaultNotificationListener
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.