-
- All Implemented Interfaces:
-
com.tds.common.websocket.extensions.IExtension
public class DefaultExtension implements IExtension
Class which represents the normal websocket implementation specified by rfc6455.
This is a fallback and will always be available for a Draft_6455
-
-
Method Summary
Modifier and Type Method Description 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 void
isFrameValid(Framedata inputFrame)
Check if the received frame is correctly implemented by the other endpoint and there are nospecification errors (like wrongly set RSV) 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
reset()
Cleaning up internal stats when the draft gets reset. String
toString()
int
hashCode()
boolean
equals(Object o)
-
-
Method Detail
-
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
-
isFrameValid
void isFrameValid(Framedata inputFrame)
Check if the received frame is correctly implemented by the other endpoint and there are nospecification errors (like wrongly set RSV)
- Parameters:
inputFrame
- the received frame
-
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.
-
reset
void reset()
Cleaning up internal stats when the draft gets reset.
-
hashCode
int hashCode()
-
-
-
-