/* * Copyright 2018-2023 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; /** *

* Represents a player session. Player sessions are created either for a specific game session, or as part of a game * session placement or matchmaking request. A player session can represents a reserved player slot in a game session * (when status is RESERVED) or actual player activity in a game session (when status is * ACTIVE). A player session object, including player data, is automatically passed to a game session when * the player connects to the game session and is validated. After the game session ends, player sessions information is * retained for 30 days and then removed. *

*

* Related actions *

*

* All APIs by task *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PlayerSession implements Serializable, Cloneable, StructuredPojo { /** *

* A unique identifier for a player session. *

*/ private String playerSessionId; /** *

* A unique identifier for a player that is associated with this player session. *

*/ private String playerId; /** *

* A unique identifier for the game session that the player session is connected to. *

*/ private String gameSessionId; /** *

* A unique identifier for the fleet that the player's game session is running on. *

*/ private String fleetId; /** *

* The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ private String fleetArn; /** *

* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

*/ private java.util.Date creationTime; /** *

* A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

*/ private java.util.Date terminationTime; /** *

* Current status of the player session. *

*

* Possible player session statuses include the following: *

* */ private String status; /** *

* The IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address * and port number. *

*/ private String ipAddress; /** *

* The DNS identifier assigned to the instance that is running the game session. Values have the following format: *

* *

* When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP * address. *

*/ private String dnsName; /** *

* Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP * address and port number. *

*/ private Integer port; /** *

* Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted * as needed for use in the game. *

*/ private String playerData; /** *

* A unique identifier for a player session. *

* * @param playerSessionId * A unique identifier for a player session. */ public void setPlayerSessionId(String playerSessionId) { this.playerSessionId = playerSessionId; } /** *

* A unique identifier for a player session. *

* * @return A unique identifier for a player session. */ public String getPlayerSessionId() { return this.playerSessionId; } /** *

* A unique identifier for a player session. *

* * @param playerSessionId * A unique identifier for a player session. * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withPlayerSessionId(String playerSessionId) { setPlayerSessionId(playerSessionId); return this; } /** *

* A unique identifier for a player that is associated with this player session. *

* * @param playerId * A unique identifier for a player that is associated with this player session. */ public void setPlayerId(String playerId) { this.playerId = playerId; } /** *

* A unique identifier for a player that is associated with this player session. *

* * @return A unique identifier for a player that is associated with this player session. */ public String getPlayerId() { return this.playerId; } /** *

* A unique identifier for a player that is associated with this player session. *

* * @param playerId * A unique identifier for a player that is associated with this player session. * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withPlayerId(String playerId) { setPlayerId(playerId); return this; } /** *

* A unique identifier for the game session that the player session is connected to. *

* * @param gameSessionId * A unique identifier for the game session that the player session is connected to. */ public void setGameSessionId(String gameSessionId) { this.gameSessionId = gameSessionId; } /** *

* A unique identifier for the game session that the player session is connected to. *

* * @return A unique identifier for the game session that the player session is connected to. */ public String getGameSessionId() { return this.gameSessionId; } /** *

* A unique identifier for the game session that the player session is connected to. *

* * @param gameSessionId * A unique identifier for the game session that the player session is connected to. * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withGameSessionId(String gameSessionId) { setGameSessionId(gameSessionId); return this; } /** *

* A unique identifier for the fleet that the player's game session is running on. *

* * @param fleetId * A unique identifier for the fleet that the player's game session is running on. */ public void setFleetId(String fleetId) { this.fleetId = fleetId; } /** *

* A unique identifier for the fleet that the player's game session is running on. *

* * @return A unique identifier for the fleet that the player's game session is running on. */ public String getFleetId() { return this.fleetId; } /** *

* A unique identifier for the fleet that the player's game session is running on. *

* * @param fleetId * A unique identifier for the fleet that the player's game session is running on. * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withFleetId(String fleetId) { setFleetId(fleetId); return this; } /** *

* The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

* * @param fleetArn * The Amazon Resource Name (ARN) associated with the * GameLift fleet that the player's game session is running on. */ public void setFleetArn(String fleetArn) { this.fleetArn = fleetArn; } /** *

* The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

* * @return The Amazon Resource Name (ARN) associated with the * GameLift fleet that the player's game session is running on. */ public String getFleetArn() { return this.fleetArn; } /** *

* The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

* * @param fleetArn * The Amazon Resource Name (ARN) associated with the * GameLift fleet that the player's game session is running on. * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withFleetArn(String fleetArn) { setFleetArn(fleetArn); return this; } /** *

* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @param creationTime * A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). */ public void setCreationTime(java.util.Date creationTime) { this.creationTime = creationTime; } /** *

* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @return A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). */ public java.util.Date getCreationTime() { return this.creationTime; } /** *

* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @param creationTime * A time stamp indicating when this data object was created. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withCreationTime(java.util.Date creationTime) { setCreationTime(creationTime); return this; } /** *

* A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @param terminationTime * A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). */ public void setTerminationTime(java.util.Date terminationTime) { this.terminationTime = terminationTime; } /** *

* A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @return A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time * as milliseconds (for example "1469498468.057"). */ public java.util.Date getTerminationTime() { return this.terminationTime; } /** *

* A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). *

* * @param terminationTime * A time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as * milliseconds (for example "1469498468.057"). * @return Returns a reference to this object so that method calls can be chained together. */ public PlayerSession withTerminationTime(java.util.Date terminationTime) { setTerminationTime(terminationTime); return this; } /** *

* Current status of the player session. *

*

* Possible player session statuses include the following: *

* * * @param status * Current status of the player session.

*

* Possible player session statuses include the following: *

*