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()
NetworkConfigServicegetSubjectClasses in interface NetworkConfigServicepublic SubjectFactory getSubjectFactory(java.lang.String subjectClassKey)
NetworkConfigServicegetSubjectFactory in interface NetworkConfigServicesubjectClassKey - subject class keypublic SubjectFactory getSubjectFactory(java.lang.Class subjectClass)
NetworkConfigServicegetSubjectFactory in interface NetworkConfigServicesubjectClass - subject classpublic java.lang.Class<? extends Config> getConfigClass(java.lang.String subjectClassKey, java.lang.String configKey)
NetworkConfigServicegetConfigClass in interface NetworkConfigServicesubjectClassKey - subject class keyconfigKey - subject class namepublic <S> java.util.Set<S> getSubjects(java.lang.Class<S> subjectClass)
NetworkConfigServicegetSubjects in interface NetworkConfigServiceS - 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)
NetworkConfigServicegetSubjects in interface NetworkConfigServiceS - type of subjectC - type of configurationsubjectClass - subject classconfigClass - configuration classpublic <S> java.util.Set<? extends Config<S>> getConfigs(S subject)
NetworkConfigServicegetConfigs in interface NetworkConfigServiceS - type of subjectsubject - configuration subjectpublic <S,C extends Config<S>> C getConfig(S subject, java.lang.Class<C> configClass)
NetworkConfigServicegetConfig in interface NetworkConfigServiceS - type of subjectC - type of configurationsubject - configuration subjectconfigClass - configuration classpublic <S,C extends Config<S>> C addConfig(S subject, java.lang.Class<C> configClass)
NetworkConfigServiceaddConfig in interface NetworkConfigServiceS - 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)
NetworkConfigServiceapplyConfig in interface NetworkConfigServiceS - 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)
NetworkConfigServiceapplyConfig in interface NetworkConfigServiceS - 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)
NetworkConfigServiceremoveConfig in interface NetworkConfigServiceS - type of subjectC - type of configurationsubject - configuration subjectconfigClass - configuration classpublic <S> void removeConfig(java.lang.String subjectClassKey,
S subject,
java.lang.String configKey)
NetworkConfigServiceremoveConfig in interface NetworkConfigServiceS - type of subjectsubjectClassKey - subject class keysubject - configuration subjectconfigKey - configuration keypublic void addListener(NetworkConfigListener listener)
ListenerServiceaddListener in interface ListenerService<NetworkConfigEvent,NetworkConfigListener>listener - listener to be addedpublic void removeListener(NetworkConfigListener listener)
ListenerServiceremoveListener in interface ListenerService<NetworkConfigEvent,NetworkConfigListener>listener - listener to be removedpublic <S> void removeConfig(S subject)
NetworkConfigServiceremoveConfig in interface NetworkConfigServiceS - type of subjectsubject - configuration subjectpublic <S> void removeConfig()
NetworkConfigServiceremoveConfig in interface NetworkConfigServiceS - type of subject