
com.amazonaws.services.gamelift.model.RuntimeConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-gamelift Show documentation
/*
* 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;
/**
*
* A collection of server process configurations that describe what processes to run on each instance in a fleet. All
* fleets must have a run-time configuration. Each instance in the fleet launches the server processes specified in the
* run-time configuration and launches new ones as existing processes end. Each instance regularly checks for an updated
* run-time configuration and follows the new instructions.
*
*
* The run-time configuration enables the instances in a fleet to run multiple processes simultaneously. Potential
* scenarios are as follows: (1) Run multiple processes of a single game server executable to maximize usage of your
* hosting resources. (2) Run one or more processes of different build executables, such as your game server executable
* and a related program, or two or more different versions of a game server. (3) Run multiple processes of a single
* game server but with different launch parameters, for example to run one process on each instance in debug mode.
*
*
* A Amazon GameLift instance is limited to 50 processes running simultaneously. A run-time configuration must specify
* fewer than this limit. To calculate the total number of processes specified in a run-time configuration, add the
* values of the ConcurrentExecutions
parameter for each ServerProcess
object in the
* run-time configuration.
*
*
* Fleet-related operations include:
*
*
* -
*
* CreateFleet
*
*
* -
*
* ListFleets
*
*
* -
*
* DeleteFleet
*
*
* -
*
* Describe fleets:
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* -
*
* Update fleets:
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* -
*
* Manage fleet actions:
*
*
* -
*
*
* -
*
* StopFleetActions
*
*
*
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RuntimeConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* Collection of server process configurations that describe which server processes to run on each instance in a
* fleet.
*
*/
private java.util.List serverProcesses;
/**
*
* Maximum number of game sessions with status ACTIVATING
to allow on an instance simultaneously. This
* setting limits the amount of instance resources that can be used for new game activations at any one time.
*
*/
private Integer maxConcurrentGameSessionActivations;
/**
*
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If the game
* session is not active before the timeout, activation is terminated and the game session status is changed to
* TERMINATED
.
*
*/
private Integer gameSessionActivationTimeoutSeconds;
/**
*
* Collection of server process configurations that describe which server processes to run on each instance in a
* fleet.
*
*
* @return Collection of server process configurations that describe which server processes to run on each instance
* in a fleet.
*/
public java.util.List getServerProcesses() {
return serverProcesses;
}
/**
*
* Collection of server process configurations that describe which server processes to run on each instance in a
* fleet.
*
*
* @param serverProcesses
* Collection of server process configurations that describe which server processes to run on each instance
* in a fleet.
*/
public void setServerProcesses(java.util.Collection serverProcesses) {
if (serverProcesses == null) {
this.serverProcesses = null;
return;
}
this.serverProcesses = new java.util.ArrayList(serverProcesses);
}
/**
*
* Collection of server process configurations that describe which server processes to run on each instance in a
* fleet.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setServerProcesses(java.util.Collection)} or {@link #withServerProcesses(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param serverProcesses
* Collection of server process configurations that describe which server processes to run on each instance
* in a fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuntimeConfiguration withServerProcesses(ServerProcess... serverProcesses) {
if (this.serverProcesses == null) {
setServerProcesses(new java.util.ArrayList(serverProcesses.length));
}
for (ServerProcess ele : serverProcesses) {
this.serverProcesses.add(ele);
}
return this;
}
/**
*
* Collection of server process configurations that describe which server processes to run on each instance in a
* fleet.
*
*
* @param serverProcesses
* Collection of server process configurations that describe which server processes to run on each instance
* in a fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuntimeConfiguration withServerProcesses(java.util.Collection serverProcesses) {
setServerProcesses(serverProcesses);
return this;
}
/**
*
* Maximum number of game sessions with status ACTIVATING
to allow on an instance simultaneously. This
* setting limits the amount of instance resources that can be used for new game activations at any one time.
*
*
* @param maxConcurrentGameSessionActivations
* Maximum number of game sessions with status ACTIVATING
to allow on an instance
* simultaneously. This setting limits the amount of instance resources that can be used for new game
* activations at any one time.
*/
public void setMaxConcurrentGameSessionActivations(Integer maxConcurrentGameSessionActivations) {
this.maxConcurrentGameSessionActivations = maxConcurrentGameSessionActivations;
}
/**
*
* Maximum number of game sessions with status ACTIVATING
to allow on an instance simultaneously. This
* setting limits the amount of instance resources that can be used for new game activations at any one time.
*
*
* @return Maximum number of game sessions with status ACTIVATING
to allow on an instance
* simultaneously. This setting limits the amount of instance resources that can be used for new game
* activations at any one time.
*/
public Integer getMaxConcurrentGameSessionActivations() {
return this.maxConcurrentGameSessionActivations;
}
/**
*
* Maximum number of game sessions with status ACTIVATING
to allow on an instance simultaneously. This
* setting limits the amount of instance resources that can be used for new game activations at any one time.
*
*
* @param maxConcurrentGameSessionActivations
* Maximum number of game sessions with status ACTIVATING
to allow on an instance
* simultaneously. This setting limits the amount of instance resources that can be used for new game
* activations at any one time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuntimeConfiguration withMaxConcurrentGameSessionActivations(Integer maxConcurrentGameSessionActivations) {
setMaxConcurrentGameSessionActivations(maxConcurrentGameSessionActivations);
return this;
}
/**
*
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If the game
* session is not active before the timeout, activation is terminated and the game session status is changed to
* TERMINATED
.
*
*
* @param gameSessionActivationTimeoutSeconds
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If
* the game session is not active before the timeout, activation is terminated and the game session status is
* changed to TERMINATED
.
*/
public void setGameSessionActivationTimeoutSeconds(Integer gameSessionActivationTimeoutSeconds) {
this.gameSessionActivationTimeoutSeconds = gameSessionActivationTimeoutSeconds;
}
/**
*
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If the game
* session is not active before the timeout, activation is terminated and the game session status is changed to
* TERMINATED
.
*
*
* @return Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If
* the game session is not active before the timeout, activation is terminated and the game session status
* is changed to TERMINATED
.
*/
public Integer getGameSessionActivationTimeoutSeconds() {
return this.gameSessionActivationTimeoutSeconds;
}
/**
*
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If the game
* session is not active before the timeout, activation is terminated and the game session status is changed to
* TERMINATED
.
*
*
* @param gameSessionActivationTimeoutSeconds
* Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING
. If
* the game session is not active before the timeout, activation is terminated and the game session status is
* changed to TERMINATED
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuntimeConfiguration withGameSessionActivationTimeoutSeconds(Integer gameSessionActivationTimeoutSeconds) {
setGameSessionActivationTimeoutSeconds(gameSessionActivationTimeoutSeconds);
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 (getServerProcesses() != null)
sb.append("ServerProcesses: ").append(getServerProcesses()).append(",");
if (getMaxConcurrentGameSessionActivations() != null)
sb.append("MaxConcurrentGameSessionActivations: ").append(getMaxConcurrentGameSessionActivations()).append(",");
if (getGameSessionActivationTimeoutSeconds() != null)
sb.append("GameSessionActivationTimeoutSeconds: ").append(getGameSessionActivationTimeoutSeconds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RuntimeConfiguration == false)
return false;
RuntimeConfiguration other = (RuntimeConfiguration) obj;
if (other.getServerProcesses() == null ^ this.getServerProcesses() == null)
return false;
if (other.getServerProcesses() != null && other.getServerProcesses().equals(this.getServerProcesses()) == false)
return false;
if (other.getMaxConcurrentGameSessionActivations() == null ^ this.getMaxConcurrentGameSessionActivations() == null)
return false;
if (other.getMaxConcurrentGameSessionActivations() != null
&& other.getMaxConcurrentGameSessionActivations().equals(this.getMaxConcurrentGameSessionActivations()) == false)
return false;
if (other.getGameSessionActivationTimeoutSeconds() == null ^ this.getGameSessionActivationTimeoutSeconds() == null)
return false;
if (other.getGameSessionActivationTimeoutSeconds() != null
&& other.getGameSessionActivationTimeoutSeconds().equals(this.getGameSessionActivationTimeoutSeconds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServerProcesses() == null) ? 0 : getServerProcesses().hashCode());
hashCode = prime * hashCode + ((getMaxConcurrentGameSessionActivations() == null) ? 0 : getMaxConcurrentGameSessionActivations().hashCode());
hashCode = prime * hashCode + ((getGameSessionActivationTimeoutSeconds() == null) ? 0 : getGameSessionActivationTimeoutSeconds().hashCode());
return hashCode;
}
@Override
public RuntimeConfiguration clone() {
try {
return (RuntimeConfiguration) 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.RuntimeConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}