Class MatchmakingTicket

java.lang.Object
software.amazon.awssdk.services.gamelift.model.MatchmakingTicket
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<MatchmakingTicket.Builder,MatchmakingTicket>

@Generated("software.amazon.awssdk:codegen") public final class MatchmakingTicket extends Object implements SdkPojo, Serializable, ToCopyableBuilder<MatchmakingTicket.Builder,MatchmakingTicket>

Ticket generated to track the progress of a matchmaking request. Each ticket is uniquely identified by a ticket ID, supplied by the requester, when creating a matchmaking request.

See Also:
  • Method Details

    • ticketId

      public final String ticketId()

      A unique identifier for a matchmaking ticket.

      Returns:
      A unique identifier for a matchmaking ticket.
    • configurationName

      public final String configurationName()

      Name of the matchmaking configuration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.

      Returns:
      Name of the matchmaking configuration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.
    • configurationArn

      public final String configurationArn()

      The Amazon Resource Name (ARN) associated with the GameLift matchmaking configuration resource that is used with this ticket.

      Returns:
      The Amazon Resource Name (ARN) associated with the GameLift matchmaking configuration resource that is used with this ticket.
    • status

      public final MatchmakingConfigurationStatus status()

      Current status of the matchmaking request.

      • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

      • SEARCHING -- The matchmaking request is currently being processed.

      • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match. This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

      • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

      • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

      • FAILED -- The matchmaking request was not completed.

      • CANCELLED -- The matchmaking request was canceled. This may be the result of a StopMatchmaking operation or a proposed match that one or more players failed to accept.

      • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      Matchmaking requests that fail to successfully complete (statuses FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with new ticket IDs.

      If the service returns an enum value that is not available in the current SDK version, status will return MatchmakingConfigurationStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      Current status of the matchmaking request.

      • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

      • SEARCHING -- The matchmaking request is currently being processed.

      • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match. This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

      • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

      • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

      • FAILED -- The matchmaking request was not completed.

      • CANCELLED -- The matchmaking request was canceled. This may be the result of a StopMatchmaking operation or a proposed match that one or more players failed to accept.

      • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      Matchmaking requests that fail to successfully complete (statuses FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with new ticket IDs.

      See Also:
    • statusAsString

      public final String statusAsString()

      Current status of the matchmaking request.

      • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

      • SEARCHING -- The matchmaking request is currently being processed.

      • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match. This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

      • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

      • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

      • FAILED -- The matchmaking request was not completed.

      • CANCELLED -- The matchmaking request was canceled. This may be the result of a StopMatchmaking operation or a proposed match that one or more players failed to accept.

      • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      Matchmaking requests that fail to successfully complete (statuses FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with new ticket IDs.

      If the service returns an enum value that is not available in the current SDK version, status will return MatchmakingConfigurationStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      Current status of the matchmaking request.

      • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

      • SEARCHING -- The matchmaking request is currently being processed.

      • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match. This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

      • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

      • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

      • FAILED -- The matchmaking request was not completed.

      • CANCELLED -- The matchmaking request was canceled. This may be the result of a StopMatchmaking operation or a proposed match that one or more players failed to accept.

      • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      Matchmaking requests that fail to successfully complete (statuses FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with new ticket IDs.

      See Also:
    • statusReason

      public final String statusReason()

      Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.

      Returns:
      Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.
    • statusMessage

      public final String statusMessage()

      Additional information about the current status.

      Returns:
      Additional information about the current status.
    • startTime

      public final Instant startTime()

      Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      Returns:
      Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
    • endTime

      public final Instant endTime()

      Time stamp indicating when the matchmaking request stopped being processed due to successful completion, timeout, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      Returns:
      Time stamp indicating when the matchmaking request stopped being processed due to successful completion, timeout, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
    • hasPlayers

      public final boolean hasPlayers()
      For responses, this returns true if the service returned a value for the Players property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • players

      public final List<Player> players()

      A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED, the Player objects include the team the players were assigned to in the resulting match.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasPlayers() method.

      Returns:
      A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED, the Player objects include the team the players were assigned to in the resulting match.
    • gameSessionConnectionInfo

      public final GameSessionConnectionInfo gameSessionConnectionInfo()

      Connection information for a new game session. Once a match is made, the FlexMatch engine creates a new game session for it. This information is added to the matchmaking ticket, which you can be retrieve by calling DescribeMatchmaking .

      Returns:
      Connection information for a new game session. Once a match is made, the FlexMatch engine creates a new game session for it. This information is added to the matchmaking ticket, which you can be retrieve by calling DescribeMatchmaking .
    • estimatedWaitTime

      public final Integer estimatedWaitTime()

      Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.

      Returns:
      Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.
    • toBuilder

      public MatchmakingTicket.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<MatchmakingTicket.Builder,MatchmakingTicket>
      Returns:
      a builder for type T
    • builder

      public static MatchmakingTicket.Builder builder()
    • serializableBuilderClass

      public static Class<? extends MatchmakingTicket.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.