Interface MechanismAuthenticationFactory<M,​F,​E extends Exception>

  • Type Parameters:
    M - the type of mechanism
    F - the type of the mechanism's factory
    E - the mechanism-type-specific exception that may be thrown upon instantiation
    All Known Implementing Classes:
    AbstractMechanismAuthenticationFactory

    public interface MechanismAuthenticationFactory<M,​F,​E extends Exception>
    A generalized mechanism factory which authenticates against a security domain.
    Author:
    David M. Lloyd
    • Method Detail

      • getSecurityDomain

        SecurityDomain getSecurityDomain()
        Get the underlying SecurityDomain that mechanisms created by this factory will be using for authentication.
        Returns:
        the underlying SecurityDomain that mechanisms created by this factory will be using for authentication.
      • getFactory

        F getFactory()
        Get the actual factory used for instantiation.
        Returns:
        the actual factory (not null)
      • createMechanism

        M createMechanism​(String name,
                          UnaryOperator<F> factoryTransformation)
                   throws E extends Exception
        Create the mechanism instance.
        Parameters:
        name - the mechanism name (must not be null)
        factoryTransformation - the transformation to apply to the factory (must not be null)
        Returns:
        the mechanism, or null if the mechanism with the given name is not supported
        Throws:
        E - if the mechanism instantiation failed
        E extends Exception
      • createMechanism

        default M createMechanism​(String name)
                           throws E extends Exception
        Create the mechanism instance.
        Parameters:
        name - the mechanism name (must not be null)
        Returns:
        the mechanism, or null if the mechanism with the given name is not supported
        Throws:
        E - if the mechanism instantiation failed
        E extends Exception
      • getMechanismNames

        Collection<String> getMechanismNames()
        Get the collection of mechanism names may be supported by this factory. The actual set of available mechanisms depends on run-time factors but will generally not be greater than this collection.
        Returns:
        the mechanism names (not null)