Class ConfigurationInstanceImpl
- java.lang.Object
-
- com.sun.identity.plugin.configuration.impl.ConfigurationInstanceImpl
-
- All Implemented Interfaces:
ConfigurationInstance
public class ConfigurationInstanceImpl extends Object implements ConfigurationInstance
ConfigurationInstanceImplis the implementation that provides the operations on service configuration.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationInstanceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddListener(ConfigurationListener listener)Registers for changes to the component's configuration.voidcreateConfiguration(String realm, String configName, Map avPairs)Creates Configurations.voiddeleteConfiguration(String realm, String configName, Set attributes)Deletes Configuration.SetgetAllConfigurationNames(String realm)Returns all service config name for this components.MapgetConfiguration(String realm, String configName)Returns Configurations.voidinit(String componentName, Object session)Initializer.voidremoveListener(String listenerID)Unregisters the listener from the component for the given listener ID.voidsetConfiguration(String realm, String configName, Map avPairs)Sets Configurations.
-
-
-
Method Detail
-
init
public void init(String componentName, Object session) throws ConfigurationException
Initializer.- Specified by:
initin interfaceConfigurationInstance- Parameters:
componentName- Name of the components, e.g. SAML1, SAML2, ID-FFsession- FM Session object.- Throws:
ConfigurationException- if could not initialize the instance.
-
getConfiguration
public Map getConfiguration(String realm, String configName) throws ConfigurationException
Returns Configurations.- Specified by:
getConfigurationin interfaceConfigurationInstance- Parameters:
realm- the name of organization at which the configuration resides.configName- configuration instance name. e.g. "/sp". The configName could be null or empty string, which means the default configuration for this components.- Returns:
- Map of key/value pairs, key is the attribute name, value is a Set of attribute values or null if service configuration doesn't doesn't exist. If the configName parameter is null or empty, and OrganizationalConfig state is present, this state will be merged with the GlobalConfig attributes, with the OrganizationConfig attributes over-writing the GlobalConfig attributes, in case GlobalConfig and OrganizationConfig attributes share the same key.
- Throws:
ConfigurationException- if an error occurred while getting service configuration.
-
setConfiguration
public void setConfiguration(String realm, String configName, Map avPairs) throws ConfigurationException
Sets Configurations.- Specified by:
setConfigurationin interfaceConfigurationInstance- Parameters:
realm- the name of organization at which the configuration resides.configName- configuration instance name. e.g. "/sp" The configName could be null or empty string, which means the default configuration for this components.avPairs- Map of key/value pairs to be set in the service configuration, key is the attribute name, value is a Set of attribute values.- Throws:
ConfigurationException- if could not set service configuration or service configuration doesn't exist.
-
createConfiguration
public void createConfiguration(String realm, String configName, Map avPairs) throws ConfigurationException
Creates Configurations.- Specified by:
createConfigurationin interfaceConfigurationInstance- Parameters:
realm- the name of organization at which the configuration resides.configName- service configuration name. e.g. "/sp" The configName could be null or empty string, which means the default configuration for this components.avPairs- Map of key/value pairs to be set in the service configuration, key is the attribute name, value is a Set of attribute values.- Throws:
ConfigurationException- if could not create service configuration.
-
deleteConfiguration
public void deleteConfiguration(String realm, String configName, Set attributes) throws ConfigurationException
Deletes Configuration.- Specified by:
deleteConfigurationin interfaceConfigurationInstance- Parameters:
realm- the name of organization at which the configuration resides.configName- service configuration name. e.g. "/sp" The configName could be null or empty string, which means the default configuration for this components.attributes- A set of attributes to be deleted from the Service configuration. If the value is null or empty, deletes all service configuration.- Throws:
ConfigurationException- if could not delete service configuration.
-
getAllConfigurationNames
public Set getAllConfigurationNames(String realm) throws ConfigurationException
Returns all service config name for this components.- Specified by:
getAllConfigurationNamesin interfaceConfigurationInstance- Parameters:
realm- the name of organization at which the configuration resides.- Returns:
- Set of service configuration names. Return null if there is no service configuration for this component, return empty set if there is only default configuration instance.
- Throws:
ConfigurationException- if could not get all service configuration names.
-
addListener
public String addListener(ConfigurationListener listener) throws ConfigurationException
Registers for changes to the component's configuration. The object will be called when configuration for this component is changed.- Specified by:
addListenerin interfaceConfigurationInstance- Returns:
- the registered id for this listener instance.
- Throws:
ConfigurationException- if could not register the listener.
-
removeListener
public void removeListener(String listenerID) throws ConfigurationException
Unregisters the listener from the component for the given listener ID. The ID was issued when the listener was registered.- Specified by:
removeListenerin interfaceConfigurationInstance- Parameters:
listenerID- the returned id when the listener was registered.- Throws:
ConfigurationException- if could not register the listener.
-
-