Class CompositeExtensionFunction
- java.lang.Object
-
- io.undertow.websockets.extensions.CompositeExtensionFunction
-
- All Implemented Interfaces:
ExtensionFunction
public class CompositeExtensionFunction extends Object implements ExtensionFunction
-
-
Field Summary
-
Fields inherited from interface io.undertow.websockets.extensions.ExtensionFunction
RSV1, RSV2, RSV3
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExtensionFunction
compose(ExtensionFunction... functions)
static ExtensionFunction
compose(List<ExtensionFunction> functions)
void
dispose()
Dispose this function.boolean
hasExtensionOpCode()
Validate if current extension defines a new WebSocket Opcode.PooledByteBuffer
transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragementOfMessage)
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.
-
-
-
Method Detail
-
compose
public static ExtensionFunction compose(List<ExtensionFunction> functions)
-
compose
public static ExtensionFunction compose(ExtensionFunction... functions)
-
hasExtensionOpCode
public boolean hasExtensionOpCode()
Description copied from interface:ExtensionFunction
Validate if current extension defines a new WebSocket Opcode.- Specified by:
hasExtensionOpCode
in interfaceExtensionFunction
- Returns:
true
if current extension defines specific Opcodefalse
is current extension does not define specific Opcode- See Also:
- WebSocket Base Framing Protocol Reference
-
writeRsv
public int writeRsv(int rsv)
Description copied from interface:ExtensionFunction
Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status.- Specified by:
writeRsv
in interfaceExtensionFunction
- Parameters:
rsv
- current RSV bits status- Returns:
- rsv status
-
transformForWrite
public PooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) throws IOException
Description copied from interface:ExtensionFunction
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- Specified by:
transformForWrite
in interfaceExtensionFunction
- Parameters:
pooledBuffer
- Buffer to transformchannel
- working channel- Returns:
- transformed buffer (may be the same one, just with modified contents)
- Throws:
IOException
-
transformForRead
public PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragementOfMessage) throws IOException
Description copied from interface:ExtensionFunction
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- Specified by:
transformForRead
in interfaceExtensionFunction
- Parameters:
pooledBuffer
- Buffer to transformchannel
- working channellastFragementOfMessage
- 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- Returns:
- transformed buffer (may be the same one, just with modified contents)
- Throws:
IOException
-
dispose
public void dispose()
Description copied from interface:ExtensionFunction
Dispose this function. Called upon connection closure- Specified by:
dispose
in interfaceExtensionFunction
-
-