Class WebsocketExtension
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
WebsocketExtension.WebsocketExtension$Impl,WebsocketExtensionDeflate
SoupWebsocketExtension is the base class for WebSocket extension objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class implementing a builder pattern to construct a GObject with properties.static classThe WebsocketExtension$Impl type represents a native instance of the abstract WebsocketExtension class.static classThe class structure for theSoupWebsocketExtension.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new WebsocketExtension.WebsocketExtension(MemorySegment address) Create a WebsocketExtension proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebsocketExtensionasParent()Returns this instance as if it were its parent type.booleanconfigure(WebsocketConnectionType connectionType, @Nullable HashTable<MemorySegment, MemorySegment> params) Configures this WebsocketExtension with the givenparams.static MemoryLayoutThe memory layout of the native struct.@Nullable StringGet the parameters strings to be included in the request header.@Nullable StringGet the parameters strings to be included in the response header.static @Nullable TypegetType()Get the GType of the WebsocketExtension classbyte[]processIncomingMessage(Out<Byte> header, byte[] payload) Process a message after it's received.byte[]processOutgoingMessage(Out<Byte> header, byte[] 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, builder, 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
WebsocketExtension
public WebsocketExtension()Creates a new WebsocketExtension.
-
-
Method Details
-
getType
Get the GType of the WebsocketExtension class- Returns:
- the GType
-
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 Javasuperkeyword, 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 HashTable<MemorySegment, MemorySegment> params) throws GErrorExceptionConfigures this WebsocketExtension with the givenparams.- Parameters:
connectionType- eitherWebsocketConnectionType.CLIENTorWebsocketConnectionType.SERVERparams- the parameters- Returns:
trueif extension could be configured with the given parameters, orfalseotherwise- 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
payloadis just returned, otherwiseorg.gnome.glib.Bytes#unrefis called on the givenpayloadand a newGLib.Bytesis 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
nullin case of error - Throws:
GErrorException- seeGError
-
processOutgoingMessage
Process a message before it's sent.If the payload isn't changed the given
payloadis just returned, otherwiseorg.gnome.glib.Bytes#unrefis called on the givenpayloadand a newGLib.Bytesis 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
nullin case of error - Throws:
GErrorException- seeGError
-