Package org.castor.ddlgen
Class KeyGeneratorRegistry
java.lang.Object
org.castor.ddlgen.KeyGeneratorRegistry
Registry for key generator factory implementations obtained from the configuration.
In addition this is also a registry for key generators that holds default key
generators as well as key generators defined through mapping.
- Since:
- 1.1
- Version:
- $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Le Duc Bao, Ralf Joachim
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance of each key generator factory specified in given configuration. -
Method Summary
Modifier and TypeMethodDescriptioncreateKeyGenerator
(KeyGeneratorDef definition) Create an instance of the key generator specifed by given definiton.getKeyGenerator
(String alias) Returns key generator with given alias.Returns a collection of the aliasses of current registered key generators.Returns a collection of the current configured key generator factories.getKeyGeneratorFactory
(String algorithm) Returns key generator factory with given algorithm.Returns a collection of the algorithms of current configured key generator factories.Returns a collection of the current registered key generators.
-
Constructor Details
-
KeyGeneratorRegistry
Construct an instance of each key generator factory specified in given configuration. If key generator does not require mandatory parameters a default instance of the key generator will also be created.- Parameters:
config
- The configuration to obtain the key generator factory classes from. Also used for all key generator instances to obtain configuration properties from.
-
-
Method Details
-
createKeyGenerator
Create an instance of the key generator specifed by given definiton. The name of the definition is used as algorithm to lookup the key generator factory. The is used to create a key generator initialized with the given definition and the configuration that has been passed to the constructor of this registry. At least the key generator is added to the registry assoziated by its alias.- Parameters:
definition
- The definition to initialize the key generator.- Returns:
- A key generator instance initialized with given definition.
- Throws:
GeneratorException
- If failed to create a key generator instance.
-
getKeyGeneratorFactory
Returns key generator factory with given algorithm.- Parameters:
algorithm
- Algorithm of the key generator factory.- Returns:
- Key generator factory with algorithm.
- Throws:
GeneratorException
- If no key generator factory with given algorithm can be found.
-
getKeyGeneratorFactories
Returns a collection of the current configured key generator factories.- Returns:
- Collection of the current configured key generator factories.
-
getKeyGeneratorFactoryAlgorithms
Returns a collection of the algorithms of current configured key generator factories.- Returns:
- Algorithms of current configured key generator factories.
-
getKeyGenerator
Returns key generator with given alias.- Parameters:
alias
- Alias of the key generator.- Returns:
- Generator with given alias.
- Throws:
GeneratorException
- If no generator for alias can be found.
-
getKeyGenerators
Returns a collection of the current registered key generators.- Returns:
- Collection of the current registered key generators.
-
getKeyGeneratorAliases
Returns a collection of the aliasses of current registered key generators.- Returns:
- Aliasses of current registered key generators.
-