public class JBossAuthConfigFactory extends AuthConfigFactory
AuthConfigFactory.RegistrationContext
DEFAULT_FACTORY_SECURITY_PROPERTY, GET_FACTORY_PERMISSION_NAME, getFactorySecurityPermission, PROVIDER_REGISTRATION_PERMISSION_NAME, providerRegistrationSecurityPermission, SET_FACTORY_PERMISSION_NAME, setFactorySecurityPermission
Constructor and Description |
---|
JBossAuthConfigFactory()
Creates an instance of
JBossAuthConfigFactory . |
Modifier and Type | Method and Description |
---|---|
String[] |
detachListener(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.
|
AuthConfigProvider |
getConfigProvider(String layer,
String appContext,
RegistrationListener listener)
Get a registered AuthConfigProvider from the factory.
|
AuthConfigFactory.RegistrationContext |
getRegistrationContext(String registrationID)
Get the the registration context for the identified registration.
|
String[] |
getRegistrationIDs(AuthConfigProvider provider)
Get the registration identifiers for all registrations of the provider instance at the factory.
|
void |
refresh()
Cause the factory to reprocess its persistent declarative representation of provider registrations.
|
String |
registerConfigProvider(AuthConfigProvider provider,
String layer,
String appContext,
String description)
Registers within the (in-memory) factory, a provider of ServerAuthConfig and/or ClientAuthConfig objects for a
message layer and application context identifier.
|
String |
registerConfigProvider(String className,
Map properties,
String layer,
String appContext,
String description)
Registers within the factory and records within the factory's persistent declarative representation of provider
registrations a provider of ServerAuthConfig and/or ClientAuthConfig objects for a message layer and application
context identifier.
|
boolean |
removeRegistration(String registrationID)
Remove the identified provider registration from the factory (and from the persistent declarative representation of
provider registrations, if appropriate) and invoke any listeners associated with the removed registration.
|
getFactory, setFactory
public JBossAuthConfigFactory()
Creates an instance of JBossAuthConfigFactory
.
public String[] detachListener(RegistrationListener listener, String layer, String appContext)
AuthConfigFactory
Factories should periodically notify Listeners to effectively detach listeners that are no longer in use.
When a SecurityManager is enabled, and before making any changes to the factory, this method must confirm that the
calling access control context has been granted the AuthConfigFactory.providerRegistrationSecurityPermission
detachListener
in class AuthConfigFactory
listener
- The RegistrationListener to be detached.layer
- A String identifying the message layer or null.appContext
- A String value identifying the application context or null.public AuthConfigProvider getConfigProvider(String layer, String appContext, RegistrationListener listener)
AuthConfigFactory
All factories shall employ the following precedence rules to select the registered AuthConfigProvider that matches the layer and appContext arguments:
The above precedence rules apply equivalently to registrations created with a null or non-null className
argument.
getConfigProvider
in class AuthConfigFactory
layer
- A String identifying the message layer for which the registered AuthConfigProvider is to be returned.
The value of this argument may be null.appContext
- A String that identifies the application messaging context for which the registered
AuthConfigProvider is to be returned. The value of 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.public AuthConfigFactory.RegistrationContext getRegistrationContext(String registrationID)
AuthConfigFactory
getRegistrationContext
in class AuthConfigFactory
registrationID
- A String that identifies a provider registration at the factorypublic String[] getRegistrationIDs(AuthConfigProvider provider)
AuthConfigFactory
getRegistrationIDs
in class AuthConfigFactory
provider
- The AuthConfigurationProvider whose registration identifiers are to be returned. This argument may be
null, in which case it indicates that the IDs of all active registrations within the factory are to be returned.public void refresh()
AuthConfigFactory
A factory should only replace an existing registration when a change of provider implementation class or initialization properties has occurred.
When a SecurityManager is enabled, and before the point where this method could have caused any changes to the
factory, this method must confirm that the calling access control context has been granted the
AuthConfigFactory.providerRegistrationSecurityPermission
refresh
in class AuthConfigFactory
public String registerConfigProvider(String className, Map properties, String layer, String appContext, String description)
AuthConfigFactory
This method employs the two argument constructor required to be supported by every implementation of the
AuthConfigProvider interface, and this method must pass a null value for the factory argument of the constructor.
AuthConfigProviderImpl AuthConfigProviderImpl(Map properties,
AuthConfigFactory factory)
.
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 by using this method must update (according to the replacement rules described above) the persistent declarative representation of provider registrations employed by the factory constructor.
When a SecurityManager is enabled, before loading the argument provider, and before making any changes to the
factory, this method must confirm that the calling access control context has been granted the
AuthConfigFactory.providerRegistrationSecurityPermission
registerConfigProvider
in class AuthConfigFactory
className
- The fully qualified name of an AuthConfigProvider implementation class (or null). Calling this
method with a null value for this parameter shall cause getConfigProvider
to return null when it is
called with layer and appContext values for which the resulting registration is the best match.properties
- A Map object containing the initialization properties to be passed to the properties argument of
the provider constructor. This argument may be null. When this argument is not null, all the values and keys
occurring 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 describing the provider. This value may be null.public String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description)
AuthConfigFactory
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.
When a SecurityManager is enabled, and before making any changes to the factory, this method must confirm that the
calling access control context has been granted the AuthConfigFactory.providerRegistrationSecurityPermission
registerConfigProvider
in class AuthConfigFactory
provider
- The AuthConfigProvider to be registered at the factory (or null). Calling this method with a null
value for this parameter shall cause getConfigProvider
to return null when it is called with layer and
appContext values for which the resulting registration is the best match.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 describing the provider. This value may be null.public boolean removeRegistration(String registrationID)
AuthConfigFactory
When a SecurityManager is enabled, and before making any changes to the factory, this method must confirm that the
calling access control context has been granted the AuthConfigFactory.providerRegistrationSecurityPermission
removeRegistration
in class AuthConfigFactory
registrationID
- A String that identifies a provider registration at the factoryCopyright © 2021 JBoss by Red Hat. All rights reserved.