Class JMACAuthConfigFactory

java.lang.Object
javax.security.auth.message.config.AuthConfigFactory
com.sun.xml.wss.provider.wsit.JMACAuthConfigFactory

public class JMACAuthConfigFactory extends javax.security.auth.message.config.AuthConfigFactory
This class implements methods in the abstract class AuthConfigFactory.
Author:
Shing Wai Chan
  • Nested Class Summary

    Nested classes/interfaces inherited from class javax.security.auth.message.config.AuthConfigFactory

    javax.security.auth.message.config.AuthConfigFactory.RegistrationContext
  • Field Summary

    Fields inherited from class javax.security.auth.message.config.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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    detachListener(javax.security.auth.message.config.RegistrationListener listener, String layer, String appContext)
    Disassociate the listener from all the provider registrations whose layer and appContext values are matched by the corresponding arguments to this method.
    javax.security.auth.message.config.AuthConfigProvider
    getConfigProvider(String layer, String appContext, javax.security.auth.message.config.RegistrationListener listener)
    Get a registered AuthConfigProvider from the factory.
    javax.security.auth.message.config.AuthConfigFactory.RegistrationContext
    Get the the registration context for the identified registration.
    getRegistrationIDs(javax.security.auth.message.config.AuthConfigProvider provider)
    Get the registration identifiers for all registrations of the provider instance at the factory.
    static URL
    loadFromClasspath(String configFileName)
     
    void
    Cause the factory to reprocess its persisent declarative representation of provider registrations.
    registerConfigProvider(String className, Map properties, String layer, String appContext, String description)
    Registers within the factory, a provider of ServerAuthConfig and/or ClientAuthConfig objects for a message layer and application context identifier.
    registerConfigProvider(javax.security.auth.message.config.AuthConfigProvider provider, String layer, String appContext, String description)
     
    boolean
    removeRegistration(String registrationID)
    Remove the identified provider registration from the factory and invoke any listeners associated with the removed registration.

    Methods inherited from class javax.security.auth.message.config.AuthConfigFactory

    getFactory, setFactory

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JMACAuthConfigFactory

      public JMACAuthConfigFactory(ClassLoader loader)
  • Method Details

    • getConfigProvider

      public javax.security.auth.message.config.AuthConfigProvider getConfigProvider(String layer, String appContext, javax.security.auth.message.config.RegistrationListener listener)
      Get a registered AuthConfigProvider from the factory. Get the provider of ServerAuthConfig and/or ClientAuthConfig objects registered for the identified message layer and application context.
      Specified by:
      getConfigProvider in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      layer - a String identifying the message layer for which the registered AuthConfigProvider is to be returned. This argument may be null.
      appContext - a String that identifys the application messaging context for which the registered AuthConfigProvider is to be returned. This argument may be null.
      listener - the RegistrationListener whose notify method is to be invoked if the corresponding registration is unregistered or replaced. The value of this argument may be null.
      Returns:
      the implementation of the AuthConfigProvider interface registered at the factory for the layer and appContext or null if no AuthConfigProvider is selected.

      All factories shall employ the following precedence rules to select the registered AuthConfigProvider that matches the layer and appContext arguments:

      • The provider that is specifically registered for both the corresponding message layer and appContext shall be selected.
      • if no provider is selected according to the preceding rule, the provider specifically registered for the corresponding appContext and for all message layers shall be selected.
      • if no provider is selected according to the preceding rules, the provider specifically registered for the corresponding message layer and for all appContexts shall be selected.
      • if no provider is selected according to the preceding rules, the provider registered for all message layers and for all appContexts shall be selected.
      • if no provider is selected according to the preceding rules, the factory shall terminate its search for a registered provider.
    • registerConfigProvider

      public String registerConfigProvider(String className, Map properties, String layer, String appContext, String description)
      Registers within the factory, a provider of ServerAuthConfig and/or ClientAuthConfig objects for a message layer and application context identifier.

      At most one registration may exist within the factory for a given combination of message layer and appContext. Any pre-existing registration with identical values for layer and appContext is replaced by a subsequent registration. When replacement occurs, the registration identifier, layer, and appContext identifier remain unchanged, and the AuthConfigProvider (with initialization properties) and description are replaced.

      Within the lifetime of its Java process, a factory must assign unique registration identifiers to registrations, and must never assign a previously used registration identifier to a registration whose message layer and or appContext identifier differ from the previous use.

      Programmatic registrations performed via this method must update (according to the replacement rules described above), the persistent declarative representation of provider registrations employed by the factory constructor.

      Specified by:
      registerConfigProvider in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      className - the fully qualified name of an AuthConfigProvider implementation class. This argument must not be null.
      properties - a Map object containing the initialization properties to be passed to the provider constructor. This argument may be null. When this argument is not null, all the values and keys occuring in the Map must be of type String.
      layer - a String identifying the message layer for which the provider will be registered at the factory. A null value may be passed as an argument for this parameter, in which case, the provider is registered at all layers.
      appContext - a String value that may be used by a runtime to request a configuration object from this provider. A null value may be passed as an argument for this parameter, in which case, the provider is registered for all configuration ids (at the indicated layers).
      description - a text String descripting the provider. this value may be null.
      Returns:
      a String identifier assigned by the factory to the provider registration, and that may be used to remove the registration from the provider.
      Throws:
      SecurityException - if the caller does not have permission to register a provider at the factory.
    • registerConfigProvider

      public String registerConfigProvider(javax.security.auth.message.config.AuthConfigProvider provider, String layer, String appContext, String description)
      Specified by:
      registerConfigProvider in class javax.security.auth.message.config.AuthConfigFactory
    • removeRegistration

      public boolean removeRegistration(String registrationID)
      Remove the identified provider registration from the factory and invoke any listeners associated with the removed registration.
      Specified by:
      removeRegistration in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      registrationID - a String that identifies a provider registration at the factory
      Returns:
      true if there was a registration with the specified identifier and it was removed. Return false if the registraionID was invalid.
      Throws:
      SecurityException - if the caller does not have permission to unregister the provider at the factory.
    • detachListener

      public String[] detachListener(javax.security.auth.message.config.RegistrationListener listener, String layer, String appContext)
      Disassociate the listener from all the provider registrations whose layer and appContext values are matched by the corresponding arguments to this method.
      Specified by:
      detachListener in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      listener - the RegistrationListener to be detached.
      layer - a String identifying the message layer or null.
      appContext - a String value identifying the application contex or null.
      Returns:
      an array of String values where each value identifies a provider registration from which the listener was removed. This method never returns null; it returns an empty array if the listener was not removed from any registrations.
      Throws:
      SecurityException - if the caller does not have permission to detach the listener from the factory.
    • getRegistrationIDs

      public String[] getRegistrationIDs(javax.security.auth.message.config.AuthConfigProvider provider)
      Get the registration identifiers for all registrations of the provider instance at the factory.
      Specified by:
      getRegistrationIDs in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      provider - the AuthConfigurationProvider whose registration identifiers are to be returned. This argument may be null, in which case, it indicates that the the id's of all active registration within the factory are returned.
      Returns:
      an array of String values where each value identifies a provider registration at the factory. This method never returns null; it returns an empty array when their are no registrations at the factory for the identified provider.
    • getRegistrationContext

      public javax.security.auth.message.config.AuthConfigFactory.RegistrationContext getRegistrationContext(String registrationID)
      Get the the registration context for the identified registration.
      Specified by:
      getRegistrationContext in class javax.security.auth.message.config.AuthConfigFactory
      Parameters:
      registrationID - a String that identifies a provider registration at the factory
      Returns:
      a RegistrationContext or null. When a Non-null value is returned, it is a copy of the registration context corresponding to the registration. Null is returned when the registration identifier does not correpond to an active registration
    • refresh

      public void refresh()
      Cause the factory to reprocess its persisent declarative representation of provider registrations.

      A factory should only replace an existing registration when a change of provider implementation class or initialization properties has occured.

      Specified by:
      refresh in class javax.security.auth.message.config.AuthConfigFactory
      Throws:
      SecurityException - if the caller does not have permission to refresh the factory.
    • loadFromClasspath

      public static URL loadFromClasspath(String configFileName)