Class AutoScalingConfig

    • Constructor Detail

      • AutoScalingConfig

        public AutoScalingConfig​(byte[] utf8)
        Construct from bytes that represent a UTF-8 JSON string.
        Parameters:
        utf8 - config data
      • AutoScalingConfig

        public AutoScalingConfig​(Map<String,​Object> jsonMap)
        Construct from a JSON map representation.
        Parameters:
        jsonMap - JSON map representation of the config. Note that this map is evaluated lazily, and outside modifications may cause unpredictable behavior.
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Return true if the source autoscaling.json was empty, false otherwise.
      • getPolicy

        public Policy getPolicy()
        Get Policy configuration.
      • hasTriggerForEvents

        public boolean hasTriggerForEvents​(TriggerEventType... types)
        Check whether triggers for specific event type exist.
        Parameters:
        types - list of event types
        Returns:
        true if there's at least one trigger matching at least one event type, false otherwise,
      • withProperties

        public AutoScalingConfig withProperties​(Map<String,​Object> properties)
        Create a copy of the config with replaced properties.
        Parameters:
        properties - the new properties map
        Returns:
        modified copy of the configuration
      • withPolicy

        public AutoScalingConfig withPolicy​(Policy policy)
        Create a copy of the config with replaced policy.
        Parameters:
        policy - new policy
        Returns:
        modified copy of the configuration
      • withTriggerConfigs

        public AutoScalingConfig withTriggerConfigs​(Map<String,​AutoScalingConfig.TriggerConfig> configs)
        Create a copy of the config with replaced trigger configurations.
        Parameters:
        configs - new trigger configurations
        Returns:
        modified copy of the configuration
      • withTriggerConfig

        public AutoScalingConfig withTriggerConfig​(AutoScalingConfig.TriggerConfig config)
        Create a copy of the config with replaced trigger configuration
        Parameters:
        config - new trigger configuration
        Returns:
        modified copy of the configuration
      • withoutTriggerConfig

        public AutoScalingConfig withoutTriggerConfig​(String name)
        Create a copy of the config without a trigger configuration.
        Parameters:
        name - trigger configuration name
        Returns:
        modified copy of the configuration, even if the specified config name didn't exist.
      • withTriggerListenerConfigs

        public AutoScalingConfig withTriggerListenerConfigs​(Map<String,​AutoScalingConfig.TriggerListenerConfig> configs)
        Create a copy of the config with replaced trigger listener configurations.
        Parameters:
        configs - new trigger listener configurations
        Returns:
        modified copy of the configuration
      • withTriggerListenerConfig

        public AutoScalingConfig withTriggerListenerConfig​(AutoScalingConfig.TriggerListenerConfig config)
        Create a copy of the config with replaced trigger listener configuration.
        Parameters:
        config - new trigger listener configuration
        Returns:
        modified copy of the configuration
      • withoutTriggerListenerConfig

        public AutoScalingConfig withoutTriggerListenerConfig​(String name)
        Create a copy of the config without a trigger listener configuration.
        Parameters:
        name - trigger listener configuration name
        Returns:
        modified copy of the configuration, even if the specified config name didn't exist.
      • getZkVersion

        public int getZkVersion()
        Return the znode version that was used to create this configuration.