Package org.opensaml.xmlsec.keyinfo
Class NamedKeyInfoGeneratorManager
java.lang.Object
org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager
A manager for named sets of
KeyInfoGeneratorFactory
instances. Each name key serves as an index to an
instance of KeyInfoGeneratorManager
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyInfoGeneratorManager
The default manager for unnamed factories.private final org.slf4j.Logger
Logger.private final Map<String,
KeyInfoGeneratorManager> The set of named factory managers.private boolean
Flag indicating whether the default (unnamed) factory manager will be used to lookup factories for credentials. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
De-register a factory with the default (unnamed) manager.void
deregisterFactory
(String name, KeyInfoGeneratorFactory factory) De-register a factory within the specified named manager.Get the default (unnamed) factory manager.getFactory
(String name, Credential credential) Lookup and return the named generator factory for the type of the credential specified.getManager
(String name) Get the named factory manager.Get the (unmodifiable) set of names of factory managers currently available.void
Register a factory with the default (unnamed) manager.void
registerFactory
(String name, KeyInfoGeneratorFactory factory) Register a factory within the specified named manager.void
removeManager
(String name) Remove the named factory manager, and all its managed factories.void
setUseDefaultManager
(boolean newValue) Set the option as to whether the default (unnamed) manager will be used to lookup factories for credentials if there is no appropriate named factory for the credential type.
-
Field Details
-
log
private final org.slf4j.Logger logLogger. -
managers
The set of named factory managers. -
defaultManager
The default manager for unnamed factories. -
useDefaultManager
private boolean useDefaultManagerFlag indicating whether the default (unnamed) factory manager will be used to lookup factories for credentials.
-
-
Constructor Details
-
NamedKeyInfoGeneratorManager
public NamedKeyInfoGeneratorManager()Constructor.
-
-
Method Details
-
setUseDefaultManager
public void setUseDefaultManager(boolean newValue) Set the option as to whether the default (unnamed) manager will be used to lookup factories for credentials if there is no appropriate named factory for the credential type.- Parameters:
newValue
- the new option value
-
getManagerNames
Get the (unmodifiable) set of names of factory managers currently available.- Returns:
- the set of all manager names currently configured
-
getManager
Get the named factory manager. If it doesn't exist yet, one will be created.- Parameters:
name
- the name of the manager to obtain- Returns:
- the named manager
-
removeManager
Remove the named factory manager, and all its managed factories.- Parameters:
name
- the name of the manager to remove
-
registerFactory
Register a factory within the specified named manager. If that named manager does not currently exist, it will be created.- Parameters:
name
- the name of the factory managerfactory
- the factory to register
-
deregisterFactory
De-register a factory within the specified named manager.- Parameters:
name
- the name of the factory managerfactory
- the factory to de-register
-
registerDefaultFactory
Register a factory with the default (unnamed) manager.- Parameters:
factory
- the factory to register
-
deregisterDefaultFactory
De-register a factory with the default (unnamed) manager.- Parameters:
factory
- the factory to de-register
-
getDefaultManager
Get the default (unnamed) factory manager.- Returns:
- the default factory manager
-
getFactory
@Nullable public KeyInfoGeneratorFactory getFactory(@Nonnull String name, @Nonnull Credential credential) Lookup and return the named generator factory for the type of the credential specified.- Parameters:
name
- the name of the factory mangercredential
- the credential to evaluate- Returns:
- a factory for generators appropriate for the specified credential
-