Class ConfigurationInstanceImpl

  • All Implemented Interfaces:
    ConfigurationInstance

    public class ConfigurationInstanceImpl
    extends Object
    implements ConfigurationInstance
    ConfigurationInstanceImpl is the implementation that provides the operations on service configuration.
    • Constructor Detail

      • ConfigurationInstanceImpl

        public ConfigurationInstanceImpl()
    • Method Detail

      • getConfiguration

        public Map getConfiguration​(String realm,
                                    String configName)
                             throws ConfigurationException
        Returns Configurations.
        Specified by:
        getConfiguration in interface ConfigurationInstance
        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:
        setConfiguration in interface ConfigurationInstance
        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:
        createConfiguration in interface ConfigurationInstance
        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:
        deleteConfiguration in interface ConfigurationInstance
        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:
        getAllConfigurationNames in interface ConfigurationInstance
        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.
      • 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:
        removeListener in interface ConfigurationInstance
        Parameters:
        listenerID - the returned id when the listener was registered.
        Throws:
        ConfigurationException - if could not register the listener.