Package org.opensaml.xmlsec.keyinfo
Class KeyInfoGeneratorManager
- java.lang.Object
-
- org.opensaml.xmlsec.keyinfo.KeyInfoGeneratorManager
-
public class KeyInfoGeneratorManager extends Object
A manager forKeyInfoGeneratorFactory
instances. Factories are uniquely indexed according to the value returned byKeyInfoGeneratorFactory.getCredentialType()
.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<Class<? extends org.opensaml.security.credential.Credential>,KeyInfoGeneratorFactory>
factories
The factories being managed, indexed by credential type.
-
Constructor Summary
Constructors Constructor Description KeyInfoGeneratorManager()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregisterFactory(KeyInfoGeneratorFactory factory)
De-register a factory within this manager instance.Collection<KeyInfoGeneratorFactory>
getFactories()
Get the (unmodifiable) collection of all factories managed by this manager.KeyInfoGeneratorFactory
getFactory(org.opensaml.security.credential.Credential credential)
Get the factory which produces KeyInfoGenerators which can handle the specified credential.void
registerFactory(KeyInfoGeneratorFactory factory)
Register a factory within this manager instance.
-
-
-
Field Detail
-
factories
private final Map<Class<? extends org.opensaml.security.credential.Credential>,KeyInfoGeneratorFactory> factories
The factories being managed, indexed by credential type.
-
-
Method Detail
-
registerFactory
public void registerFactory(@Nonnull KeyInfoGeneratorFactory factory)
Register a factory within this manager instance. If a factory already exists for that credential type, it will be replaced.- Parameters:
factory
- the factory to register
-
deregisterFactory
public void deregisterFactory(@Nonnull KeyInfoGeneratorFactory factory)
De-register a factory within this manager instance.- Parameters:
factory
- the factory to de-register
-
getFactories
@Nonnull public Collection<KeyInfoGeneratorFactory> getFactories()
Get the (unmodifiable) collection of all factories managed by this manager.- Returns:
- the collection of managed factories
-
getFactory
@Nullable public KeyInfoGeneratorFactory getFactory(@Nonnull org.opensaml.security.credential.Credential credential)
Get the factory which produces KeyInfoGenerators which can handle the specified credential.- Parameters:
credential
- the credential for which to locate a factory- Returns:
- a KeyInfoGeneratorFactory instance appropriate for the credential
-
-