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 ofCredentialProviderhandled by the plugins.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCredentialProviderFactory.CredentialProviderModelParameterParserClass for parsing parameters of aCredentialProviderModel
-
Field Summary
Fields Modifier and Type Field Description private Context_contextprivate Map<String,CredentialProviderModel>_cpModelsprotected CredentialProviderParameterTypeExtensionPoint_credentialProviderParameterTypeExtensionPointThe Credential Provider Parameter Extension Pointprivate ServiceManager_smanagerstatic StringROLEThe avalon role
-
Constructor Summary
Constructors Constructor Description CredentialProviderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCredentialProviderModel(String pluginName, Configuration configuration)Add a credential provider modelvoidaddExtension(String id, String pluginName, String featureName, Configuration configuration)Add an extension to this point.protected voidconfigureParamChecker(ItemCheckerParser parser, Configuration configuration, String pluginName, Map<String,ItemCheckerDescriptor> parameterCheckers)Configure a parameter checker of a user directoryprotected voidconfigureParameters(CredentialProviderFactory.CredentialProviderModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,ElementDefinition> parameters)Configure a parameter to access the credential providervoidcontextualize(Context context)CredentialProvidercreateCredentialProvider(String id, String modelId, Map<String,Object> paramsValues, String label)Creates a instance ofCredentialProvidervoiddispose()CredentialProviderModelgetExtension(String id)Returns the named extensionSet<String>getExtensionsIds()Returns a Set containing the ids of all known extensionsbooleanhasExtension(String id)Returns true if the named extension existsvoidinitialize()voidinitializeExtensions()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.voidservice(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
-
_cpModels
private Map<String,CredentialProviderModel> _cpModels
-
_smanager
private ServiceManager _smanager
-
-
Constructor Detail
-
CredentialProviderFactory
public CredentialProviderFactory()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein 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:ExtensionPointAdd an extension to this point. Each implementation knows the meaning of the given configuration.- Specified by:
addExtensionin 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:ExtensionPointFinalize 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:
initializeExtensionsin interfaceExtensionPoint<CredentialProviderModel>- Throws:
Exception- if something wrong occurs
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPointReturns true if the named extension exists- Specified by:
hasExtensionin 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:ExtensionPointReturns the named extension- Specified by:
getExtensionin interfaceExtensionPoint<CredentialProviderModel>- Parameters:
id- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPointReturns a Set containing the ids of all known extensions- Specified by:
getExtensionsIdsin interfaceExtensionPoint<CredentialProviderModel>- Returns:
- a Set containing the ids of all known extensions
-
-