Class PerMessageDeflateExtension
- All Implemented Interfaces:
Closeable,AutoCloseable,Extension,IncomingFrames,DemandChain,OutgoingFrames
Attempts to follow Compression Extensions for WebSocket
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Used to clean up any resources after connection close.voiddemand(long n) static booleanendsWithTail(ByteBuffer buf) getName()TheSec-WebSocket-Extensionsname for this extension.voidinit(ExtensionConfig config, WebSocketComponents components) booleanUsed to indicate that the extension makes use of the RSV1 bit of the base websocket framing.protected voidnextIncomingFrame(Frame frame, Callback callback) protected voidnextOutgoingFrame(Frame frame, Callback callback, boolean batch) voidProcess the incoming frame.voidvoidvoidA frame, and optional callback, intended for the network layer.voidsetNextDemand(LongConsumer nextDemand) toString()Methods inherited from class org.eclipse.jetty.websocket.core.AbstractExtension
getBufferPool, getConfig, getConfiguration, getCoreSession, getDeflaterPool, getInflaterPool, getNextIncoming, getNextOutgoing, isRsv2User, isRsv3User, setCoreSession, setNextIncomingFrames, setNextOutgoingFrames
-
Constructor Details
-
PerMessageDeflateExtension
public PerMessageDeflateExtension()
-
-
Method Details
-
getName
Description copied from interface:ExtensionTheSec-WebSocket-Extensionsname for this extension.Also known as the
extension-tokenper Section 9.1. Negotiating Extensions.- Specified by:
getNamein interfaceExtension- Overrides:
getNamein classAbstractExtension- Returns:
- the name of the extension
-
isRsv1User
public boolean isRsv1User()Description copied from class:AbstractExtensionUsed to indicate that the extension makes use of the RSV1 bit of the base websocket framing.This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV1.
- Specified by:
isRsv1Userin interfaceExtension- Overrides:
isRsv1Userin classAbstractExtension- Returns:
- true if extension uses RSV1 for its own purposes.
-
sendFrame
Description copied from interface:OutgoingFramesA frame, and optional callback, intended for the network layer.Note: the frame can undergo many transformations in the various layers and extensions present in the implementation.
If you are implementing a mutation, you are obliged to handle the incoming WriteCallback appropriately.
- Specified by:
sendFramein interfaceOutgoingFrames- Overrides:
sendFramein classAbstractExtension- Parameters:
frame- the frame to eventually write to the network layer.callback- the callback to notify when the frame is written.batch- the batch mode requested by the sender.
-
onFrame
Description copied from interface:IncomingFramesProcess the incoming frame.
Note: if you need to hang onto any information from the frame, be sure to copy it, as the information contained in the Frame will be released and/or reused by the implementation.
Failure of the callback will propagate the failure back to the
CoreSessionto fail the connection and attempt to send a closeFrameif one has not been sent.- Specified by:
onFramein interfaceIncomingFrames- Overrides:
onFramein classAbstractExtension- Parameters:
frame- the frame to process.callback- the read completion.
-
init
- Specified by:
initin interfaceExtension- Overrides:
initin classAbstractExtension
-
close
public void close()Description copied from interface:ExtensionUsed to clean up any resources after connection close. -
endsWithTail
-
getDeflater
-
getInflater
-
releaseInflater
public void releaseInflater() -
releaseDeflater
public void releaseDeflater() -
toString
- Overrides:
toStringin classAbstractExtension
-
nextIncomingFrame
- Overrides:
nextIncomingFramein classAbstractExtension
-
nextOutgoingFrame
- Overrides:
nextOutgoingFramein classAbstractExtension
-
setNextDemand
- Specified by:
setNextDemandin interfaceDemandChain
-
demand
public void demand(long n) - Specified by:
demandin interfaceDemandChain
-