Class WebsocketExtension
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
WebsocketExtension.WebsocketExtensionImpl
,WebsocketExtensionDeflate
SoupWebsocketExtension
is the base class for WebSocket extension objects.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class implementing a builder pattern to construct a GObject with properties.static class
The class structure for theSoupWebsocketExtension
.static class
The WebsocketExtensionImpl type represents a native instance of the abstract WebsocketExtension class.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionWebsocketExtension
(MemorySegment address) Create a WebsocketExtension proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebsocketExtension
asParent()
Returns this instance as if it were its parent type.static WebsocketExtension.Builder
<? extends WebsocketExtension.Builder> builder()
AWebsocketExtension.Builder
object constructs aWebsocketExtension
with the specified properties.boolean
configure
(WebsocketConnectionType connectionType, @Nullable HashTable<MemorySegment, MemorySegment> params) Configures this WebsocketExtension with the givenparams
.static MemoryLayout
The memory layout of the native struct.Get the parameters strings to be included in the request header.Get the parameters strings to be included in the response header.static Type
getType()
Get the GType of the WebsocketExtension classprocessIncomingMessage
(Out<Byte> header, Bytes payload) Process a message after it's received.processOutgoingMessage
(Out<Byte> header, Bytes payload) Process a message before it's sent.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
WebsocketExtension
Create a WebsocketExtension proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
configure
public boolean configure(WebsocketConnectionType connectionType, @Nullable @Nullable HashTable<MemorySegment, MemorySegment> params) throws GErrorExceptionConfigures this WebsocketExtension with the givenparams
.- Parameters:
connectionType
- eitherWebsocketConnectionType.CLIENT
orWebsocketConnectionType.SERVER
params
- the parameters- Returns:
true
if extension could be configured with the given parameters, orfalse
otherwise- Throws:
GErrorException
- seeGError
-
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
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
Process a message after it's received.If the payload isn't changed the given
payload
is just returned, otherwiseBytes.unref()
is called on the givenpayload
and a newGLib.Bytes
is returned with the new data.Extensions using reserved bits of the header will reset them in
header
.- Parameters:
header
- the message headerpayload
- the payload data- Returns:
- the message payload data, or
null
in case of error - Throws:
GErrorException
- seeGError
-
processOutgoingMessage
Process a message before it's sent.If the payload isn't changed the given
payload
is just returned, otherwiseorg.gnome.glib.Bytes#unref
is called on the givenpayload
and a newGLib.Bytes
is returned with the new data.Extensions using reserved bits of the header will change them in
header
.- Parameters:
header
- the message headerpayload
- the payload data- Returns:
- the message payload data, or
null
in case of error - Throws:
GErrorException
- seeGError
-
builder
AWebsocketExtension.Builder
object constructs aWebsocketExtension
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withWebsocketExtension.Builder.build()
.
-