public class AutoScalingConfig extends Object implements MapWriter
autoscaling.json
, which parses data
lazily.Modifier and Type | Class and Description |
---|---|
static class |
AutoScalingConfig.ActionConfig
Bean representation of trigger action configuration.
|
static class |
AutoScalingConfig.TriggerConfig
Bean representation of trigger config.
|
static class |
AutoScalingConfig.TriggerListenerConfig
Bean representation of trigger listener config.
|
MapWriter.EntryWriter
Constructor and Description |
---|
AutoScalingConfig(byte[] utf8)
Construct from bytes that represent a UTF-8 JSON string.
|
AutoScalingConfig(Map<String,Object> jsonMap)
Construct from a JSON map representation.
|
AutoScalingConfig(Policy policy,
Map<String,AutoScalingConfig.TriggerConfig> triggerConfigs,
Map<String,AutoScalingConfig.TriggerListenerConfig> listenerConfigs,
Map<String,Object> properties,
int zkVersion) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
equals(Object o) |
Policy |
getPolicy()
Get
Policy configuration. |
Map<String,Object> |
getProperties() |
Map<String,AutoScalingConfig.TriggerConfig> |
getTriggerConfigs()
Get trigger configurations.
|
Map<String,AutoScalingConfig.TriggerListenerConfig> |
getTriggerListenerConfigs()
Get listener configurations.
|
int |
getZkVersion()
Return the znode version that was used to create this configuration.
|
int |
hashCode() |
boolean |
hasTriggerForEvents(TriggerEventType... types)
Check whether triggers for specific event type exist.
|
boolean |
isEmpty()
Return true if the source
autoscaling.json was empty, false otherwise. |
String |
toString() |
AutoScalingConfig |
withoutTriggerConfig(String name)
Create a copy of the config without a trigger configuration.
|
AutoScalingConfig |
withoutTriggerListenerConfig(String name)
Create a copy of the config without a trigger listener configuration.
|
AutoScalingConfig |
withPolicy(Policy policy)
Create a copy of the config with replaced policy.
|
AutoScalingConfig |
withProperties(Map<String,Object> properties)
Create a copy of the config with replaced properties.
|
AutoScalingConfig |
withTriggerConfig(AutoScalingConfig.TriggerConfig config)
Create a copy of the config with replaced trigger configuration
|
AutoScalingConfig |
withTriggerConfigs(Map<String,AutoScalingConfig.TriggerConfig> configs)
Create a copy of the config with replaced trigger configurations.
|
AutoScalingConfig |
withTriggerListenerConfig(AutoScalingConfig.TriggerListenerConfig config)
Create a copy of the config with replaced trigger listener configuration.
|
AutoScalingConfig |
withTriggerListenerConfigs(Map<String,AutoScalingConfig.TriggerListenerConfig> configs)
Create a copy of the config with replaced trigger listener configurations.
|
void |
writeMap(MapWriter.EntryWriter ew) |
finalize, getClass, notify, notifyAll, wait, wait, wait
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
public AutoScalingConfig(byte[] utf8)
utf8
- config datapublic AutoScalingConfig(Map<String,Object> jsonMap)
jsonMap
- JSON map representation of the config. Note that this map is evaluated lazily, and
outside modifications may cause unpredictable behavior.public AutoScalingConfig(Policy policy, Map<String,AutoScalingConfig.TriggerConfig> triggerConfigs, Map<String,AutoScalingConfig.TriggerListenerConfig> listenerConfigs, Map<String,Object> properties, int zkVersion)
public boolean isEmpty()
autoscaling.json
was empty, false otherwise.public Map<String,AutoScalingConfig.TriggerConfig> getTriggerConfigs()
public boolean hasTriggerForEvents(TriggerEventType... types)
types
- list of event typespublic Map<String,AutoScalingConfig.TriggerListenerConfig> getTriggerListenerConfigs()
public AutoScalingConfig withProperties(Map<String,Object> properties)
properties
- the new properties mappublic AutoScalingConfig withPolicy(Policy policy)
policy
- new policypublic AutoScalingConfig withTriggerConfigs(Map<String,AutoScalingConfig.TriggerConfig> configs)
configs
- new trigger configurationspublic AutoScalingConfig withTriggerConfig(AutoScalingConfig.TriggerConfig config)
config
- new trigger configurationpublic AutoScalingConfig withoutTriggerConfig(String name)
name
- trigger configuration namepublic AutoScalingConfig withTriggerListenerConfigs(Map<String,AutoScalingConfig.TriggerListenerConfig> configs)
configs
- new trigger listener configurationspublic AutoScalingConfig withTriggerListenerConfig(AutoScalingConfig.TriggerListenerConfig config)
config
- new trigger listener configurationpublic AutoScalingConfig withoutTriggerListenerConfig(String name)
name
- trigger listener configuration namepublic int getZkVersion()
public void writeMap(MapWriter.EntryWriter ew) throws IOException
writeMap
in interface MapWriter
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.