Class ProductKey

java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.distribution.ProductKey
All Implemented Interfaces:
Configurable

public class ProductKey extends DefaultConfigurable
This represents a public key used to verify product signatures. A key should have at least one source and/or one type.
  • Field Details

    • LOGGER

      public static final Logger LOGGER
      Logger for use in file
    • SOURCES_PROPERTY_NAME

      public static final String SOURCES_PROPERTY_NAME
      Property name for sources.
      See Also:
    • TYPES_PROPERTY_NAME

      public static final String TYPES_PROPERTY_NAME
      Property name for types.
      See Also:
    • KEY_PROPERTY_NAME

      public static final String KEY_PROPERTY_NAME
      Property name for key.
      See Also:
  • Constructor Details

    • ProductKey

      public ProductKey()
      Empty constructor for the Configurable interface.
    • ProductKey

      public ProductKey(PublicKey key, List<String> sources, List<String> types)
      Construct a new ProductPublicKey. Sources
      Parameters:
      key - the public key.
      sources - the sources to use with this key.
      types - the types to use with this key.
  • Method Details

    • isForProduct

      public boolean isForProduct(ProductId id)
      Check whether this key is a candidate for verifying a signature. If any sources, product source must be in list. If any types, product type must be in list.
      Parameters:
      id - which product to check.
      Returns:
      true if this key might verify the signature for given product.
    • 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 DefaultConfigurable
      Parameters:
      config - the Config object with settings.
      Throws:
      Exception - if configuration exceptions occur.
    • 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 DefaultConfigurable
      Throws:
      Exception - if exceptions occur while starting.
    • 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 DefaultConfigurable
      Throws:
      Exception - if exceptions occur while starting.
    • getKey

      public PublicKey getKey()
      Returns:
      the key
    • setKey

      public void setKey(PublicKey key)
      Parameters:
      key - the key to set
    • getSources

      public List<String> getSources()
      Returns:
      the sources
    • getTypes

      public List<String> getTypes()
      Returns:
      the types