Package gov.usgs.earthquake.indexer
Class ExtentIndexerListener
- java.lang.Object
-
- gov.usgs.util.DefaultConfigurable
-
- gov.usgs.earthquake.product.AbstractListener
-
- gov.usgs.earthquake.indexer.DefaultIndexerListener
-
- gov.usgs.earthquake.indexer.ReliableIndexerListener
-
- gov.usgs.earthquake.indexer.ExtentIndexerListener
-
- All Implemented Interfaces:
IndexerListener
,Configurable
,java.lang.Runnable
public class ExtentIndexerListener extends ReliableIndexerListener
ExtentIndexerListener is an extension of the ReliableIndexerListener. It populates the ExtentSummary table with viable products. This listener takes an ExtentIndex for querying and table updates:- index
- (Required) the ExtentIndex used for querying and updates
-
-
Field Summary
-
Fields inherited from class gov.usgs.earthquake.indexer.ReliableIndexerListener
productIndex
-
Fields inherited from class gov.usgs.earthquake.indexer.DefaultIndexerListener
IGNORE_ARCHIVE_DEFAULT, IGNORE_ARCHIVE_PROPERTY, PROCESS_ONLY_WHEN_EVENT_CHANGE_DEFAULT, PROCESS_ONLY_WHEN_EVENT_CHANGE_PROPERTY, PROCESS_PREFERRED_ONLY_DEFAULT, PROCESS_PREFERRED_ONLY_PROPERTY, PROCESS_UNASSOCIATED_DEFAULT, PROCESS_UNASSOCIATED_PROPERTY
-
Fields inherited from class gov.usgs.earthquake.product.AbstractListener
ATTEMPT_COUNT_PROPERTY, DEFAULT_ATTEMPT_COUNT, DEFAULT_RETRY_DELAY, DEFAULT_TIMEOUT, EXCLUDE_SOURCES_PROPERTY, EXCLUDE_TYPES_PROPERTY, INCLUDE_ACTUALS_PROPERTY, INCLUDE_DEVELOPMENTS_PROPERTY, INCLUDE_INTERNALS_PROPERTY, INCLUDE_SCENARIOS_PROPERTY, INCLUDE_SOURCES_PROPERTY, INCLUDE_TESTS_PROPERTY, INCLUDE_TYPES_PROPERTY, MAX_TRIES_PROPERTY, RETRY_DELAY_PROPERTY, TIMEOUT_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ExtentIndexerListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Config config)
Configures listener, checking for correct typeprotected void
onBeforeProcessThreadStart()
Loads the last index id in the extent table before the listener has to use itvoid
processProduct(ProductSummary product)
Hands product to index to be added to table-
Methods inherited from class gov.usgs.earthquake.indexer.ReliableIndexerListener
getLastIndexId, getNextProducts, getProductIndex, onIndexerEvent, onProcessException, onProductGetException, run, setLastIndexId, setProductIndex, shutdown, startup
-
Methods inherited from class gov.usgs.earthquake.indexer.DefaultIndexerListener
accept, accept, getProcessOnlyPreferredProducts, getProcessUnassociatedProducts, isIgnoreArchive, isProcessOnlyWhenEventChanged, setIgnoreArchive, setProcessOnlyPreferredProducts, setProcessOnlyWhenEventChanged, setProcessUnassociatedProducts
-
Methods inherited from class gov.usgs.earthquake.product.AbstractListener
accept, getExcludeSources, getExcludeTypes, getIncludeSources, getIncludeTypes, getMaxTries, getRetryDelay, getTimeout, isIncludeActuals, isIncludeDevelopments, isIncludeInternals, isIncludeScenarios, isIncludeTests, setIncludeActuals, setIncludeDevelopments, setIncludeInternals, setIncludeScenarios, setIncludeTests, setMaxTries, setRetryDelay, setTimeout
-
Methods inherited from class gov.usgs.util.DefaultConfigurable
getName, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.usgs.util.Configurable
getName, setName
-
Methods inherited from interface gov.usgs.earthquake.indexer.IndexerListener
getMaxTries, getTimeout
-
-
-
-
Method Detail
-
configure
public void configure(Config config) throws java.lang.Exception
Configures listener, checking for correct type- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classReliableIndexerListener
- Parameters:
config
- configuration- Throws:
ConfigurationException
- if incorrect type providedjava.lang.Exception
- if missing product index
-
onBeforeProcessThreadStart
protected void onBeforeProcessThreadStart() throws java.lang.Exception
Loads the last index id in the extent table before the listener has to use it- Overrides:
onBeforeProcessThreadStart
in classReliableIndexerListener
- Throws:
java.lang.Exception
- if ExtentIndex can't do database transaction
-
processProduct
public void processProduct(ProductSummary product) throws java.lang.Exception
Hands product to index to be added to table- Overrides:
processProduct
in classReliableIndexerListener
- Parameters:
product
- the product to be added- Throws:
java.lang.Exception
- if ExtentIndex can't do database transaction
-
-