Class JaspiConfigurationBuilder


  • public final class JaspiConfigurationBuilder
    extends Object
    A builder API to assemble JASPIC configuration.
    Author:
    Darran Lofthouse
    • Constructor Detail

      • JaspiConfigurationBuilder

        private JaspiConfigurationBuilder​(String messageLayer,
                                          String applicationContext)
    • Method Detail

      • setDescription

        public JaspiConfigurationBuilder setDescription​(String description)
        Set the description to be used for the provider once registered.
        Parameters:
        description - the description to be used for the provider once registered.
        Returns:
        this JaspiConfigurationBuilder to allow chaining of commands.
        Throws:
        IllegalStateException - if the configuration has already been registered.
      • addAuthModuleFactory

        public JaspiConfigurationBuilder addAuthModuleFactory​(Supplier<javax.security.auth.message.module.ServerAuthModule> serverAuthModuleFactory)
        Add a Supplier to be used to create a ServerAuthModule instance for this message layer and application context combination.
        Parameters:
        serverAuthModuleFactory - the Supplier to be added to the list of module factories.
        Returns:
        this JaspiConfigurationBuilder to allow chaining of commands.
        Throws:
        IllegalStateException - if the configuration has already been registered.
      • addAuthModuleFactory

        public JaspiConfigurationBuilder addAuthModuleFactory​(Supplier<javax.security.auth.message.module.ServerAuthModule> serverAuthModuleFactory,
                                                              Flag flag,
                                                              Map options)
        Add a Supplier to be used to create a ServerAuthModule instance for this message layer and application context combination.
        Parameters:
        serverAuthModuleFactory - the Supplier to be added to the list of module factories.
        flag - the flag to control the handling of the auth module.
        options - the configuration options to pass to the module during initialisation.
        Returns:
        this JaspiConfigurationBuilder to allow chaining of commands.
        Throws:
        IllegalStateException - if the configuration has already been registered.
      • register

        public String register()
        Register the assembled configuration against the system wide AuthConfigFactory.
        Returns:
        The registration ID returned by the factory on registration.
        Throws:
        IllegalStateException - if the configuration has already been registered.
      • register

        public String register​(javax.security.auth.message.config.AuthConfigFactory authConfigFactory)
        Register the assembled configuration against the supplied AuthConfigFactory.
        Parameters:
        authConfigFactory - the AuthConfigFactory to register the configuration against.
        Returns:
        The registration ID returned by the factory on registration.
        Throws:
        IllegalStateException - if the configuration has already been registered.
      • assertNotRegistered

        private void assertNotRegistered()