Package org.ametys.core.group.directory
Class GroupDirectoryFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.group.directory.GroupDirectoryFactory
-
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<GroupDirectoryModel>
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
,ThreadSafe
public class GroupDirectoryFactory extends AbstractLogEnabled implements ExtensionPoint<GroupDirectoryModel>, Initializable, ThreadSafe, Component, Serviceable, Contextualizable, Disposable
This extension point handles a list ofGroupDirectoryModel
handled by the plugins.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
GroupDirectoryFactory.GroupDirectoryModelParameterParser
Class for parsing parameters of aGroupDirectoryModel
-
Field Summary
Fields Modifier and Type Field Description private Context
_context
protected GroupDirectoryParameterTypeExtensionPoint
_groupDirectoryParameterTypeExtensionPoint
The Group Directory parameters Extension Pointprivate Map<String,GroupDirectoryModel>
_models
private ServiceManager
_smanager
static String
ROLE
The avalon role
-
Constructor Summary
Constructors Constructor Description GroupDirectoryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtension(String id, String pluginName, String featureName, Configuration configuration)
Add an extension to this point.protected void
addGroupDirectoryModel(String pluginName, Configuration configuration)
Add a group directory modelprotected void
configureParameters(GroupDirectoryFactory.GroupDirectoryModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,ElementDefinition> parameters)
Configure a parameter to access the group directoryvoid
contextualize(Context context)
GroupDirectory
createGroupDirectory(String id, I18nizableText label, String modelId, Map<String,Object> paramsValues)
Creates a instance ofGroupDirectory
void
dispose()
GroupDirectoryModel
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
-
_groupDirectoryParameterTypeExtensionPoint
protected GroupDirectoryParameterTypeExtensionPoint _groupDirectoryParameterTypeExtensionPoint
The Group Directory parameters Extension Point
-
_models
private Map<String,GroupDirectoryModel> _models
-
_smanager
private ServiceManager _smanager
-
-
Constructor Detail
-
GroupDirectoryFactory
public GroupDirectoryFactory()
-
-
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
-
createGroupDirectory
public GroupDirectory createGroupDirectory(String id, I18nizableText label, String modelId, Map<String,Object> paramsValues)
Creates a instance ofGroupDirectory
- Parameters:
id
- The id of the group directorylabel
- The label of the group directorymodelId
- The id of the group directory modelparamsValues
- The parameters's values- Returns:
- a group directory
-
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<GroupDirectoryModel>
- 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
-
addGroupDirectoryModel
protected void addGroupDirectoryModel(String pluginName, Configuration configuration) throws ConfigurationException
Add a group directory model- Parameters:
pluginName
- The plugin nameconfiguration
- The configuration- Throws:
ConfigurationException
- when a configuration problem occurs
-
configureParameters
protected void configureParameters(GroupDirectoryFactory.GroupDirectoryModelParameterParser paramParser, Configuration configuration, String pluginName, Map<String,ElementDefinition> parameters) throws ConfigurationException
Configure a parameter to access the group directory- 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.
-
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<GroupDirectoryModel>
- 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<GroupDirectoryModel>
- Parameters:
id
- the unique id of the extension- Returns:
- true if the named extension exists
-
getExtension
public GroupDirectoryModel getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<GroupDirectoryModel>
- 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<GroupDirectoryModel>
- Returns:
- a Set containing the ids of all known extensions
-
-