-
- 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 booleanserverNoContextTakeoverprivate booleanclientNoContextTakeoverprivate Inflaterinflaterprivate Deflaterdeflater
-
Method Summary
Modifier and Type Method Description voidsetServerNoContextTakeover(boolean serverNoContextTakeover)voidsetClientNoContextTakeover(boolean clientNoContextTakeover)InflatergetInflater()voidsetInflater(Inflater inflater)DeflatergetDeflater()voidsetDeflater(Deflater deflater)booleanisServerNoContextTakeover()booleanisClientNoContextTakeover()voiddecodeFrame(Framedata inputFrame)Decode a frame with a extension specific algorithm. voidencodeFrame(Framedata inputFrame)Encode a frame with a extension specific algorithm. booleanacceptProvidedExtensionAsServer(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 booleanacceptProvidedExtensionAsClient(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 StringgetProvidedExtensionAsClient()Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a client. StringgetProvidedExtensionAsServer()Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a server. IExtensioncopyInstance()Extensions must only be by one websocket at all. voidisFrameValid(Framedata inputFrame)This extension requires the RSV1 bit to be set only for the first frame. StringtoString()-
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.
-
-
-
-