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 |
|---|---|
| public static final int | RSV1
Bitmask for RSV1 bit used in extensions. |
| public static final int | RSV2
Bitmask for RSV2 bit used in extensions. |
| public static final int | RSV3
Bitmask for RSV3 bit used in extensions. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | Returns: true if current extension defines specific Opcode
false is current extension does not define specific OpcodeValidate if current extension defines a new WebSocket Opcode. |
| public PooledByteBuffer | Returns: transformed buffer (may be the same one, just with modified contents)Buffer to transform pooledBuffer, StreamSourceFrameChannel working channel channel, boolean 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 frame lastFragmentOfMessage)Transform the supplied buffer per this extension. |
| public PooledByteBuffer | Returns: transformed buffer (may be the same one, just with modified contents)Buffer to transform pooledBuffer, StreamSinkFrameChannel working channel channel, boolean lastFrame)Transform the supplied buffer per this extension. |
| public int | Returns: rsv statuscurrent RSV bits status rsv)Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status. |
| RSV1 | back to summary |
|---|---|
| public static final int RSV1 Bitmask for RSV1 bit used in extensions. | |
| RSV2 | back to summary |
|---|---|
| public static final int RSV2 Bitmask for RSV2 bit used in extensions. | |
| RSV3 | back to summary |
|---|---|
| public static final int RSV3 Bitmask for RSV3 bit used in extensions. | |
| dispose | back to summary |
|---|---|
| public void dispose() Dispose this function. Called upon connection closure | |
| hasExtensionOpCode | back to summary |
|---|---|
| public boolean hasExtensionOpCode() Validate if current extension defines a new WebSocket Opcode.
| |
| transformForRead | back to summary |
|---|---|
| public PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragmentOfMessage) throws IOException Transform the supplied buffer per this extension. The buffer can be modified in place, or a new pooled buffer can be returned (in which case be sure to free the original buffer
| |
| transformForWrite | back to summary |
|---|---|
| public PooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) throws IOException Transform the supplied buffer per this extension. The buffer can be modified in place, or a new pooled buffer can be returned (in which case be sure to free the original buffer
| |
| writeRsv | back to summary |
|---|---|
| public int writeRsv(int rsv) Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status.
| |