Class WebsocketExtension

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
WebsocketExtension.WebsocketExtension$Impl, WebsocketExtensionDeflate

@Generated("org.javagi.JavaGI") public abstract class WebsocketExtension extends GObject

A WebSocket extension

WebsocketExtension is the base class for WebSocket extension objects.

  • Constructor Details

    • WebsocketExtension

      public WebsocketExtension(MemorySegment address)
      Create a WebsocketExtension instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • WebsocketExtension

      public WebsocketExtension()
      Create a new WebsocketExtension.
  • Method Details

    • getType

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

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected WebsocketExtension asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • configure

      public boolean configure(WebsocketConnectionType connectionType, @Nullable HashTable<MemorySegment, MemorySegment> params) throws GErrorException
      Configures this WebsocketExtension with the given params.
      Parameters:
      connectionType - either WebsocketConnectionType.CLIENT or WebsocketConnectionType.SERVER
      params - the parameters
      Returns:
      true if extension could be configured with the given parameters, or false otherwise
      Throws:
      GErrorException - see GError
    • getRequestParams

      public @Nullable String getRequestParams()

      Get the parameters strings to be included in the request header.

      If the extension doesn't include any parameter in the request, this function returns null.

      Returns:
      a new allocated string with the parameters
    • getResponseParams

      public @Nullable String getResponseParams()

      Get the parameters strings to be included in the response header.

      If the extension doesn't include any parameter in the response, this function returns null.

      Returns:
      a new allocated string with the parameters
    • processIncomingMessage

      public byte[] processIncomingMessage(Out<Byte> header, byte[] payload) throws GErrorException

      Process a message after it's received.

      If the payload isn't changed the given payload is just returned, otherwise org.gnome.glib.Bytes.unref is called on the given payload and a new GLib.Bytes is returned with the new data.

      Extensions using reserved bits of the header will reset them in header.

      Parameters:
      header - the message header
      payload - the payload data
      Returns:
      the message payload data, or null in case of error
      Throws:
      GErrorException - see GError
    • processOutgoingMessage

      public byte[] processOutgoingMessage(Out<Byte> header, byte[] payload) throws GErrorException

      Process a message before it's sent.

      If the payload isn't changed the given payload is just returned, otherwise org.gnome.glib.Bytes.unref is called on the given payload and a new GLib.Bytes is returned with the new data.

      Extensions using reserved bits of the header will change them in header.

      Parameters:
      header - the message header
      payload - the payload data
      Returns:
      the message payload data, or null in case of error
      Throws:
      GErrorException - see GError