Class AbstractConfigurableAuthenticatedService

    • Field Detail

      • CFG_RETRY_MAX

        public static final int CFG_RETRY_MAX
        The maximum of retries for getConfiguration.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractConfigurableAuthenticatedService

        public AbstractConfigurableAuthenticatedService​(org.apache.commons.configuration2.Configuration configuration,
                                                        Registry registry,
                                                        Class<?> cls)
                                                 throws ConfigurationException
        Creates a configurable service with the designated configuration, the designated registry, a logger for this and assuming that there are no other services required.
        Parameters:
        configuration - The configuration of this service that can be changed (at least parts of it) at runtime and that provides the logon credentials for this service.
        registry - The registry to be used for accessing services by this service. This is provided as parameter to the constructor when creating a service.
        cls - The class specifying the name of the logger of this service.
        Throws:
        ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
      • AbstractConfigurableAuthenticatedService

        public AbstractConfigurableAuthenticatedService​(org.apache.commons.configuration2.Configuration configuration,
                                                        Registry registry,
                                                        String[] startupRequiredServices,
                                                        String[] runtimeRequiredServices,
                                                        Class<?> cls)
                                                 throws ConfigurationException
        Creates a configurable service with the designated configuration, the designated registry, a logger for this and the designated required services.
        Parameters:
        configuration - The configuration of this service that can be changed (at least parts of it) at runtime and that provides the logon credentials for this service.
        registry - The registry to be used for accessing services by this service. This is provided as parameter to the constructor when creating a service.
        startupRequiredServices - The service type names of services required at startup time (in AbstractAuthenticatedService.init(java.net.URI[], java.net.URI[]) and AbstractADEPT2Service.start()).
        runtimeRequiredServices - The service type names of services required at runtime (after startup time).
        cls - The class specifying the name of the logger of this service.
        Throws:
        ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
    • Method Detail

      • getConfiguration

        public org.apache.commons.configuration2.Configuration getConfiguration​(SessionToken session)
        Description copied from interface: ConfigurableService
        Gets the configuration of this service for displaying it. It usually contains all configuration values of a service. Not all of them may be changed and not all of them by all users! Therefore filter the configuration appropriately based on the changeable keys. The returned configuration must not be changed directly since it usually is a copy of the configuration. Use ConfigurableService.setConfigurationValue(SessionToken, String, String) for changing configuration values.

        Note to implementors: As stated above return a copy of the configuration and not the configuration itself. Additionally make sure the returned configuration is serialisable since it may be transfered to a remote machine.

        Specified by:
        getConfiguration in interface ConfigurableService
        Parameters:
        session - The session which is used to check for access rights on this method.
        Returns:
        The configuration of the service. Some of its values may be changed.
      • getConfigurationValue

        public String getConfigurationValue​(SessionToken session,
                                            String key)
        Description copied from interface: ConfigurableService
        Gets the string representation of the configuration value for the designated key or null if the key does not exist or has no value.
        Specified by:
        getConfigurationValue in interface ConfigurableService
        Parameters:
        session - The session which is used to check for access rights on this method.
        key - The key of the configuration value.
        Returns:
        The string representation of the configuration value of the designated key or null if the key does not exist or has no value.