All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.gamelift.model.ScalingPolicy Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not
 * use this file except in compliance with the License. A copy of the License is
 * located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.gamelift.model;

import java.io.Serializable;

/**
 * 

* Rule that controls how a fleet is scaled. Scaling policies are uniquely * identified by the combination of name and fleet ID. *

*/ public class ScalingPolicy implements Serializable, Cloneable { /** *

* Unique identity for the fleet associated with this scaling policy. *

*/ private String fleetId; /** *

* Descriptive label associated with a scaling policy. Policy names do not * need to be unique. *

*/ private String name; /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

*/ private String status; /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

*/ private Integer scalingAdjustment; /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

*/ private String scalingAdjustmentType; /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

*/ private String comparisonOperator; /** *

* Metric value used to trigger a scaling event. *

*/ private Double threshold; /** *

* Length of time (in minutes) the metric must be at or beyond the threshold * before a scaling event is triggered. *

*/ private Integer evaluationPeriods; /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

*/ private String metricName; /** *

* Unique identity for the fleet associated with this scaling policy. *

* * @param fleetId * Unique identity for the fleet associated with this scaling policy. */ public void setFleetId(String fleetId) { this.fleetId = fleetId; } /** *

* Unique identity for the fleet associated with this scaling policy. *

* * @return Unique identity for the fleet associated with this scaling * policy. */ public String getFleetId() { return this.fleetId; } /** *

* Unique identity for the fleet associated with this scaling policy. *

* * @param fleetId * Unique identity for the fleet associated with this scaling policy. * @return Returns a reference to this object so that method calls can be * chained together. */ public ScalingPolicy withFleetId(String fleetId) { setFleetId(fleetId); return this; } /** *

* Descriptive label associated with a scaling policy. Policy names do not * need to be unique. *

* * @param name * Descriptive label associated with a scaling policy. Policy names * do not need to be unique. */ public void setName(String name) { this.name = name; } /** *

* Descriptive label associated with a scaling policy. Policy names do not * need to be unique. *

* * @return Descriptive label associated with a scaling policy. Policy names * do not need to be unique. */ public String getName() { return this.name; } /** *

* Descriptive label associated with a scaling policy. Policy names do not * need to be unique. *

* * @param name * Descriptive label associated with a scaling policy. Policy names * do not need to be unique. * @return Returns a reference to this object so that method calls can be * chained together. */ public ScalingPolicy withName(String name) { setName(name); return this; } /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

* * @param status * Current status of the scaling policy. The scaling policy is only * in force when in an Active state. *
    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling * policy has been received.
  • *
  • UPDATING – A change is being made to the scaling * policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling * policy has been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It * should be removed and recreated.
  • *
* @see ScalingStatusType */ public void setStatus(String status) { this.status = status; } /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

* * @return Current status of the scaling policy. The scaling policy is only * in force when in an Active state. *
    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling * policy has been received.
  • *
  • UPDATING – A change is being made to the scaling * policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling * policy has been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It * should be removed and recreated.
  • *
* @see ScalingStatusType */ public String getStatus() { return this.status; } /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

* * @param status * Current status of the scaling policy. The scaling policy is only * in force when in an Active state. *
    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling * policy has been received.
  • *
  • UPDATING – A change is being made to the scaling * policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling * policy has been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It * should be removed and recreated.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see ScalingStatusType */ public ScalingPolicy withStatus(String status) { setStatus(status); return this; } /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

* * @param status * Current status of the scaling policy. The scaling policy is only * in force when in an Active state. *
    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling * policy has been received.
  • *
  • UPDATING – A change is being made to the scaling * policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling * policy has been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It * should be removed and recreated.
  • *
* @see ScalingStatusType */ public void setStatus(ScalingStatusType status) { this.status = status.toString(); } /** *

* Current status of the scaling policy. The scaling policy is only in force * when in an Active state. *

    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling policy has * been received.
  • *
  • UPDATING – A change is being made to the scaling policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling policy has * been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It should be * removed and recreated.
  • *
*

* * @param status * Current status of the scaling policy. The scaling policy is only * in force when in an Active state. *
    *
  • ACTIVE – The scaling policy is currently in force.
  • *
  • UPDATEREQUESTED – A request to update the scaling * policy has been received.
  • *
  • UPDATING – A change is being made to the scaling * policy.
  • *
  • DELETEREQUESTED – A request to delete the scaling * policy has been received.
  • *
  • DELETING – The scaling policy is being deleted.
  • *
  • DELETED – The scaling policy has been deleted.
  • *
  • ERROR – An error occurred in creating the policy. It * should be removed and recreated.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see ScalingStatusType */ public ScalingPolicy withStatus(ScalingStatusType status) { setStatus(status); return this; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @param scalingAdjustment * Amount of adjustment to make, based on the scaling adjustment * type. */ public void setScalingAdjustment(Integer scalingAdjustment) { this.scalingAdjustment = scalingAdjustment; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @return Amount of adjustment to make, based on the scaling adjustment * type. */ public Integer getScalingAdjustment() { return this.scalingAdjustment; } /** *

* Amount of adjustment to make, based on the scaling adjustment type. *

* * @param scalingAdjustment * Amount of adjustment to make, based on the scaling adjustment * type. * @return Returns a reference to this object so that method calls can be * chained together. */ public ScalingPolicy withScalingAdjustment(Integer scalingAdjustment) { setScalingAdjustment(scalingAdjustment); return this; } /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

* * @param scalingAdjustmentType * Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *
    *
  • ChangeInCapacity – add (or subtract) the scaling * adjustment value from the current instance count. Positive values * scale up while negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the * current instance count by the scaling adjustment, read as a * percentage. Positive values scale up while negative values scale * down.
  • *
* @see ScalingAdjustmentType */ public void setScalingAdjustmentType(String scalingAdjustmentType) { this.scalingAdjustmentType = scalingAdjustmentType; } /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

* * @return Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *
    *
  • ChangeInCapacity – add (or subtract) the scaling * adjustment value from the current instance count. Positive values * scale up while negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the * current instance count by the scaling adjustment, read as a * percentage. Positive values scale up while negative values scale * down.
  • *
* @see ScalingAdjustmentType */ public String getScalingAdjustmentType() { return this.scalingAdjustmentType; } /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

* * @param scalingAdjustmentType * Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *
    *
  • ChangeInCapacity – add (or subtract) the scaling * adjustment value from the current instance count. Positive values * scale up while negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the * current instance count by the scaling adjustment, read as a * percentage. Positive values scale up while negative values scale * down.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see ScalingAdjustmentType */ public ScalingPolicy withScalingAdjustmentType(String scalingAdjustmentType) { setScalingAdjustmentType(scalingAdjustmentType); return this; } /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

* * @param scalingAdjustmentType * Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *
    *
  • ChangeInCapacity – add (or subtract) the scaling * adjustment value from the current instance count. Positive values * scale up while negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the * current instance count by the scaling adjustment, read as a * percentage. Positive values scale up while negative values scale * down.
  • *
* @see ScalingAdjustmentType */ public void setScalingAdjustmentType( ScalingAdjustmentType scalingAdjustmentType) { this.scalingAdjustmentType = scalingAdjustmentType.toString(); } /** *

* Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *

    *
  • ChangeInCapacity – add (or subtract) the scaling adjustment * value from the current instance count. Positive values scale up while * negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the current * instance count by the scaling adjustment, read as a percentage. Positive * values scale up while negative values scale down.
  • *
*

* * @param scalingAdjustmentType * Type of adjustment to make to a fleet's instance count (see * FleetCapacity): *
    *
  • ChangeInCapacity – add (or subtract) the scaling * adjustment value from the current instance count. Positive values * scale up while negative values scale down.
  • *
  • ExactCapacity – set the instance count to the scaling * adjustment value.
  • *
  • PercentChangeInCapacity – increase or reduce the * current instance count by the scaling adjustment, read as a * percentage. Positive values scale up while negative values scale * down.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see ScalingAdjustmentType */ public ScalingPolicy withScalingAdjustmentType( ScalingAdjustmentType scalingAdjustmentType) { setScalingAdjustmentType(scalingAdjustmentType); return this; } /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

* * @param comparisonOperator * Comparison operator to use when measuring a metric against the * threshold value. * @see ComparisonOperatorType */ public void setComparisonOperator(String comparisonOperator) { this.comparisonOperator = comparisonOperator; } /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

* * @return Comparison operator to use when measuring a metric against the * threshold value. * @see ComparisonOperatorType */ public String getComparisonOperator() { return this.comparisonOperator; } /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

* * @param comparisonOperator * Comparison operator to use when measuring a metric against the * threshold value. * @return Returns a reference to this object so that method calls can be * chained together. * @see ComparisonOperatorType */ public ScalingPolicy withComparisonOperator(String comparisonOperator) { setComparisonOperator(comparisonOperator); return this; } /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

* * @param comparisonOperator * Comparison operator to use when measuring a metric against the * threshold value. * @see ComparisonOperatorType */ public void setComparisonOperator(ComparisonOperatorType comparisonOperator) { this.comparisonOperator = comparisonOperator.toString(); } /** *

* Comparison operator to use when measuring a metric against the threshold * value. *

* * @param comparisonOperator * Comparison operator to use when measuring a metric against the * threshold value. * @return Returns a reference to this object so that method calls can be * chained together. * @see ComparisonOperatorType */ public ScalingPolicy withComparisonOperator( ComparisonOperatorType comparisonOperator) { setComparisonOperator(comparisonOperator); return this; } /** *

* Metric value used to trigger a scaling event. *

* * @param threshold * Metric value used to trigger a scaling event. */ public void setThreshold(Double threshold) { this.threshold = threshold; } /** *

* Metric value used to trigger a scaling event. *

* * @return Metric value used to trigger a scaling event. */ public Double getThreshold() { return this.threshold; } /** *

* Metric value used to trigger a scaling event. *

* * @param threshold * Metric value used to trigger a scaling event. * @return Returns a reference to this object so that method calls can be * chained together. */ public ScalingPolicy withThreshold(Double threshold) { setThreshold(threshold); return this; } /** *

* Length of time (in minutes) the metric must be at or beyond the threshold * before a scaling event is triggered. *

* * @param evaluationPeriods * Length of time (in minutes) the metric must be at or beyond the * threshold before a scaling event is triggered. */ public void setEvaluationPeriods(Integer evaluationPeriods) { this.evaluationPeriods = evaluationPeriods; } /** *

* Length of time (in minutes) the metric must be at or beyond the threshold * before a scaling event is triggered. *

* * @return Length of time (in minutes) the metric must be at or beyond the * threshold before a scaling event is triggered. */ public Integer getEvaluationPeriods() { return this.evaluationPeriods; } /** *

* Length of time (in minutes) the metric must be at or beyond the threshold * before a scaling event is triggered. *

* * @param evaluationPeriods * Length of time (in minutes) the metric must be at or beyond the * threshold before a scaling event is triggered. * @return Returns a reference to this object so that method calls can be * chained together. */ public ScalingPolicy withEvaluationPeriods(Integer evaluationPeriods) { setEvaluationPeriods(evaluationPeriods); return this; } /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

* * @param metricName * Name of the GameLift-defined metric that is used to trigger an * adjustment. *
    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = * ACTIVATING).
  • *
  • ActiveGameSessions – number of game sessions currently * running (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved * player sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session * slots currently available in active game sessions across the * fleet, calculated by subtracting a game session's current player * session count from its maximum player session count. This number * does include game sessions that are not currently accepting * players (game session PlayerSessionCreationPolicy = * DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running * a game session.
  • *
  • IdleInstances – number of instances not currently * running a game session.
  • *
* @see MetricName */ public void setMetricName(String metricName) { this.metricName = metricName; } /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

* * @return Name of the GameLift-defined metric that is used to trigger an * adjustment. *
    *
  • ActivatingGameSessions – number of game sessions in * the process of being created (game session status = * ACTIVATING).
  • *
  • ActiveGameSessions – number of game sessions currently * running (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved * player sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session * slots currently available in active game sessions across the * fleet, calculated by subtracting a game session's current player * session count from its maximum player session count. This number * does include game sessions that are not currently accepting * players (game session PlayerSessionCreationPolicy = * DENY_ALL).
  • *
  • ActiveInstances – number of instances currently * running a game session.
  • *
  • IdleInstances – number of instances not currently * running a game session.
  • *
* @see MetricName */ public String getMetricName() { return this.metricName; } /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

* * @param metricName * Name of the GameLift-defined metric that is used to trigger an * adjustment. *
    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = * ACTIVATING).
  • *
  • ActiveGameSessions – number of game sessions currently * running (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved * player sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session * slots currently available in active game sessions across the * fleet, calculated by subtracting a game session's current player * session count from its maximum player session count. This number * does include game sessions that are not currently accepting * players (game session PlayerSessionCreationPolicy = * DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running * a game session.
  • *
  • IdleInstances – number of instances not currently * running a game session.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see MetricName */ public ScalingPolicy withMetricName(String metricName) { setMetricName(metricName); return this; } /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

* * @param metricName * Name of the GameLift-defined metric that is used to trigger an * adjustment. *
    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = * ACTIVATING).
  • *
  • ActiveGameSessions – number of game sessions currently * running (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved * player sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session * slots currently available in active game sessions across the * fleet, calculated by subtracting a game session's current player * session count from its maximum player session count. This number * does include game sessions that are not currently accepting * players (game session PlayerSessionCreationPolicy = * DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running * a game session.
  • *
  • IdleInstances – number of instances not currently * running a game session.
  • *
* @see MetricName */ public void setMetricName(MetricName metricName) { this.metricName = metricName.toString(); } /** *

* Name of the GameLift-defined metric that is used to trigger an * adjustment. *

    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = ACTIVATING). *
  • *
  • ActiveGameSessions – number of game sessions currently running * (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved player * sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session slots * currently available in active game sessions across the fleet, calculated * by subtracting a game session's current player session count from its * maximum player session count. This number does include game sessions that * are not currently accepting players (game session * PlayerSessionCreationPolicy = DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running a game * session.
  • *
  • IdleInstances – number of instances not currently running a * game session.
  • *
*

* * @param metricName * Name of the GameLift-defined metric that is used to trigger an * adjustment. *
    *
  • ActivatingGameSessions – number of game sessions in the * process of being created (game session status = * ACTIVATING).
  • *
  • ActiveGameSessions – number of game sessions currently * running (game session status = ACTIVE).
  • *
  • CurrentPlayerSessions – number of active or reserved * player sessions (player session status = ACTIVE or * RESERVED).
  • *
  • AvailablePlayerSessions – number of player session * slots currently available in active game sessions across the * fleet, calculated by subtracting a game session's current player * session count from its maximum player session count. This number * does include game sessions that are not currently accepting * players (game session PlayerSessionCreationPolicy = * DENY_ALL).
  • *
  • ActiveInstances – number of instances currently running * a game session.
  • *
  • IdleInstances – number of instances not currently * running a game session.
  • *
* @return Returns a reference to this object so that method calls can be * chained together. * @see MetricName */ public ScalingPolicy withMetricName(MetricName metricName) { setMetricName(metricName); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getFleetId() != null) sb.append("FleetId: " + getFleetId() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getScalingAdjustment() != null) sb.append("ScalingAdjustment: " + getScalingAdjustment() + ","); if (getScalingAdjustmentType() != null) sb.append("ScalingAdjustmentType: " + getScalingAdjustmentType() + ","); if (getComparisonOperator() != null) sb.append("ComparisonOperator: " + getComparisonOperator() + ","); if (getThreshold() != null) sb.append("Threshold: " + getThreshold() + ","); if (getEvaluationPeriods() != null) sb.append("EvaluationPeriods: " + getEvaluationPeriods() + ","); if (getMetricName() != null) sb.append("MetricName: " + getMetricName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ScalingPolicy == false) return false; ScalingPolicy other = (ScalingPolicy) obj; if (other.getFleetId() == null ^ this.getFleetId() == null) return false; if (other.getFleetId() != null && other.getFleetId().equals(this.getFleetId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getScalingAdjustment() == null ^ this.getScalingAdjustment() == null) return false; if (other.getScalingAdjustment() != null && other.getScalingAdjustment().equals( this.getScalingAdjustment()) == false) return false; if (other.getScalingAdjustmentType() == null ^ this.getScalingAdjustmentType() == null) return false; if (other.getScalingAdjustmentType() != null && other.getScalingAdjustmentType().equals( this.getScalingAdjustmentType()) == false) return false; if (other.getComparisonOperator() == null ^ this.getComparisonOperator() == null) return false; if (other.getComparisonOperator() != null && other.getComparisonOperator().equals( this.getComparisonOperator()) == false) return false; if (other.getThreshold() == null ^ this.getThreshold() == null) return false; if (other.getThreshold() != null && other.getThreshold().equals(this.getThreshold()) == false) return false; if (other.getEvaluationPeriods() == null ^ this.getEvaluationPeriods() == null) return false; if (other.getEvaluationPeriods() != null && other.getEvaluationPeriods().equals( this.getEvaluationPeriods()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFleetId() == null) ? 0 : getFleetId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getScalingAdjustment() == null) ? 0 : getScalingAdjustment().hashCode()); hashCode = prime * hashCode + ((getScalingAdjustmentType() == null) ? 0 : getScalingAdjustmentType().hashCode()); hashCode = prime * hashCode + ((getComparisonOperator() == null) ? 0 : getComparisonOperator().hashCode()); hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode()); hashCode = prime * hashCode + ((getEvaluationPeriods() == null) ? 0 : getEvaluationPeriods().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); return hashCode; } @Override public ScalingPolicy clone() { try { return (ScalingPolicy) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy