public interface ExtensionFunction
It interacts at the connection phase. It is responsible to apply extension's logic before to write and after to read to/from a WebSocket Endpoint.
Several extensions can be present in a WebSocket Endpoint being executed in a chain pattern.
Extension state is stored per WebSocket connection.
Modifier and Type | Field and Description |
---|---|
static int | RSV1 Bitmask for RSV1 bit used in extensions. |
static int | RSV2 Bitmask for RSV2 bit used in extensions. |
static int | RSV3 Bitmask for RSV3 bit used in extensions. |
Modifier and Type | Method and Description |
---|---|
void | dispose() Dispose this function. |
boolean | hasExtensionOpCode() Validate if current extension defines a new WebSocket Opcode. |
PooledByteBuffer | transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragmentOfMessage) Transform the supplied buffer per this extension. |
PooledByteBuffer | transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) Transform the supplied buffer per this extension. |
int | writeRsv(int rsv) Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status. |
static final int RSV1
static final int RSV2
static final int RSV3
boolean hasExtensionOpCode()
true
if current extension defines specific Opcode false
is current extension does not define specific Opcodeint writeRsv(int rsv)
rsv
- current RSV bits statusPooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) throws IOException
pooledBuffer
- Buffer to transformchannel
- working channelIOException
PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragmentOfMessage) throws IOException
pooledBuffer
- Buffer to transformchannel
- working channellastFragmentOfMessage
- If this frame is the last fragment of a message. Note that this may not be received for every message, if the message ends with an empty frameIOException
void dispose()
Copyright © 2020 JBoss by Red Hat. All rights reserved.