public class PerMessageDeflateExtension extends CompressionExtension
| Constructor and Description |
|---|
PerMessageDeflateExtension() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptProvidedExtensionAsClient(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific
extension if the endpoint is in the role of a client
|
boolean |
acceptProvidedExtensionAsServer(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific
extension if the endpoint is in the role of a server
|
IExtension |
copyInstance()
Extensions must only be by one websocket at all.
|
void |
decodeFrame(Framedata inputFrame)
Decode a frame with a extension specific algorithm.
|
void |
encodeFrame(Framedata inputFrame)
Encode a frame with a extension specific algorithm.
|
Deflater |
getDeflater() |
Inflater |
getInflater() |
String |
getProvidedExtensionAsClient()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is
in the role of a client.
|
String |
getProvidedExtensionAsServer()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is
in the role of a server.
|
int |
getThreshold()
Get the size threshold for doing the compression
|
boolean |
isClientNoContextTakeover()
Access the "client_no_context_takeover" extension parameter
|
void |
isFrameValid(Framedata inputFrame)
This extension requires the RSV1 bit to be set only for the first frame.
|
boolean |
isServerNoContextTakeover()
Access the "server_no_context_takeover" extension parameter
|
void |
setClientNoContextTakeover(boolean clientNoContextTakeover)
Setter for the "client_no_context_takeover" extension parameter
|
void |
setDeflater(Deflater deflater) |
void |
setInflater(Inflater inflater) |
void |
setServerNoContextTakeover(boolean serverNoContextTakeover)
Setter for the "server_no_context_takeover" extension parameter
|
void |
setThreshold(int threshold)
Set the size when payloads smaller than this will not be compressed.
|
String |
toString()
Return a string which should contain the class name as well as additional information about the
current configurations for this extension (DEBUG purposes)
|
equals, hashCode, resetpublic Inflater getInflater()
public void setInflater(Inflater inflater)
public Deflater getDeflater()
public void setDeflater(Deflater deflater)
public int getThreshold()
public void setThreshold(int threshold)
threshold - the size in bytespublic boolean isServerNoContextTakeover()
public void setServerNoContextTakeover(boolean serverNoContextTakeover)
serverNoContextTakeover - set the server no context parameterpublic boolean isClientNoContextTakeover()
public void setClientNoContextTakeover(boolean clientNoContextTakeover)
clientNoContextTakeover - set the client no context parameterpublic void decodeFrame(Framedata inputFrame) throws InvalidDataException
IExtensiondecodeFrame in interface IExtensiondecodeFrame in class DefaultExtensioninputFrame - the frame, which has do be decoded to be used in the applicationInvalidDataException - Throw InvalidDataException if the received frame is not correctly
implemented by the other endpoint or there are other protocol
errors/decoding errorspublic void encodeFrame(Framedata inputFrame)
IExtensionencodeFrame in interface IExtensionencodeFrame in class DefaultExtensioninputFrame - the frame, which has do be encoded to be used on the other endpointpublic boolean acceptProvidedExtensionAsServer(String inputExtension)
IExtensionacceptProvidedExtensionAsServer in interface IExtensionacceptProvidedExtensionAsServer in class DefaultExtensioninputExtension - the received Sec-WebSocket-Extensions header field offered by the
other endpointpublic boolean acceptProvidedExtensionAsClient(String inputExtension)
IExtensionacceptProvidedExtensionAsClient in interface IExtensionacceptProvidedExtensionAsClient in class DefaultExtensioninputExtension - the received Sec-WebSocket-Extensions header field offered by the
other endpointpublic String getProvidedExtensionAsClient()
IExtensiongetProvidedExtensionAsClient in interface IExtensiongetProvidedExtensionAsClient in class DefaultExtensionpublic String getProvidedExtensionAsServer()
IExtensiongetProvidedExtensionAsServer in interface IExtensiongetProvidedExtensionAsServer in class DefaultExtensionpublic IExtension copyInstance()
IExtensioncopyInstance in interface IExtensioncopyInstance in class DefaultExtensionpublic void isFrameValid(Framedata inputFrame) throws InvalidDataException
isFrameValid in interface IExtensionisFrameValid in class CompressionExtensioninputFrame - the received frameInvalidDataException - Throw InvalidDataException if the received frame is not correctly
implementing the specification for the specific extensionpublic String toString()
IExtensiontoString in interface IExtensiontoString in class DefaultExtensionCopyright © 2022. All rights reserved.