Class DefaultIndexerModule

    • Field Detail

      • IGNORE_REGIONS_PROPERTY

        public static final java.lang.String IGNORE_REGIONS_PROPERTY
        Property for ignoreRegions
        See Also:
        Constant Field Values
      • DEFAULT_PREFERRED_WEIGHT

        public static final long DEFAULT_PREFERRED_WEIGHT
        Initial preferred weight.
        See Also:
        Constant Field Values
      • SAME_SOURCE_WEIGHT

        public static final long SAME_SOURCE_WEIGHT
        Weight added when product source is same as event source.
        See Also:
        Constant Field Values
      • AUTHORITATIVE_WEIGHT

        public static final long AUTHORITATIVE_WEIGHT
        Weight added when product author is in its authoritative region.
        See Also:
        Constant Field Values
      • AUTHORITATIVE_EVENT_WEIGHT

        public static final long AUTHORITATIVE_EVENT_WEIGHT
        Weight added when product refers to an authoritative event.
        See Also:
        Constant Field Values
      • ANSS_CONTRIBUTOR_WEIGHT

        public static final long ANSS_CONTRIBUTOR_WEIGHT
        Weight added when product author has an authoritative region.
        See Also:
        Constant Field Values
      • NEIC_CONTRIBUTOR_WEIGHT

        public static final long NEIC_CONTRIBUTOR_WEIGHT
        Weight added when product author is NEIC.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultIndexerModule

        public DefaultIndexerModule()
    • Method Detail

      • configure

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

        public ProductSummary getProductSummary​(Product product)
                                         throws java.lang.Exception
        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 interface IndexerModule
        Parameters:
        product - the product to summarize.
        Returns:
        ProductSummary for Product object.
        Throws:
        java.lang.Exception - if error occurs
      • getPreferredWeight

        protected long getPreferredWeight​(ProductSummary summary)
                                   throws java.lang.Exception
        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:
        java.lang.Exception - if error occurs
      • getBaseProductType

        public java.lang.String getBaseProductType​(java.lang.String type)
        Remove "internal-" prefix and "-scenario" suffix from product type".
        Parameters:
        type - product type.
        Returns:
        base product type (without any known prefix or suffix).
      • getIgnoreRegions

        public java.util.List<java.lang.String> getIgnoreRegions()
        Returns:
        ignoreRegions
      • getSupportLevel

        public int getSupportLevel​(Product product)
        This module provides a default level of support for any type of product.
        Specified by:
        getSupportLevel in interface IndexerModule
        Parameters:
        product - the product to test.
        Returns:
        IndexerModule.LEVEL_DEFAULT.
      • getSignatureVerifier

        public SignatureVerifier getSignatureVerifier()
        Returns:
        signatureVerifier
      • setSignatureVerifier

        public void setSignatureVerifier​(SignatureVerifier signatureVerifier)
        Parameters:
        signatureVerifier - to set