Class HttpSecurityLoaderUtil


  • public class HttpSecurityLoaderUtil
    extends java.lang.Object
    Utility class for testing the HttpSecuritySource.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • validateSpecification

        public static <A,​AC extends java.io.Serializable,​C,​O extends java.lang.Enum<O>,​F extends java.lang.Enum<F>,​HS extends HttpSecuritySource<A,​AC,​C,​O,​F>> PropertyList validateSpecification​(java.lang.Class<HS> httpSecuritySourceClass,
                                                                                                                                                                                                                                                       java.lang.String... propertyNameLabels)
        Type Parameters:
        A - Authentication type.
        AC - Access control type.
        C - Credentials type.
        O - Dependency keys type.
        F - Flow keys type.
        HS - HttpSecuritySource type.
        Parameters:
        httpSecuritySourceClass - HttpSecuritySource class.
        propertyNameLabels - Listing of name/label pairs for the Property instances.
        Returns:
        Loaded PropertyList.
      • loadHttpSecuritySource

        public static <A,​AC extends java.io.Serializable,​C,​O extends java.lang.Enum<O>,​F extends java.lang.Enum<F>,​HS extends HttpSecuritySource<A,​AC,​C,​O,​F>> HS loadHttpSecuritySource​(java.lang.Class<HS> httpSecuritySourceClass,
                                                                                                                                                                                                                                              java.lang.String... propertyNameValues)
        Convenience method to load the HttpSecuritySource initialised ready for testing.
        Type Parameters:
        A - Authentication type.
        AC - Access control type.
        C - Credentials type.
        O - Dependency keys type.
        F - Flow keys type.
        HS - HttpSecuritySource type.
        Parameters:
        httpSecuritySourceClass - HttpSecuritySource class.
        propertyNameValues - Property name/value pairs to initialise the HttpSecuritySource.
        Returns:
        Initialised HttpSecuritySource.
      • loadHttpSecurity

        public static <A,​AC extends java.io.Serializable,​C,​O extends java.lang.Enum<O>,​F extends java.lang.Enum<F>,​HS extends HttpSecuritySource<A,​AC,​C,​O,​F>> HttpSecurity<A,​AC,​C,​O,​F> loadHttpSecurity​(java.lang.Class<HS> httpSecuritySourceClass,
                                                                                                                                                                                                                                                                                      java.lang.String... propertyNameValues)
        Convenience method to load the HttpSecurity initialised ready for testing.
        Type Parameters:
        A - Authentication type.
        AC - Access control type.
        C - Credentials type.
        O - Dependency keys type.
        F - Flow keys type.
        HS - HttpSecuritySource type.
        Parameters:
        httpSecuritySourceClass - HttpSecuritySource class.
        propertyNameValues - Property name/value pairs to initialise the HttpSecuritySource.
        Returns:
        Initialised HttpSecuritySource.
      • newHttpSecuritySource

        public static <A,​AC extends java.io.Serializable,​C,​O extends java.lang.Enum<O>,​F extends java.lang.Enum<F>,​HS extends HttpSecuritySource<A,​AC,​C,​O,​F>> HS newHttpSecuritySource​(java.lang.Class<HS> httpSecuritySourceClass)
        Instantiates and instance of the HttpSecuritySource.
        Type Parameters:
        A - Authentication type.
        AC - Access control type.
        C - Credentials type.
        O - Dependency keys type.
        F - Flow keys type.
        HS - HttpSecuritySource type.
        Parameters:
        httpSecuritySourceClass - HttpSecuritySource class.
        Returns:
        New HttpSecuritySource instance.
      • loadHttpSecurityType

        public static <A,​AC extends java.io.Serializable,​C,​O extends java.lang.Enum<O>,​F extends java.lang.Enum<F>> HttpSecurityType<A,​AC,​C,​O,​F> loadHttpSecurityType​(HttpSecuritySource<A,​AC,​C,​O,​F> httpSecuritySource,
                                                                                                                                                                                                                      java.lang.String... propertyNameValues)
        Loads the HttpSecurityType.
        Type Parameters:
        A - Authentication type.
        AC - Access control type.
        C - Credentials type.
        O - Dependency keys type.
        F - Flow keys type.
        Parameters:
        httpSecuritySource - HttpSecuritySource.
        propertyNameValues - Property name/value pairs.
        Returns:
        HttpSecurityType.
      • authenticate

        public static <C> void authenticate​(HttpAuthentication<C> authentication,
                                            C credentials)
                                     throws java.lang.Throwable
        Undertakes authentication.
        Parameters:
        authentication - HttpAuthentication.
        credentials - Credentials.
        Throws:
        java.lang.Throwable - If fails to authenticate or times out authenticating.
      • logout

        public static <C> void logout​(HttpAuthentication<C> authentication)
                               throws java.lang.Throwable
        Undertakes logout.
        Parameters:
        authentication - HttpAuthentication.
        Throws:
        java.lang.Throwable - If fails to logout or times out.