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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Policy |
getPolicy()
Get
Policy configuration. |
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.
|
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. |
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 |
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) |
public AutoScalingConfig(byte[] utf8)
utf8
- config datapublic 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 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-2017 Apache Software Foundation. All Rights Reserved.