Class KeyStorageLocator


  • public final class KeyStorageLocator
    extends java.lang.Object
    A service locator for KeyStorage.
    Author:
    Carl Harris
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static KeyStorage getInstance​(java.lang.String provider, java.util.Properties properties)
      Gets a new key storage instance from the specified provider.
      static KeyStorage getInstance​(java.lang.String provider, java.util.Properties properties, java.util.function.Supplier<java.util.ServiceLoader<KeyStorageProvider>> loader)
      Gets a new key storage instance from the specified provider.
      static MutableKeyStorage getMutableInstance​(java.lang.String provider, java.util.Properties properties)
      Gets a new mutable key storage instance from the specified provider.
      static MutableKeyStorage getMutableInstance​(java.lang.String provider, java.util.Properties properties, java.util.function.Supplier<java.util.ServiceLoader<KeyStorageProvider>> loader)
      Gets a new mutable key storage instance from the specified provider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyStorageLocator

        public KeyStorageLocator()
    • Method Detail

      • getInstance

        public static KeyStorage getInstance​(java.lang.String provider,
                                             java.util.Properties properties,
                                             java.util.function.Supplier<java.util.ServiceLoader<KeyStorageProvider>> loader)
                                      throws NoSuchProviderException,
                                             ProviderConfigurationException
        Gets a new key storage instance from the specified provider.
        Parameters:
        loader - a supplier for a service loader
        provider - provider name; e.g. LOCAL
        properties - provider-defined configuration properties
        Returns:
        key storage instance
        Throws:
        NoSuchProviderException - if there exists no provider with the given name
        ProviderConfigurationException - if the provider reports an error in creating and configuring the storage instance
      • getMutableInstance

        public static MutableKeyStorage getMutableInstance​(java.lang.String provider,
                                                           java.util.Properties properties)
                                                    throws NoSuchProviderException,
                                                           ProviderConfigurationException
        Gets a new mutable key storage instance from the specified provider.
        Parameters:
        provider - provider name; e.g. LOCAL
        properties - provider-defined configuration properties
        Returns:
        key storage instance
        Throws:
        NoSuchProviderException - if there exists no provider with the given name that supports the mutable interface
        ProviderConfigurationException - if the provider reports an error in creating and configuring the storage instance
      • getMutableInstance

        public static MutableKeyStorage getMutableInstance​(java.lang.String provider,
                                                           java.util.Properties properties,
                                                           java.util.function.Supplier<java.util.ServiceLoader<KeyStorageProvider>> loader)
                                                    throws NoSuchProviderException,
                                                           ProviderConfigurationException
        Gets a new mutable key storage instance from the specified provider.
        Parameters:
        loader - a supplier for a service loader
        provider - provider name; e.g. LOCAL
        properties - provider-defined configuration properties
        Returns:
        key storage instance
        Throws:
        NoSuchProviderException - if there exists no provider with the given name that supports the mutable interface
        ProviderConfigurationException - if the provider reports an error in creating and configuring the storage instance