Package gov.usgs.earthquake.indexer
Class DefaultIndexerModule
java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.indexer.DefaultIndexerModule
- All Implemented Interfaces:
IndexerModule
,Configurable
- Direct Known Subclasses:
DYFIIndexerModule
,MTIndexerModule
,OriginIndexerModule
,ShakeMapIndexerModule
,TectonicSummaryIndexerModule
Default implementation of the IndexerModule interface, implements ANSS
Authoritative Region logic.
Provides a basic level of support for any type of product. Creates a
ProductSummary using the ProductSummary(product) constructor, which copies
all properties, and links from the product.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
Weight added when product author has an authoritative region.static final long
Weight added when product refers to an authoritative event.static final long
Weight added when product author is in its authoritative region.static final long
Initial preferred weight.static final String
Property for ignoreRegionsstatic final long
Weight added when product author is NEIC.static final long
Weight added when product source is same as event source.Fields inherited from interface gov.usgs.earthquake.indexer.IndexerModule
LEVEL_DEFAULT, LEVEL_SUPPORTED, LEVEL_UNSUPPORTED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Process configuration settings.getBaseProductType
(String type) Remove "internal-" prefix and "-scenario" suffix from product type".protected long
getPreferredWeight
(ProductSummary summary) Calculate the preferred weight for a product summary.getProductSummary
(Product product) Create a ProductSummary from a Product.int
getSupportLevel
(Product product) This module provides a default level of support for any type of product.void
setSignatureVerifier
(SignatureVerifier signatureVerifier) Methods inherited from class gov.usgs.util.DefaultConfigurable
getName, setName, shutdown, startup
-
Field Details
-
IGNORE_REGIONS_PROPERTY
Property for ignoreRegions- See Also:
-
DEFAULT_PREFERRED_WEIGHT
public static final long DEFAULT_PREFERRED_WEIGHTInitial preferred weight.- See Also:
-
SAME_SOURCE_WEIGHT
public static final long SAME_SOURCE_WEIGHTWeight added when product source is same as event source.- See Also:
-
AUTHORITATIVE_WEIGHT
public static final long AUTHORITATIVE_WEIGHTWeight added when product author is in its authoritative region.- See Also:
-
AUTHORITATIVE_EVENT_WEIGHT
public static final long AUTHORITATIVE_EVENT_WEIGHTWeight added when product refers to an authoritative event.- See Also:
-
ANSS_CONTRIBUTOR_WEIGHT
public static final long ANSS_CONTRIBUTOR_WEIGHTWeight added when product author has an authoritative region.- See Also:
-
NEIC_CONTRIBUTOR_WEIGHT
public static final long NEIC_CONTRIBUTOR_WEIGHTWeight added when product author is NEIC.- See Also:
-
-
Constructor Details
-
DefaultIndexerModule
public DefaultIndexerModule()
-
-
Method Details
-
configure
Description copied from class:DefaultConfigurable
Process configuration settings. Called before startup().- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDefaultConfigurable
- Parameters:
config
- the Config object with settings.- Throws:
Exception
- if configuration exceptions occur.
-
getProductSummary
Create a ProductSummary from a Product. Uses the ProductSummary(Product) constructor, which copies product information. Checks whether product is within its authoritative region, and if so boosts preferredWeight by AUTHORITATIVE_WEIGHT.- Specified by:
getProductSummary
in interfaceIndexerModule
- Parameters:
product
- the product to summarize.- Returns:
- ProductSummary for Product object.
- Throws:
Exception
- if error occurs
-
getPreferredWeight
Calculate the preferred weight for a product summary. This method is called after creating a product summary, but before returning the created summary. It's return value is used to assign the product summary preferred weight. Within each type of product, the summary with the largest preferred weight is considered preferred.- Parameters:
summary
- the summary to calculate a preferred weight.- Returns:
- the absolute preferred weight.
- Throws:
Exception
- if error occurs
-
getBaseProductType
Remove "internal-" prefix and "-scenario" suffix from product type".- Parameters:
type
- product type.- Returns:
- base product type (without any known prefix or suffix).
-
getIgnoreRegions
- Returns:
- ignoreRegions
-
getSupportLevel
This module provides a default level of support for any type of product.- Specified by:
getSupportLevel
in interfaceIndexerModule
- Parameters:
product
- the product to test.- Returns:
- IndexerModule.LEVEL_DEFAULT.
-
getSignatureVerifier
- Returns:
- signatureVerifier
-
setSignatureVerifier
- Parameters:
signatureVerifier
- to set
-