com.amazonaws.services.gamelift.model.GameSessionQueue Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Configuration of a queue that is used to process game session placement requests. The queue configuration identifies
* several game features:
*
*
* -
*
* The destinations where a new game session can potentially be hosted. Amazon GameLift tries these destinations in an
* order based on either the queue's default order or player latency information, if provided in a placement request.
* With latency information, Amazon GameLift can place game sessions where the majority of players are reporting the
* lowest possible latency.
*
*
* -
*
* The length of time that placement requests can wait in the queue before timing out.
*
*
* -
*
* A set of optional latency policies that protect individual players from high latencies, preventing game sessions from
* being placed where any individual player is reporting latency higher than a policy's maximum.
*
*
*
*
* Queue-related operations include:
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GameSessionQueue implements Serializable, Cloneable, StructuredPojo {
/**
*
* Descriptive label that is associated with game session queue. Queue names must be unique within each region.
*
*/
private String name;
/**
*
* Amazon Resource Name (ARN) that
* is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*
*/
private String gameSessionQueueArn;
/**
*
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds
* this time, the game session placement changes to a TIMED_OUT
status.
*
*/
private Integer timeoutInSeconds;
/**
*
* Collection of latency policies to apply when processing game sessions placement requests with player latency
* information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest
* latency values. With just one policy, it is enforced at the start of the game session placement for the duration
* period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a
* queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of
* the placement.
*
*/
private java.util.List playerLatencyPolicies;
/**
*
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by
* either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.
*
*/
private java.util.List destinations;
/**
*
* Descriptive label that is associated with game session queue. Queue names must be unique within each region.
*
*
* @param name
* Descriptive label that is associated with game session queue. Queue names must be unique within each
* region.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* Descriptive label that is associated with game session queue. Queue names must be unique within each region.
*
*
* @return Descriptive label that is associated with game session queue. Queue names must be unique within each
* region.
*/
public String getName() {
return this.name;
}
/**
*
* Descriptive label that is associated with game session queue. Queue names must be unique within each region.
*
*
* @param name
* Descriptive label that is associated with game session queue. Queue names must be unique within each
* region.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withName(String name) {
setName(name);
return this;
}
/**
*
* Amazon Resource Name (ARN) that
* is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*
*
* @param gameSessionQueueArn
* Amazon Resource Name (ARN)
* that is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*/
public void setGameSessionQueueArn(String gameSessionQueueArn) {
this.gameSessionQueueArn = gameSessionQueueArn;
}
/**
*
* Amazon Resource Name (ARN) that
* is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*
*
* @return Amazon Resource Name (ARN) that is assigned to a
* game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*/
public String getGameSessionQueueArn() {
return this.gameSessionQueueArn;
}
/**
*
* Amazon Resource Name (ARN) that
* is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
*
*
* @param gameSessionQueueArn
* Amazon Resource Name (ARN)
* that is assigned to a game session queue and uniquely identifies it. Format is
* arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withGameSessionQueueArn(String gameSessionQueueArn) {
setGameSessionQueueArn(gameSessionQueueArn);
return this;
}
/**
*
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds
* this time, the game session placement changes to a TIMED_OUT
status.
*
*
* @param timeoutInSeconds
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request
* exceeds this time, the game session placement changes to a TIMED_OUT
status.
*/
public void setTimeoutInSeconds(Integer timeoutInSeconds) {
this.timeoutInSeconds = timeoutInSeconds;
}
/**
*
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds
* this time, the game session placement changes to a TIMED_OUT
status.
*
*
* @return Maximum time, in seconds, that a new game session placement request remains in the queue. When a request
* exceeds this time, the game session placement changes to a TIMED_OUT
status.
*/
public Integer getTimeoutInSeconds() {
return this.timeoutInSeconds;
}
/**
*
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds
* this time, the game session placement changes to a TIMED_OUT
status.
*
*
* @param timeoutInSeconds
* Maximum time, in seconds, that a new game session placement request remains in the queue. When a request
* exceeds this time, the game session placement changes to a TIMED_OUT
status.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withTimeoutInSeconds(Integer timeoutInSeconds) {
setTimeoutInSeconds(timeoutInSeconds);
return this;
}
/**
*
* Collection of latency policies to apply when processing game sessions placement requests with player latency
* information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest
* latency values. With just one policy, it is enforced at the start of the game session placement for the duration
* period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a
* queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of
* the placement.
*
*
* @return Collection of latency policies to apply when processing game sessions placement requests with player
* latency information. Multiple policies are evaluated in order of the maximum latency value, starting with
* the lowest latency values. With just one policy, it is enforced at the start of the game session
* placement for the duration period. With multiple policies, each policy is enforced consecutively for its
* duration period. For example, a queue might enforce a 60-second policy followed by a 120-second policy,
* and then no policy for the remainder of the placement.
*/
public java.util.List getPlayerLatencyPolicies() {
return playerLatencyPolicies;
}
/**
*
* Collection of latency policies to apply when processing game sessions placement requests with player latency
* information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest
* latency values. With just one policy, it is enforced at the start of the game session placement for the duration
* period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a
* queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of
* the placement.
*
*
* @param playerLatencyPolicies
* Collection of latency policies to apply when processing game sessions placement requests with player
* latency information. Multiple policies are evaluated in order of the maximum latency value, starting with
* the lowest latency values. With just one policy, it is enforced at the start of the game session placement
* for the duration period. With multiple policies, each policy is enforced consecutively for its duration
* period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no
* policy for the remainder of the placement.
*/
public void setPlayerLatencyPolicies(java.util.Collection playerLatencyPolicies) {
if (playerLatencyPolicies == null) {
this.playerLatencyPolicies = null;
return;
}
this.playerLatencyPolicies = new java.util.ArrayList(playerLatencyPolicies);
}
/**
*
* Collection of latency policies to apply when processing game sessions placement requests with player latency
* information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest
* latency values. With just one policy, it is enforced at the start of the game session placement for the duration
* period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a
* queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of
* the placement.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPlayerLatencyPolicies(java.util.Collection)} or
* {@link #withPlayerLatencyPolicies(java.util.Collection)} if you want to override the existing values.
*
*
* @param playerLatencyPolicies
* Collection of latency policies to apply when processing game sessions placement requests with player
* latency information. Multiple policies are evaluated in order of the maximum latency value, starting with
* the lowest latency values. With just one policy, it is enforced at the start of the game session placement
* for the duration period. With multiple policies, each policy is enforced consecutively for its duration
* period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no
* policy for the remainder of the placement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withPlayerLatencyPolicies(PlayerLatencyPolicy... playerLatencyPolicies) {
if (this.playerLatencyPolicies == null) {
setPlayerLatencyPolicies(new java.util.ArrayList(playerLatencyPolicies.length));
}
for (PlayerLatencyPolicy ele : playerLatencyPolicies) {
this.playerLatencyPolicies.add(ele);
}
return this;
}
/**
*
* Collection of latency policies to apply when processing game sessions placement requests with player latency
* information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest
* latency values. With just one policy, it is enforced at the start of the game session placement for the duration
* period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a
* queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of
* the placement.
*
*
* @param playerLatencyPolicies
* Collection of latency policies to apply when processing game sessions placement requests with player
* latency information. Multiple policies are evaluated in order of the maximum latency value, starting with
* the lowest latency values. With just one policy, it is enforced at the start of the game session placement
* for the duration period. With multiple policies, each policy is enforced consecutively for its duration
* period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no
* policy for the remainder of the placement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withPlayerLatencyPolicies(java.util.Collection playerLatencyPolicies) {
setPlayerLatencyPolicies(playerLatencyPolicies);
return this;
}
/**
*
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by
* either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.
*
*
* @return List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are
* identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference
* order.
*/
public java.util.List getDestinations() {
return destinations;
}
/**
*
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by
* either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.
*
*
* @param destinations
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are
* identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference
* order.
*/
public void setDestinations(java.util.Collection destinations) {
if (destinations == null) {
this.destinations = null;
return;
}
this.destinations = new java.util.ArrayList(destinations);
}
/**
*
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by
* either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDestinations(java.util.Collection)} or {@link #withDestinations(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param destinations
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are
* identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference
* order.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withDestinations(GameSessionQueueDestination... destinations) {
if (this.destinations == null) {
setDestinations(new java.util.ArrayList(destinations.length));
}
for (GameSessionQueueDestination ele : destinations) {
this.destinations.add(ele);
}
return this;
}
/**
*
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by
* either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.
*
*
* @param destinations
* List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are
* identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference
* order.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GameSessionQueue withDestinations(java.util.Collection destinations) {
setDestinations(destinations);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getGameSessionQueueArn() != null)
sb.append("GameSessionQueueArn: ").append(getGameSessionQueueArn()).append(",");
if (getTimeoutInSeconds() != null)
sb.append("TimeoutInSeconds: ").append(getTimeoutInSeconds()).append(",");
if (getPlayerLatencyPolicies() != null)
sb.append("PlayerLatencyPolicies: ").append(getPlayerLatencyPolicies()).append(",");
if (getDestinations() != null)
sb.append("Destinations: ").append(getDestinations());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GameSessionQueue == false)
return false;
GameSessionQueue other = (GameSessionQueue) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getGameSessionQueueArn() == null ^ this.getGameSessionQueueArn() == null)
return false;
if (other.getGameSessionQueueArn() != null && other.getGameSessionQueueArn().equals(this.getGameSessionQueueArn()) == false)
return false;
if (other.getTimeoutInSeconds() == null ^ this.getTimeoutInSeconds() == null)
return false;
if (other.getTimeoutInSeconds() != null && other.getTimeoutInSeconds().equals(this.getTimeoutInSeconds()) == false)
return false;
if (other.getPlayerLatencyPolicies() == null ^ this.getPlayerLatencyPolicies() == null)
return false;
if (other.getPlayerLatencyPolicies() != null && other.getPlayerLatencyPolicies().equals(this.getPlayerLatencyPolicies()) == false)
return false;
if (other.getDestinations() == null ^ this.getDestinations() == null)
return false;
if (other.getDestinations() != null && other.getDestinations().equals(this.getDestinations()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getGameSessionQueueArn() == null) ? 0 : getGameSessionQueueArn().hashCode());
hashCode = prime * hashCode + ((getTimeoutInSeconds() == null) ? 0 : getTimeoutInSeconds().hashCode());
hashCode = prime * hashCode + ((getPlayerLatencyPolicies() == null) ? 0 : getPlayerLatencyPolicies().hashCode());
hashCode = prime * hashCode + ((getDestinations() == null) ? 0 : getDestinations().hashCode());
return hashCode;
}
@Override
public GameSessionQueue clone() {
try {
return (GameSessionQueue) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.gamelift.model.transform.GameSessionQueueMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}