public class NetworkConfigServiceAdapter extends java.lang.Object implements NetworkConfigService
Constructor and Description |
---|
NetworkConfigServiceAdapter() |
Modifier and Type | Method and Description |
---|---|
<S,C extends Config<S>> |
addConfig(S subject,
java.lang.Class<C> configClass)
Creates a new configuration for the specified subject and configuration
class.
|
void |
addListener(NetworkConfigListener listener)
Adds the specified listener.
|
<S,C extends Config<S>> |
applyConfig(S subject,
java.lang.Class<C> configClass,
com.fasterxml.jackson.databind.JsonNode json)
Applies configuration for the specified subject and configuration
class using the raw JSON node.
|
<S,C extends Config<S>> |
applyConfig(java.lang.String subjectClassKey,
S subject,
java.lang.String configKey,
com.fasterxml.jackson.databind.JsonNode json)
Applies configuration for the specified subject and configuration
key using the raw JSON object.
|
<S,C extends Config<S>> |
getConfig(S subject,
java.lang.Class<C> configClass)
Returns the configuration for the specified subject and configuration
class if one is available; null otherwise.
|
java.lang.Class<? extends Config> |
getConfigClass(java.lang.String subjectClassKey,
java.lang.String configKey)
Returns the configuration class with the specified key.
|
<S> java.util.Set<? extends Config<S>> |
getConfigs(S subject)
Returns all configurations for the specified subject.
|
java.util.Set<java.lang.Class> |
getSubjectClasses()
Returns the set of subject classes for which configuration may be
available.
|
SubjectFactory |
getSubjectFactory(java.lang.Class subjectClass)
Returns the subject factory for the specified class.
|
SubjectFactory |
getSubjectFactory(java.lang.String subjectClassKey)
Returns the subject factory with the specified key.
|
<S> java.util.Set<S> |
getSubjects(java.lang.Class<S> subjectClass)
Returns the set of subjects for which some configuration is available.
|
<S,C extends Config<S>> |
getSubjects(java.lang.Class<S> subjectClass,
java.lang.Class<C> configClass)
Returns the set of subjects for which the specified configuration is
available.
|
<S> void |
removeConfig()
Clears the complete configuration including queued.
|
<S> void |
removeConfig(S subject)
Clears the configuration including queued based on the subject.
|
<S,C extends Config<S>> |
removeConfig(S subject,
java.lang.Class<C> configClass)
Clears any configuration for the specified subject and configuration
class.
|
<S> void |
removeConfig(java.lang.String subjectClassKey,
S subject,
java.lang.String configKey)
Clears any configuration for the specified subject and configuration
key.
|
void |
removeListener(NetworkConfigListener listener)
Removes the specified listener.
|
public java.util.Set<java.lang.Class> getSubjectClasses()
NetworkConfigService
getSubjectClasses
in interface NetworkConfigService
public SubjectFactory getSubjectFactory(java.lang.String subjectClassKey)
NetworkConfigService
getSubjectFactory
in interface NetworkConfigService
subjectClassKey
- subject class keypublic SubjectFactory getSubjectFactory(java.lang.Class subjectClass)
NetworkConfigService
getSubjectFactory
in interface NetworkConfigService
subjectClass
- subject classpublic java.lang.Class<? extends Config> getConfigClass(java.lang.String subjectClassKey, java.lang.String configKey)
NetworkConfigService
getConfigClass
in interface NetworkConfigService
subjectClassKey
- subject class keyconfigKey
- subject class namepublic <S> java.util.Set<S> getSubjects(java.lang.Class<S> subjectClass)
NetworkConfigService
getSubjects
in interface NetworkConfigService
S
- type of subjectsubjectClass
- subject classpublic <S,C extends Config<S>> java.util.Set<S> getSubjects(java.lang.Class<S> subjectClass, java.lang.Class<C> configClass)
NetworkConfigService
getSubjects
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubjectClass
- subject classconfigClass
- configuration classpublic <S> java.util.Set<? extends Config<S>> getConfigs(S subject)
NetworkConfigService
getConfigs
in interface NetworkConfigService
S
- type of subjectsubject
- configuration subjectpublic <S,C extends Config<S>> C getConfig(S subject, java.lang.Class<C> configClass)
NetworkConfigService
getConfig
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubject
- configuration subjectconfigClass
- configuration classpublic <S,C extends Config<S>> C addConfig(S subject, java.lang.Class<C> configClass)
NetworkConfigService
addConfig
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubject
- configuration subjectconfigClass
- configuration classpublic <S,C extends Config<S>> C applyConfig(S subject, java.lang.Class<C> configClass, com.fasterxml.jackson.databind.JsonNode json)
NetworkConfigService
applyConfig
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubject
- configuration subjectconfigClass
- configuration classjson
- raw JSON node containing the configuration datapublic <S,C extends Config<S>> C applyConfig(java.lang.String subjectClassKey, S subject, java.lang.String configKey, com.fasterxml.jackson.databind.JsonNode json)
NetworkConfigService
applyConfig
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubjectClassKey
- subject class keysubject
- configuration subjectconfigKey
- configuration class keyjson
- raw JSON node containing the configuration datapublic <S,C extends Config<S>> void removeConfig(S subject, java.lang.Class<C> configClass)
NetworkConfigService
removeConfig
in interface NetworkConfigService
S
- type of subjectC
- type of configurationsubject
- configuration subjectconfigClass
- configuration classpublic <S> void removeConfig(java.lang.String subjectClassKey, S subject, java.lang.String configKey)
NetworkConfigService
removeConfig
in interface NetworkConfigService
S
- type of subjectsubjectClassKey
- subject class keysubject
- configuration subjectconfigKey
- configuration keypublic void addListener(NetworkConfigListener listener)
ListenerService
addListener
in interface ListenerService<NetworkConfigEvent,NetworkConfigListener>
listener
- listener to be addedpublic void removeListener(NetworkConfigListener listener)
ListenerService
removeListener
in interface ListenerService<NetworkConfigEvent,NetworkConfigListener>
listener
- listener to be removedpublic <S> void removeConfig(S subject)
NetworkConfigService
removeConfig
in interface NetworkConfigService
S
- type of subjectsubject
- configuration subjectpublic <S> void removeConfig()
NetworkConfigService
removeConfig
in interface NetworkConfigService
S
- type of subject