public abstract class BaseAuthConfigFactory extends javax.security.auth.message.config.AuthConfigFactory
javax.security.auth.message.config.AuthConfigFactory.RegistrationContext| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONF_FILE_NAME |
static Lock |
readLock |
static Lock |
writeLock |
DEFAULT_FACTORY_SECURITY_PROPERTY, GET_FACTORY_PERMISSION_NAME, getFactorySecurityPermission, PROVIDER_REGISTRATION_PERMISSION_NAME, providerRegistrationSecurityPermission, SET_FACTORY_PERMISSION_NAME, setFactorySecurityPermission| Constructor and Description |
|---|
BaseAuthConfigFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_loadFactory() |
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.
|
protected <T> T |
doReadLocked(Supplier<T> supplier) |
protected void |
doWriteLocked(Runnable runnable) |
protected <T> T |
doWriteLocked(Supplier<T> supplier) |
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 |
getRegistrationContext(String registrationID)
Get the the registration context for the identified registration.
|
String[] |
getRegistrationIDs(javax.security.auth.message.config.AuthConfigProvider provider)
Get the registration identifiers for all registrations of the provider instance at the factory.
|
protected abstract RegStoreFileParser |
getRegStore() |
void |
refresh()
Cause the factory to reprocess its persistent declarative representation of provider registrations.
|
String |
registerConfigProvider(javax.security.auth.message.config.AuthConfigProvider provider,
String layer,
String appContext,
String description) |
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.
|
boolean |
removeRegistration(String registrationID)
Remove the identified provider registration from the factory and invoke any listeners associated with the removed
registration.
|
getFactory, setFactorypublic static final Lock readLock
public static final Lock writeLock
protected static final String CONF_FILE_NAME
public javax.security.auth.message.config.AuthConfigProvider getConfigProvider(String layer, String appContext, javax.security.auth.message.config.RegistrationListener listener)
All factories shall employ the following precedence rules to select the registered AuthConfigProvider that matches (via matchConstructors) the layer and appContext arguments:
getConfigProvider in class javax.security.auth.message.config.AuthConfigFactorylayer - a String identifying the message layer for which the registered AuthConfigProvider is to be returned.
This argument may be null.appContext - a String that identifies 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.public String registerConfigProvider(String className, Map properties, String layer, String appContext, String description)
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.
registerConfigProvider in class javax.security.auth.message.config.AuthConfigFactoryclassName - 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 describing the provider. this value may be null.SecurityException - if the caller does not have permission to register a provider at the factory.javax.security.auth.message.AuthException - if the provider construction or registration fails.public String registerConfigProvider(javax.security.auth.message.config.AuthConfigProvider provider, String layer, String appContext, String description)
registerConfigProvider in class javax.security.auth.message.config.AuthConfigFactorypublic boolean removeRegistration(String registrationID)
removeRegistration in class javax.security.auth.message.config.AuthConfigFactoryregistrationID - a String that identifies a provider registration at the factorySecurityException - if the caller does not have permission to unregister the provider at the factory.public String[] detachListener(javax.security.auth.message.config.RegistrationListener listener, String layer, String appContext)
detachListener in class javax.security.auth.message.config.AuthConfigFactorylistener - the RegistrationListener to be detached.layer - a String identifying the message layer or null.appContext - a String value identifying the application context or null.SecurityException - if the caller does not have permission to detach the listener from the factory.public String[] getRegistrationIDs(javax.security.auth.message.config.AuthConfigProvider provider)
getRegistrationIDs in class javax.security.auth.message.config.AuthConfigFactoryprovider - 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.public javax.security.auth.message.config.AuthConfigFactory.RegistrationContext getRegistrationContext(String registrationID)
getRegistrationContext in class javax.security.auth.message.config.AuthConfigFactoryregistrationID - a String that identifies a provider registration at the factorypublic void refresh()
A factory should only replace an existing registration when a change of provider implementation class or initialization properties has occurred.
refresh in class javax.security.auth.message.config.AuthConfigFactoryjavax.security.auth.message.AuthException - if an error occurred during the reinitialization.SecurityException - if the caller does not have permission to refresh the factory.protected abstract RegStoreFileParser getRegStore()
protected void _loadFactory()
protected <T> T doReadLocked(Supplier<T> supplier)
protected <T> T doWriteLocked(Supplier<T> supplier)
protected void doWriteLocked(Runnable runnable)
Copyright © 2019. All rights reserved.