Package org.opensaml.xmlsec.keyinfo
Class NamedKeyInfoGeneratorManager
- java.lang.Object
-
- org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager
-
public class NamedKeyInfoGeneratorManager extends Object
A manager for named sets ofKeyInfoGeneratorFactoryinstances. Each name key serves as an index to an instance ofKeyInfoGeneratorManager.
-
-
Field Summary
Fields Modifier and Type Field Description private KeyInfoGeneratorManagerdefaultManagerThe default manager for unnamed factories.private org.slf4j.LoggerlogLogger.private Map<String,KeyInfoGeneratorManager>managersThe set of named factory managers.private booleanuseDefaultManagerFlag indicating whether the default (unnamed) factory manager will be used to lookup factories for credentials.
-
Constructor Summary
Constructors Constructor Description NamedKeyInfoGeneratorManager()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidderegisterDefaultFactory(KeyInfoGeneratorFactory factory)De-register a factory with the default (unnamed) manager.voidderegisterFactory(String name, KeyInfoGeneratorFactory factory)De-register a factory within the specified named manager.KeyInfoGeneratorManagergetDefaultManager()Get the default (unnamed) factory manager.KeyInfoGeneratorFactorygetFactory(String name, Credential credential)Lookup and return the named generator factory for the type of the credential specified.KeyInfoGeneratorManagergetManager(String name)Get the named factory manager.Set<String>getManagerNames()Get the (unmodifiable) set of names of factory managers currently available.voidregisterDefaultFactory(KeyInfoGeneratorFactory factory)Register a factory with the default (unnamed) manager.voidregisterFactory(String name, KeyInfoGeneratorFactory factory)Register a factory within the specified named manager.voidremoveManager(String name)Remove the named factory manager, and all its managed factories.voidsetUseDefaultManager(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 Detail
-
log
private final org.slf4j.Logger log
Logger.
-
managers
private final Map<String,KeyInfoGeneratorManager> managers
The set of named factory managers.
-
defaultManager
private final KeyInfoGeneratorManager defaultManager
The default manager for unnamed factories.
-
useDefaultManager
private boolean useDefaultManager
Flag indicating whether the default (unnamed) factory manager will be used to lookup factories for credentials.
-
-
Method Detail
-
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
@Nonnull public Set<String> getManagerNames()
Get the (unmodifiable) set of names of factory managers currently available.- Returns:
- the set of all manager names currently configured
-
getManager
@Nonnull public KeyInfoGeneratorManager getManager(@Nonnull String name)
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
public void removeManager(@Nonnull String name)Remove the named factory manager, and all its managed factories.- Parameters:
name- the name of the manager to remove
-
registerFactory
public void registerFactory(@Nonnull String name, @Nonnull KeyInfoGeneratorFactory factory)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
public void deregisterFactory(@Nonnull String name, @Nonnull KeyInfoGeneratorFactory factory)De-register a factory within the specified named manager.- Parameters:
name- the name of the factory managerfactory- the factory to de-register
-
registerDefaultFactory
public void registerDefaultFactory(@Nonnull KeyInfoGeneratorFactory factory)Register a factory with the default (unnamed) manager.- Parameters:
factory- the factory to register
-
deregisterDefaultFactory
public void deregisterDefaultFactory(@Nonnull KeyInfoGeneratorFactory factory)De-register a factory with the default (unnamed) manager.- Parameters:
factory- the factory to de-register
-
getDefaultManager
@Nonnull public KeyInfoGeneratorManager 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
-
-