Enum Class WebsocketCloseCode

java.lang.Object
java.lang.Enum<WebsocketCloseCode>
org.gnome.soup.WebsocketCloseCode
All Implemented Interfaces:
Serializable, Comparable<WebsocketCloseCode>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum WebsocketCloseCode extends Enum<WebsocketCloseCode> implements Enumeration

Pre-defined close codes that can be passed to WebsocketConnection.close(short, String) or received from WebsocketConnection.getCloseCode().

However, other codes are also allowed.

  • Enum Constant Details

    • NORMAL

      public static final WebsocketCloseCode NORMAL
      a normal, non-error close
    • GOING_AWAY

      public static final WebsocketCloseCode GOING_AWAY
      the client/server is going away
    • PROTOCOL_ERROR

      public static final WebsocketCloseCode PROTOCOL_ERROR
      a protocol error occurred
    • UNSUPPORTED_DATA

      public static final WebsocketCloseCode UNSUPPORTED_DATA
      the endpoint received data of a type that it does not support.
    • NO_STATUS

      public static final WebsocketCloseCode NO_STATUS
      reserved value indicating that no close code was present; must not be sent.
    • ABNORMAL

      public static final WebsocketCloseCode ABNORMAL
      reserved value indicating that the connection was closed abnormally; must not be sent.
    • BAD_DATA

      public static final WebsocketCloseCode BAD_DATA
      the endpoint received data that was invalid (eg, non-UTF-8 data in a text message).
    • POLICY_VIOLATION

      public static final WebsocketCloseCode POLICY_VIOLATION
      generic error code indicating some sort of policy violation.
    • TOO_BIG

      public static final WebsocketCloseCode TOO_BIG
      the endpoint received a message that is too big to process.
    • NO_EXTENSION

      public static final WebsocketCloseCode NO_EXTENSION
      the client is closing the connection because the server failed to negotiate a required extension.
    • SERVER_ERROR

      public static final WebsocketCloseCode SERVER_ERROR
      the server is closing the connection because it was unable to fulfill the request.
    • TLS_HANDSHAKE

      public static final WebsocketCloseCode TLS_HANDSHAKE
      reserved value indicating that the TLS handshake failed; must not be sent.
  • Method Details

    • values

      public static WebsocketCloseCode[] 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 WebsocketCloseCode 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
    • of

      public static WebsocketCloseCode of(int value)
      Create a new WebsocketCloseCode for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static WebsocketCloseCode of(MemorySegment address)
      Create a new WebsocketCloseCode for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the WebsocketCloseCode class.
      Returns:
      the GType