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 of
CredentialProvider
handled by the plugins.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionThe Credential Provider Parameter Extension Pointstatic final String
The avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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) Creates a instance ofCredentialProvider
void
dispose()
getExtension
(String id) Returns the named extensionReturns a Set containing the ids of all known extensionsboolean
hasExtension
(String id) Returns true if the named extension existsvoid
void
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 Details
-
ROLE
The avalon role -
_credentialProviderParameterTypeExtensionPoint
protected CredentialProviderParameterTypeExtensionPoint _credentialProviderParameterTypeExtensionPointThe Credential Provider Parameter Extension Point
-
-
Constructor Details
-
CredentialProviderFactory
public CredentialProviderFactory()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- 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 ConfigurationExceptionConfigure 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 ConfigurationExceptionConfigure 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
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
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
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
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
-