-
- All Implemented Interfaces:
-
com.tds.common.websocket.extensions.IExtension
public class PerMessageDeflateExtension extends CompressionExtension
PerMessage Deflate Extension (7. The "permessage-deflate" Extension in RFC 7692).
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
serverNoContextTakeover
private boolean
clientNoContextTakeover
private Inflater
inflater
private Deflater
deflater
-
Method Summary
Modifier and Type Method Description void
setServerNoContextTakeover(boolean serverNoContextTakeover)
void
setClientNoContextTakeover(boolean clientNoContextTakeover)
Inflater
getInflater()
void
setInflater(Inflater inflater)
Deflater
getDeflater()
void
setDeflater(Deflater deflater)
boolean
isServerNoContextTakeover()
boolean
isClientNoContextTakeover()
void
decodeFrame(Framedata inputFrame)
Decode a frame with a extension specific algorithm. void
encodeFrame(Framedata inputFrame)
Encode a frame with a extension specific algorithm. boolean
acceptProvidedExtensionAsServer(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a server boolean
acceptProvidedExtensionAsClient(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a client String
getProvidedExtensionAsClient()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a client. String
getProvidedExtensionAsServer()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a server. IExtension
copyInstance()
Extensions must only be by one websocket at all. void
isFrameValid(Framedata inputFrame)
This extension requires the RSV1 bit to be set only for the first frame. String
toString()
-
Methods inherited from class com.tds.common.websocket.extensions.DefaultExtension
equals, hashCode, reset
-
Methods inherited from class com.tds.common.websocket.extensions.IExtension
acceptProvidedExtensionAsClient, acceptProvidedExtensionAsServer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setServerNoContextTakeover
void setServerNoContextTakeover(boolean serverNoContextTakeover)
-
setClientNoContextTakeover
void setClientNoContextTakeover(boolean clientNoContextTakeover)
-
getInflater
Inflater getInflater()
-
setInflater
void setInflater(Inflater inflater)
-
getDeflater
Deflater getDeflater()
-
setDeflater
void setDeflater(Deflater deflater)
-
isServerNoContextTakeover
boolean isServerNoContextTakeover()
-
isClientNoContextTakeover
boolean isClientNoContextTakeover()
-
decodeFrame
void decodeFrame(Framedata inputFrame)
Decode a frame with a extension specific algorithm. The algorithm is subject to be implementedby the specific extension. The resulting frame will be used in the application
- Parameters:
inputFrame
- the frame, which has do be decoded to be used in the application
-
encodeFrame
void encodeFrame(Framedata inputFrame)
Encode a frame with a extension specific algorithm. The algorithm is subject to be implementedby the specific extension. The resulting frame will be send to the other endpoint.
- Parameters:
inputFrame
- the frame, which has do be encoded to be used on the other endpoint
-
acceptProvidedExtensionAsServer
boolean acceptProvidedExtensionAsServer(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a server
-
acceptProvidedExtensionAsClient
boolean acceptProvidedExtensionAsClient(String inputExtension)
Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a client
-
getProvidedExtensionAsClient
String getProvidedExtensionAsClient()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a client. If the extension returns an empty string (""), the offer will not beincluded in the handshake.
-
getProvidedExtensionAsServer
String getProvidedExtensionAsServer()
Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a server. If the extension returns an empty string (""), the offer will not beincluded in the handshake.
-
copyInstance
IExtension copyInstance()
Extensions must only be by one websocket at all. To prevent extensions to be used more thanonce the Websocket implementation should call this method in order to create a new usableversion of a given extension instance. The copy can be safely used in conjunction with anew websocket connection.
-
isFrameValid
void isFrameValid(Framedata inputFrame)
This extension requires the RSV1 bit to be set only for the first frame. If the frame is typeis CONTINUOUS, RSV1 bit must be unset.
-
-
-
-