Package org.ametys.core.right
Class RightsExtensionPoint
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.core.right.RightsExtensionPoint
-
- All Implemented Interfaces:
ExtensionPoint<Right>
,Initializable
,Component
,LogEnabled
,ThreadSafe
public class RightsExtensionPoint extends AbstractLogEnabled implements ExtensionPoint<Right>, Initializable, ThreadSafe, Component
This extension point handle a list of rights handled by the plugins or the application.
-
-
Constructor Summary
Constructors Constructor Description RightsExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtension(String id, String pluginName, String pluginId, Configuration configuration)
Add an extension to this point.void
addRight(String id, I18nizableText labelKey, I18nizableText descriptionKey, I18nizableText categoryKey)
Declare a new right as used.protected void
addRight(String pluginName, Configuration configuration)
Declare a new right (not as used)Right
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
toSAX(ContentHandler handler)
SAX all managed rights-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
RightsExtensionPoint
public RightsExtensionPoint()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPoint
Returns true if the named extension exists- Specified by:
hasExtension
in interfaceExtensionPoint<Right>
- Parameters:
id
- the unique id of the extension- Returns:
- true if the named extension exists
-
addExtension
public void addExtension(String id, String pluginName, String pluginId, 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<Right>
- Parameters:
id
- the unique identifier of the extension.pluginName
- Unique identifier for the plugin hosting the extensionpluginId
- Unique feature identifier (unique for a given pluginName)configuration
- the information about the extension to be added- Throws:
ConfigurationException
- when a configuration problem occurs
-
addRight
protected void addRight(String pluginName, Configuration configuration) throws ConfigurationException
Declare a new right (not as used)- Parameters:
pluginName
- The name of the plugin declaring the extensionconfiguration
- The configuration of the extension- Throws:
ConfigurationException
- if configuration if not complete
-
addRight
public void addRight(String id, I18nizableText labelKey, I18nizableText descriptionKey, I18nizableText categoryKey) throws IllegalArgumentException
Declare a new right as used. Use this method to add a right programmatically.- Parameters:
id
- The id of the right (not null or empty)labelKey
- The label of the right (i18n key) (not null or empty)descriptionKey
- The description of the right (i18n key) (not null or empty)categoryKey
- The category of the right (i18n key) (not null or empty)- Throws:
IllegalArgumentException
- if the id is already declared
-
getExtension
public Right getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<Right>
- 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<Right>
- Returns:
- a Set containing the ids of all known extensions
-
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<Right>
- Throws:
Exception
- if something wrong occurs
-
toSAX
public void toSAX(ContentHandler handler) throws SAXException
SAX all managed rights- Parameters:
handler
- the handler receiving SAX events- Throws:
SAXException
- if something wrong occurs
-
-