Class AbstractSecurityProviderRegistrar

    • Field Detail

      • props

        protected final java.util.Map<java.lang.String,​java.lang.Object> props
      • supportedEntities

        protected final java.util.Map<java.lang.Class<?>,​java.util.Map<java.lang.String,​java.lang.Boolean>> supportedEntities
      • providerHolder

        protected final java.util.concurrent.atomic.AtomicReference<java.security.Provider> providerHolder
      • name

        private final java.lang.String name
    • Constructor Detail

      • AbstractSecurityProviderRegistrar

        protected AbstractSecurityProviderRegistrar​(java.lang.String name)
    • Method Detail

      • getName

        public final java.lang.String getName()
        Specified by:
        getName in interface NamedResource
        Returns:
        The resource name
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getProperties()
        Description copied from interface: PropertyResolver

        A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.

        Note: the type of the mapped property should match the expected configuration value type - Long, Integer, Boolean, String, etc.... If it doesn't, the toString() result of the mapped value is used to convert it to the required type. E.g., if the mapped value is the string "1234" and the expected value is a long then it will be parsed into one. Also, if the mapped value is an Integer but a long is expected, then it will be converted into one.

        Specified by:
        getProperties in interface PropertyResolver
        Specified by:
        getProperties in interface SecurityProviderRegistrar
        Returns:
        a valid Map containing configuration values, never null. Note: may be immutable.
      • getOrCreateProvider

        protected java.security.Provider getOrCreateProvider​(java.lang.String providerClassName)
                                                      throws java.lang.ReflectiveOperationException
        Attempts to see if a provider with this name already registered. If not, then uses reflection API in order to load and instantiate the specified providerClassName
        Parameters:
        providerClassName - The fully-qualified class name to instantiate if a provider not already registered
        Returns:
        The resolved Provider instance - Note: the result is cached - i.e., successful resolution result will not cause the code to re-resolve the provider
        Throws:
        java.lang.ReflectiveOperationException - If failed to instantiate the provider
        java.lang.UnsupportedOperationException - If registrar not supported
        See Also:
        OptionalFeature.isSupported(), Security.getProvider(String), createProviderInstance(String)
      • createProviderInstance

        protected java.security.Provider createProviderInstance​(java.lang.String providerClassName)
                                                         throws java.lang.ReflectiveOperationException
        Throws:
        java.lang.ReflectiveOperationException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object