# Class PingCommand

java.lang.Object
it.polimi.ingsw.is25am31.network.socket.clientServerMessages.PingCommand

All Implemented Interfaces:
  `ClientServerCommand`, `Serializable`

public class PingCommand extends Object implements ClientServerCommand, Serializable
Represents a command sent from the client to the server to check the connection status.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PingCommand(UUID clientId)`
  Constructs a new `PingCommand`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `execute(SocketServer server)`
  Executes the command on the `SocketServer`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PingCommand

    public PingCommand(UUID clientId)
    Constructs a new `PingCommand`.
    Parameters:
      `clientId` - The unique identifier of the client sending the ping.

- ## Method Details

  - ### execute

    public void execute(SocketServer server) throws Exception
    Executes the command on the `SocketServer`.
    Specified by:
      `execute` in interface `ClientServerCommand`
    Parameters:
      `server` - The `SocketServer` instance on which the command will be executed.
    Throws:
      `PingErrorException` - if an error occurs while sending this command to the server.
      `Exception` - if an error occurs during command execution.