public class CredentialProviderFactory extends AbstractLogEnabled implements ExtensionPoint<CredentialProviderModel>, Initializable, ThreadSafe, Component, Serviceable, Contextualizable, Disposable
CredentialProvider
handled by the plugins.Modifier and Type | Class and Description |
---|---|
class |
CredentialProviderFactory.CredentialProviderModelParameterParser
Class for parsing parameters of a
CredentialProviderModel |
Modifier and Type | Field and Description |
---|---|
private Context |
_context |
private Map<String,CredentialProviderModel> |
_cpModels |
private ServiceManager |
_smanager |
static String |
ROLE
The avalon role
|
Constructor and Description |
---|
CredentialProviderFactory() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCredentialProviderModel(String pluginName,
Configuration configuration)
Add a credential provider model
|
void |
addExtension(String id,
String pluginName,
String featureName,
Configuration configuration)
Add an extension to this point.
|
protected void |
configureParamChecker(ParameterCheckerParser parser,
Configuration configuration,
String pluginName,
Map<String,ParameterCheckerDescriptor> parameterCheckers)
Configure a parameter checker of a user directory
|
protected void |
configureParameters(CredentialProviderFactory.CredentialProviderModelParameterParser paramParser,
Configuration configuration,
String pluginName,
Map<String,Parameter<ParameterHelper.ParameterType>> parameters)
Configure a parameter to access the credential provider
|
void |
contextualize(Context context) |
CredentialProvider |
createCredentialProvider(String id,
String modelId,
Map<String,Object> paramsValues,
String label)
Creates a instance of
CredentialProvider |
void |
dispose() |
CredentialProviderModel |
getExtension(String id)
Returns the named extension
|
Set<String> |
getExtensionsIds()
Returns a Set containing the ids of all known extensions
|
boolean |
hasExtension(String id)
Returns true if the named extension exists
|
void |
initialize() |
void |
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after all addExtension() calls.This is the last step before the actual startup of the application. |
void |
service(ServiceManager smanager) |
getLogger, setLogger
private Map<String,CredentialProviderModel> _cpModels
private ServiceManager _smanager
public CredentialProviderFactory()
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void dispose()
dispose
in interface Disposable
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public CredentialProvider createCredentialProvider(String id, String modelId, Map<String,Object> paramsValues, String label)
CredentialProvider
id
- The unique id of this credential provider instancemodelId
- The id of the credential provider modelparamsValues
- the parameters's valueslabel
- The optional labelpublic void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
ExtensionPoint
addExtension
in interface ExtensionPoint<CredentialProviderModel>
id
- the unique identifier of the extension.pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)configuration
- the information about the extension to be addedConfigurationException
- when a configuration problem occursprotected void addCredentialProviderModel(String pluginName, Configuration configuration) throws ConfigurationException
pluginName
- The plugin nameconfiguration
- The configurationConfigurationException
- when a configuration problem occursprotected void configureParameters(CredentialProviderFactory.CredentialProviderModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,Parameter<ParameterHelper.ParameterType>> parameters) throws ConfigurationException
paramParser
- the parameter parser.configuration
- The parameter configuration.pluginName
- The plugin nameparameters
- The model's parametersConfigurationException
- if configuration is incomplete or invalid.protected void configureParamChecker(ParameterCheckerParser parser, Configuration configuration, String pluginName, Map<String,ParameterCheckerDescriptor> parameterCheckers) throws ConfigurationException
parser
- the parameter checker parser.configuration
- The parameter checker configuration.pluginName
- The plugin nameparameterCheckers
- The model's parameter checkersConfigurationException
- if configuration is incomplete or invalid.public void initializeExtensions() throws Exception
ExtensionPoint
addExtension()
calls.initializeExtensions
in interface ExtensionPoint<CredentialProviderModel>
Exception
- if something wrong occurspublic boolean hasExtension(String id)
ExtensionPoint
hasExtension
in interface ExtensionPoint<CredentialProviderModel>
id
- the unique id of the extensionpublic CredentialProviderModel getExtension(String id)
ExtensionPoint
getExtension
in interface ExtensionPoint<CredentialProviderModel>
id
- the unique id of the extensionpublic Set<String> getExtensionsIds()
ExtensionPoint
getExtensionsIds
in interface ExtensionPoint<CredentialProviderModel>