public abstract class AbstractConfigurationSupportInternal extends java.lang.Object implements BrooklynObjectInternal.ConfigurationSupportInternal
| Constructor and Description |
|---|
AbstractConfigurationSupportInternal() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<ConfigKey<?>> |
findKeys(com.google.common.base.Predicate<? super ConfigKey<?>> filter) |
<T> T |
get(ConfigKey.HasConfigKey<T> key) |
<T> T |
get(ConfigKey<T> key)
Gets the given configuration value for this entity, in the following order of precedence:
value (including null) explicitly set on the entity
value (including null) explicitly set on an ancestor (inherited)
a default value (including null) on the best equivalent static key of the same name declared on the entity
(where best equivalence is defined as preferring a config key which extends another,
as computed in EntityDynamicType.getConfigKeys)
a default value (including null) on the key itself
null
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllLocalRaw()
Returns all config defined here, in
BrooklynObjectInternal.ConfigurationSupportInternal.getLocalRaw(ConfigKey) format |
ConfigBag |
getBag()
Returns a read-only view of all the config key/value pairs on this entity, backed by a string-based map,
including config names that did not match anything on this entity.
|
ConfigMap.ConfigMapWithInheritance<? extends BrooklynObject> |
getInternalConfigMap()
This is currently the only way to get some rolled up collections and raw,
and also to test for the presence of a value (without any default).
|
ConfigBag |
getLocalBag()
Returns a read-only view of the local (i.e.
|
Maybe<java.lang.Object> |
getLocalRaw(ConfigKey.HasConfigKey<?> key) |
Maybe<java.lang.Object> |
getLocalRaw(ConfigKey<?> key)
Returns the uncoerced value for this config key, if available,
not following any inheritance chains and not taking any default.
|
<T> Maybe<T> |
getNonBlocking(ConfigKey.HasConfigKey<T> key) |
<T> Maybe<T> |
getNonBlocking(ConfigKey<T> key)
Attempts to coerce the value for this config key, if available,
taking a default and
absent if the uncoerced
cannot be resolved within a short timeframe. |
Maybe<java.lang.Object> |
getRaw(ConfigKey.HasConfigKey<?> key) |
Maybe<java.lang.Object> |
getRaw(ConfigKey<?> key)
Returns the uncoerced value for this config key, if available, not taking any default.
|
void |
putAll(java.util.Map<?,?> vals)
Adds keys or strings, making anonymous keys from strings; throws on other keys
|
void |
removeAllLocalConfig()
Clears all local config, e.g.
|
void |
removeKey(ConfigKey<?> key) |
void |
removeKey(java.lang.String key) |
<T> T |
set(ConfigKey.HasConfigKey<T> key,
T val) |
<T> T |
set(ConfigKey.HasConfigKey<T> key,
Task<T> val) |
<T> T |
set(ConfigKey<T> key,
T val)
Sets the config to the given value.
|
<T> T |
set(ConfigKey<T> key,
Task<T> val)
Sets the config to the value returned by the task.
|
void |
set(java.util.Map<?,?> vals)
Deprecated.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrefreshInheritedConfig, refreshInheritedConfigOfChildrenpublic AbstractConfigurationSupportInternal()
public <T> T get(ConfigKey.HasConfigKey<T> key)
get in interface Configurable.ConfigurationSupport#getConfig(ConfigKey)}public Maybe<java.lang.Object> getLocalRaw(ConfigKey.HasConfigKey<?> key)
getLocalRaw in interface BrooklynObjectInternal.ConfigurationSupportInternal#getLocalRaw(ConfigKey)}public Maybe<java.lang.Object> getRaw(ConfigKey.HasConfigKey<?> key)
getRaw in interface BrooklynObjectInternal.ConfigurationSupportInternal#getRaw(ConfigKey)}public <T> Maybe<T> getNonBlocking(ConfigKey.HasConfigKey<T> key)
getNonBlocking in interface BrooklynObjectInternal.ConfigurationSupportInternal#getNonBlocking(ConfigKey)}public <T> Maybe<T> getNonBlocking(ConfigKey<T> key)
BrooklynObjectInternal.ConfigurationSupportInternalabsent if the uncoerced
cannot be resolved within a short timeframe.
Note: if no value for the key is available, not even as a default,
this returns a Maybe.isPresent() containing null
(following the semantics of Configurable.ConfigurationSupport.get(ConfigKey)
rather than BrooklynObjectInternal.ConfigurationSupportInternal.getRaw(ConfigKey)).
getNonBlocking in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic <T> T set(ConfigKey.HasConfigKey<T> key, Task<T> val)
set in interface Configurable.ConfigurationSupport#setConfig(ConfigKey, Task)}public <T> T set(ConfigKey.HasConfigKey<T> key, T val)
set in interface Configurable.ConfigurationSupport#setConfig(HasConfigKey, Object)}public <T> T get(ConfigKey<T> key)
Configurable.ConfigurationSupportget in interface Configurable.ConfigurationSupportpublic <T> T set(ConfigKey<T> key, T val)
Configurable.ConfigurationSupportset in interface Configurable.ConfigurationSupportpublic <T> T set(ConfigKey<T> key, Task<T> val)
Configurable.ConfigurationSupportConfigurable.getConfig(ConfigKey)
will execute the task, and block until the task completes.set in interface Configurable.ConfigurationSupport#setConfig(ConfigKey, Object)}public ConfigBag getLocalBag()
BrooklynObjectInternal.ConfigurationSupportInternalgetLocalBag in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic Maybe<java.lang.Object> getRaw(ConfigKey<?> key)
BrooklynObjectInternal.ConfigurationSupportInternalMaybe.absent() if the key is not explicitly set on this object or an ancestor.
See also {@link #getLocalRaw(ConfigKey).
getRaw in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic Maybe<java.lang.Object> getLocalRaw(ConfigKey<?> key)
BrooklynObjectInternal.ConfigurationSupportInternalMaybe.absent() if the key is not explicitly set on this object.
See also {@link #getRaw(ConfigKey).
getLocalRaw in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic void putAll(java.util.Map<?,?> vals)
BrooklynObjectInternal.ConfigurationSupportInternalputAll in interface BrooklynObjectInternal.ConfigurationSupportInternal@Deprecated public void set(java.util.Map<?,?> vals)
set in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic void removeKey(java.lang.String key)
removeKey in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic void removeKey(ConfigKey<?> key)
removeKey in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic void removeAllLocalConfig()
BrooklynObjectInternal.ConfigurationSupportInternalremoveAllLocalConfig in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic java.util.Set<ConfigKey<?>> findKeys(com.google.common.base.Predicate<? super ConfigKey<?>> filter)
findKeys in interface Configurable.ConfigurationSupportpublic ConfigMap.ConfigMapWithInheritance<? extends BrooklynObject> getInternalConfigMap()
BrooklynObjectInternal.ConfigurationSupportInternalConfigurable.ConfigurationSupport.findKeys(com.google.common.base.Predicate)
if that isn't too inefficient.getInternalConfigMap in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic java.util.Map<ConfigKey<?>,java.lang.Object> getAllLocalRaw()
BrooklynObjectInternal.ConfigurationSupportInternalBrooklynObjectInternal.ConfigurationSupportInternal.getLocalRaw(ConfigKey) formatgetAllLocalRaw in interface BrooklynObjectInternal.ConfigurationSupportInternalpublic ConfigBag getBag()
BrooklynObjectInternal.ConfigurationSupportInternalConfigKey.getInheritanceByContext() cannot be respected
if an anonymous key (not matching a declared config key) is set but the
strongly typed key is accessed.
It does not identify the container where it is defined, meaning URLs and deferred config values cannot be resolved in the context of the appropriate ancestor.
For these reasons it is recommended to use a different accessor, and callers should be advised this beta method may be removed.
getBag in interface BrooklynObjectInternal.ConfigurationSupportInternal