public class RightsExtensionPoint extends AbstractLogEnabled implements ExtensionPoint<Right>, Initializable, ThreadSafe, Component
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Right> |
_rights
The map of rightId, Right of declared rights
|
static String |
ROLE
The avalon role
|
| Constructor and Description |
|---|
RightsExtensionPoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(String id,
String pluginName,
String pluginId,
Configuration configuration)
Add an extension to this point.
|
protected void |
addRight(String pluginName,
Configuration configuration)
Declare a new right (not as used)
|
void |
addRight(String id,
I18nizableText labelKey,
I18nizableText descriptionKey,
I18nizableText categoryKey)
Declare a new right as used.
|
Right |
getExtension(String id)
Returns the named extension
|
Set<String> |
getExtensionsIds()
Returns a Set containing the ids of all known extensions
|
boolean |
hasExtension(String id)
Returns true if the named extension exists
|
void |
initialize() |
void |
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after all addExtension() calls.This is the last step before the actual startup of the application. |
void |
toSAX(ContentHandler handler)
SAX all managed rights
|
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic RightsExtensionPoint()
public void initialize() throws Exception
initialize in interface InitializableExceptionpublic boolean hasExtension(String id)
ExtensionPointhasExtension in interface ExtensionPoint<Right>id - the unique id of the extensionpublic void addExtension(String id, String pluginName, String pluginId, Configuration configuration) throws ConfigurationException
ExtensionPointaddExtension in interface ExtensionPoint<Right>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 addedConfigurationException - when a configuration problem occursprotected void addRight(String pluginName, Configuration configuration) throws ConfigurationException
pluginName - The name of the plugin declaring the extensionconfiguration - The configuration of the extensionConfigurationException - if configuration if not completepublic void addRight(String id, I18nizableText labelKey, I18nizableText descriptionKey, I18nizableText categoryKey) throws IllegalArgumentException
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)IllegalArgumentException - if the id is already declaredpublic Right getExtension(String id)
ExtensionPointgetExtension in interface ExtensionPoint<Right>id - the unique id of the extensionpublic Set<String> getExtensionsIds()
ExtensionPointgetExtensionsIds in interface ExtensionPoint<Right>public void initializeExtensions() throws Exception
ExtensionPointaddExtension() calls.initializeExtensions in interface ExtensionPoint<Right>Exception - if something wrong occurspublic void toSAX(ContentHandler handler) throws SAXException
handler - the handler receiving SAX eventsSAXException - if something wrong occurs