# Class AuthConfigFactoryImpl

java.lang.Object
jakarta.security.auth.message.config.AuthConfigFactory
org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl

public class AuthConfigFactoryImpl extends AuthConfigFactory
Implementation of `AuthConfigFactory` for the JASPIC authentication framework.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class AuthConfigFactory

  `AuthConfigFactory.RegistrationContext`

- ## Field Summary

  ### Fields inherited from class AuthConfigFactory

  `DEFAULT_FACTORY_SECURITY_PROPERTY, GET_FACTORY_PERMISSION_NAME, getFactorySecurityPermission, PROVIDER_REGISTRATION_PERMISSION_NAME, providerRegistrationSecurityPermission, SET_FACTORY_PERMISSION_NAME, setFactorySecurityPermission`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AuthConfigFactoryImpl()`
  Constructs a new AuthConfigFactoryImpl and loads any persistent registrations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `detachListener(RegistrationListener listener, String layer, String appContext)`
  Detaches a listener from all registrations matching the given layer and application context, returning the affected registration IDs.
  `AuthConfigProvider`
  `getConfigProvider(String layer, String appContext, RegistrationListener listener)`
  Returns the `AuthConfigProvider` for the specified message layer and application context.
  `AuthConfigFactory.RegistrationContext`
  `getRegistrationContext(String registrationID)`
  Returns the `AuthConfigFactory.RegistrationContext` for the given registration ID.
  `String[]`
  `getRegistrationIDs(AuthConfigProvider provider)`
  Returns the registration IDs associated with the given AuthConfigProvider.
  `void`
  `refresh()`
  Refreshes all registered AuthConfigProviders, causing them to reload their configuration.
  `String`
  `registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description)`
  Registers an AuthConfigProvider instance.
  `String`
  `registerConfigProvider(String className, Map<String,String> properties, String layer, String appContext, String description)`
  Registers an AuthConfigProvider by class name with the given properties.
  `String`
  `registerServerAuthModule(ServerAuthModule serverAuthModule, Object context)`
  Convenience method for registering a `ServerAuthModule` that should have the same effect as calling `AuthConfigFactory.registerConfigProvider(AuthConfigProvider, String, String, String)` with the implementation providing the appropriate `AuthConfigProvider` generated from the provided context.
  `boolean`
  `removeRegistration(String registrationID)`
  Removes a registration by its ID.
  `void`
  `removeServerAuthModule(Object context)`
  Convenience method for deregistering a `ServerAuthModule` that should have the same effect as calling `AuthConfigFactory.removeRegistration(String)`.

  ### Methods inherited from class AuthConfigFactory

  `getFactory, setFactory`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AuthConfigFactoryImpl

    public AuthConfigFactoryImpl()
    Constructs a new AuthConfigFactoryImpl and loads any persistent registrations.

- ## Method Details

  - ### getConfigProvider

    public AuthConfigProvider getConfigProvider(String layer, String appContext, RegistrationListener listener)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Returns the `AuthConfigProvider` for the specified message layer and application context.
    Specified by:
      `getConfigProvider` in class `AuthConfigFactory`
    Parameters:
      `layer` - the message layer
      `appContext` - the application context
      `listener` - the registration listener to attach
    Returns:
      the AuthConfigProvider, or `null` if none is available

  - ### registerConfigProvider

    public String registerConfigProvider(String className, Map<String,String> properties, String layer, String appContext, String description)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Registers an AuthConfigProvider by class name with the given properties.
    Specified by:
      `registerConfigProvider` in class `AuthConfigFactory`
    Parameters:
      `className` - the fully qualified class name of the AuthConfigProvider
      `properties` - the configuration properties
      `layer` - the message layer
      `appContext` - the application context
      `description` - a description of the registration
    Returns:
      a unique registration ID

  - ### registerConfigProvider

    public String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Registers an AuthConfigProvider instance.
    Specified by:
      `registerConfigProvider` in class `AuthConfigFactory`
    Parameters:
      `provider` - the AuthConfigProvider to register
      `layer` - the message layer
      `appContext` - the application context
      `description` - a description of the registration
    Returns:
      a unique registration ID

  - ### removeRegistration

    public boolean removeRegistration(String registrationID)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Removes a registration by its ID.
    Specified by:
      `removeRegistration` in class `AuthConfigFactory`
    Parameters:
      `registrationID` - the registration ID to remove
    Returns:
      `true` if the registration was removed, `false` if it did not exist

  - ### detachListener

    public String[] detachListener(RegistrationListener listener, String layer, String appContext)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Detaches a listener from all registrations matching the given layer and application context, returning the affected registration IDs.
    Specified by:
      `detachListener` in class `AuthConfigFactory`
    Parameters:
      `listener` - the listener to detach
      `layer` - the message layer
      `appContext` - the application context
    Returns:
      an array of registration IDs from which the listener was detached

  - ### getRegistrationIDs

    public String[] getRegistrationIDs(AuthConfigProvider provider)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Returns the registration IDs associated with the given AuthConfigProvider.
    Specified by:
      `getRegistrationIDs` in class `AuthConfigFactory`
    Parameters:
      `provider` - the AuthConfigProvider
    Returns:
      an array of registration IDs

  - ### getRegistrationContext

    public AuthConfigFactory.RegistrationContext getRegistrationContext(String registrationID)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Returns the `AuthConfigFactory.RegistrationContext` for the given registration ID.
    Specified by:
      `getRegistrationContext` in class `AuthConfigFactory`
    Parameters:
      `registrationID` - the registration ID
    Returns:
      the RegistrationContext, or `null` if the ID is not found

  - ### refresh

    public void refresh()
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Refreshes all registered AuthConfigProviders, causing them to reload their configuration.
    Specified by:
      `refresh` in class `AuthConfigFactory`

  - ### registerServerAuthModule

    public String registerServerAuthModule(ServerAuthModule serverAuthModule, Object context)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Convenience method for registering a `ServerAuthModule` that should have the same effect as calling `AuthConfigFactory.registerConfigProvider(AuthConfigProvider, String, String, String)` with the implementation providing the appropriate `AuthConfigProvider` generated from the provided context.
    Specified by:
      `registerServerAuthModule` in class `AuthConfigFactory`
    Parameters:
      `serverAuthModule` - The `ServerAuthModule` to register
      `context` - The associated application context
    Returns:
      A string identifier for the created registration

  - ### removeServerAuthModule

    public void removeServerAuthModule(Object context)
    Description copied from class: `jakarta.security.auth.message.config.AuthConfigFactory`
    Convenience method for deregistering a `ServerAuthModule` that should have the same effect as calling `AuthConfigFactory.removeRegistration(String)`.
    Specified by:
      `removeServerAuthModule` in class `AuthConfigFactory`
    Parameters:
      `context` - The associated application context