Enum Class ConnectionOutcome

java.lang.Object
java.lang.Enum<ConnectionOutcome>
me.remigio07.chatplugin.api.server.util.socket.ConnectionOutcome
All Implemented Interfaces:
Serializable, Comparable<ConnectionOutcome>, Constable

public enum ConnectionOutcome extends Enum<ConnectionOutcome>
Represents the possible outcomes that may occur when Client.connect(String) is called.
  • Enum Constant Details

    • SUCCESS

      public static final ConnectionOutcome SUCCESS
      The connection was successful. The client and the server are ready to communicate.
    • ALREADY_CONNECTED

      public static final ConnectionOutcome ALREADY_CONNECTED
      The client was already connected to the server. Nothing will happen; the client may communicate with the server.
    • ID_ALREADY_IN_USE

      public static final ConnectionOutcome ID_ALREADY_IN_USE
      The specified ID was already in use by another client. The connection will be terminated and no events will be called.
    • INVALID_ID

      public static final ConnectionOutcome INVALID_ID
      The specified ID did not respect ClientHandler.CLIENT_ID_PATTERN. The connection will be terminated and no events will be called.
    • TIMEOUT

      public static final ConnectionOutcome TIMEOUT
      The client was not able to reach the server within 5000ms. The connection will be terminated and no events will be called.
  • Method Details

    • values

      public static ConnectionOutcome[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ConnectionOutcome valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getMessage

      public String getMessage()
      Gets this connection outcome's message.
      Returns:
      Outcome's message