Class FedletConfigurationImpl

  • All Implemented Interfaces:
    ConfigurationInstance

    public class FedletConfigurationImpl
    extends Object
    implements ConfigurationInstance
    The FedletConfigurationImpl class is the implementation for Fedlet to retrieve metadata/COT configuration from flat files.
    • Constructor Detail

      • FedletConfigurationImpl

        public FedletConfigurationImpl()
    • 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.
        Throws:
        ConfigurationException - if an error occurred while getting service configuration.
      • toValSet

        protected Set toValSet​(String attrName,
                               String vals)
        Converts a string of values from the attributes properties file to a Set, decoding special characters in each value.
      • decodeVal

        protected String decodeVal​(String v)
        Decodes a value, %2C to comma and %25 to percent.
      • 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.