Package org.ametys.core.authentication
Class CredentialProviderFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.authentication.CredentialProviderFactory
-
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<CredentialProviderModel>
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
,ThreadSafe
public class CredentialProviderFactory extends AbstractLogEnabled implements ExtensionPoint<CredentialProviderModel>, Initializable, ThreadSafe, Component, Serviceable, Contextualizable, Disposable
This extension point handles a list ofCredentialProvider
handled by the plugins.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CredentialProviderFactory.CredentialProviderModelParameterParser
Class for parsing parameters of aCredentialProviderModel
-
Field Summary
Fields Modifier and Type Field Description protected CredentialProviderParameterTypeExtensionPoint
_credentialProviderParameterTypeExtensionPoint
The Credential Provider Parameter Extension Pointstatic String
ROLE
The avalon role
-
Constructor Summary
Constructors Constructor Description CredentialProviderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCredentialProviderModel(String pluginName, Configuration configuration)
Add a credential provider modelvoid
addExtension(String id, String pluginName, String featureName, Configuration configuration)
Add an extension to this point.protected void
configureParamChecker(ItemCheckerParser parser, Configuration configuration, String pluginName, Map<String,ItemCheckerDescriptor> parameterCheckers)
Configure a parameter checker of a user directoryprotected void
configureParameters(CredentialProviderFactory.CredentialProviderModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,ElementDefinition> parameters)
Configure a parameter to access the credential providervoid
contextualize(Context context)
CredentialProvider
createCredentialProvider(String id, String modelId, Map<String,Object> paramsValues, String label)
Creates a instance ofCredentialProvider
void
dispose()
CredentialProviderModel
getExtension(String id)
Returns the named extensionSet<String>
getExtensionsIds()
Returns a Set containing the ids of all known extensionsboolean
hasExtension(String id)
Returns true if the named extension existsvoid
initialize()
void
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_credentialProviderParameterTypeExtensionPoint
protected CredentialProviderParameterTypeExtensionPoint _credentialProviderParameterTypeExtensionPoint
The Credential Provider Parameter Extension Point
-
-
Constructor Detail
-
CredentialProviderFactory
public CredentialProviderFactory()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
createCredentialProvider
public CredentialProvider createCredentialProvider(String id, String modelId, Map<String,Object> paramsValues, String label)
Creates a instance ofCredentialProvider
- Parameters:
id
- The unique id of this credential provider instancemodelId
- The id of the credential provider modelparamsValues
- the parameters's valueslabel
- The optional label- Returns:
- a credential provider
-
addExtension
public void addExtension(String id, String pluginName, String featureName, Configuration configuration) throws ConfigurationException
Description copied from interface:ExtensionPoint
Add an extension to this point. Each implementation knows the meaning of the given configuration.- Specified by:
addExtension
in interfaceExtensionPoint<CredentialProviderModel>
- Parameters:
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 added- Throws:
ConfigurationException
- when a configuration problem occurs
-
addCredentialProviderModel
protected void addCredentialProviderModel(String pluginName, Configuration configuration) throws ConfigurationException
Add a credential provider model- Parameters:
pluginName
- The plugin nameconfiguration
- The configuration- Throws:
ConfigurationException
- when a configuration problem occurs
-
configureParameters
protected void configureParameters(CredentialProviderFactory.CredentialProviderModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,ElementDefinition> parameters) throws ConfigurationException
Configure a parameter to access the credential provider- Parameters:
paramParser
- the parameter parser.configuration
- The parameter configuration.pluginName
- The plugin nameparameters
- The model's parameters- Throws:
ConfigurationException
- if configuration is incomplete or invalid.
-
configureParamChecker
protected void configureParamChecker(ItemCheckerParser parser, Configuration configuration, String pluginName, Map<String,ItemCheckerDescriptor> parameterCheckers) throws ConfigurationException
Configure a parameter checker of a user directory- Parameters:
parser
- the parameter checker parser.configuration
- The parameter checker configuration.pluginName
- The plugin nameparameterCheckers
- The model's parameter checkers- Throws:
ConfigurationException
- if configuration is incomplete or invalid.
-
initializeExtensions
public void initializeExtensions() throws Exception
Description copied from interface:ExtensionPoint
Finalize the initialization of the extensions.
This method is called after alladdExtension()
calls.
This is the last step before the actual startup of the application.- Specified by:
initializeExtensions
in interfaceExtensionPoint<CredentialProviderModel>
- Throws:
Exception
- if something wrong occurs
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPoint
Returns true if the named extension exists- Specified by:
hasExtension
in interfaceExtensionPoint<CredentialProviderModel>
- Parameters:
id
- the unique id of the extension- Returns:
- true if the named extension exists
-
getExtension
public CredentialProviderModel getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<CredentialProviderModel>
- Parameters:
id
- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPoint
Returns a Set containing the ids of all known extensions- Specified by:
getExtensionsIds
in interfaceExtensionPoint<CredentialProviderModel>
- Returns:
- a Set containing the ids of all known extensions
-
-