Class NetworkConfigServiceAdapter

    • Constructor Detail

      • NetworkConfigServiceAdapter

        public NetworkConfigServiceAdapter()
    • Method Detail

      • getConfigClass

        public Class<? extends Config> getConfigClass​(String subjectClassKey,
                                                      String configKey)
        Description copied from interface: NetworkConfigService
        Returns the configuration class with the specified key.
        Specified by:
        getConfigClass in interface NetworkConfigService
        Parameters:
        subjectClassKey - subject class key
        configKey - subject class name
        Returns:
        subject class
      • getSubjects

        public <S> Set<S> getSubjects​(Class<S> subjectClass)
        Description copied from interface: NetworkConfigService
        Returns the set of subjects for which some configuration is available.
        Specified by:
        getSubjects in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        Parameters:
        subjectClass - subject class
        Returns:
        set of configured subjects
      • getSubjects

        public <S,​C extends Config<S>> Set<S> getSubjects​(Class<S> subjectClass,
                                                                Class<C> configClass)
        Description copied from interface: NetworkConfigService
        Returns the set of subjects for which the specified configuration is available.
        Specified by:
        getSubjects in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subjectClass - subject class
        configClass - configuration class
        Returns:
        set of configured subjects
      • getConfigs

        public <S> Set<? extends Config<S>> getConfigs​(S subject)
        Description copied from interface: NetworkConfigService
        Returns all configurations for the specified subject.
        Specified by:
        getConfigs in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        Parameters:
        subject - configuration subject
        Returns:
        set of configurations
      • getConfig

        public <S,​C extends Config<S>> C getConfig​(S subject,
                                                         Class<C> configClass)
        Description copied from interface: NetworkConfigService
        Returns the configuration for the specified subject and configuration class if one is available; null otherwise.
        Specified by:
        getConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subject - configuration subject
        configClass - configuration class
        Returns:
        configuration or null if one is not available
      • addConfig

        public <S,​C extends Config<S>> C addConfig​(S subject,
                                                         Class<C> configClass)
        Description copied from interface: NetworkConfigService
        Creates a new configuration for the specified subject and configuration class. If one already exists, it is simply returned.
        Specified by:
        addConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subject - configuration subject
        configClass - configuration class
        Returns:
        configuration or null if one is not available
      • applyConfig

        public <S,​C extends Config<S>> C applyConfig​(S subject,
                                                           Class<C> configClass,
                                                           com.fasterxml.jackson.databind.JsonNode json)
        Description copied from interface: NetworkConfigService
        Applies configuration for the specified subject and configuration class using the raw JSON node. If configuration already exists, it will be updated.
        Specified by:
        applyConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subject - configuration subject
        configClass - configuration class
        json - raw JSON node containing the configuration data
        Returns:
        configuration or null if one is not available
      • applyConfig

        public <S,​C extends Config<S>> C applyConfig​(String subjectClassKey,
                                                           S subject,
                                                           String configKey,
                                                           com.fasterxml.jackson.databind.JsonNode json)
        Description copied from interface: NetworkConfigService
        Applies configuration for the specified subject and configuration key using the raw JSON object. If configuration already exists, it will be updated. If the specified configuration key does not yet have a registered class associated with it, the configuration will be pending and null value will be returned. Once the backing configuration class is registered, the configuration will be validated and accepted.
        Specified by:
        applyConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subjectClassKey - subject class key
        subject - configuration subject
        configKey - configuration class key
        json - raw JSON node containing the configuration data
        Returns:
        configuration object or null if configuration key does not have a registered class yet
      • removeConfig

        public <S,​C extends Config<S>> void removeConfig​(S subject,
                                                               Class<C> configClass)
        Description copied from interface: NetworkConfigService
        Clears any configuration for the specified subject and configuration class. If one does not exist, this call has no effect.
        Specified by:
        removeConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        C - type of configuration
        Parameters:
        subject - configuration subject
        configClass - configuration class
      • removeConfig

        public <S> void removeConfig​(String subjectClassKey,
                                     S subject,
                                     String configKey)
        Description copied from interface: NetworkConfigService
        Clears any configuration for the specified subject and configuration key. If one does not exist, this call has no effect.
        Specified by:
        removeConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        Parameters:
        subjectClassKey - subject class key
        subject - configuration subject
        configKey - configuration key
      • removeConfig

        public <S> void removeConfig​(S subject)
        Description copied from interface: NetworkConfigService
        Clears the configuration including queued based on the subject. If does not exists this call has no effect.
        Specified by:
        removeConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject
        Parameters:
        subject - configuration subject
      • removeConfig

        public <S> void removeConfig()
        Description copied from interface: NetworkConfigService
        Clears the complete configuration including queued. If does not exists this call has no effect.
        Specified by:
        removeConfig in interface NetworkConfigService
        Type Parameters:
        S - type of subject