public class Handshaker extends Object implements IHandshaker
| Constructor and Description |
|---|
Handshaker(IWebSocketSessionConfig config,
boolean clientMode)
Constructs the handshaker.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClosingReason()
Returns a detailed reason why the handshake phase could not finished
successfully.
|
IExtension |
getExtension(String name)
Returns the negotiated extension identified by the specified name.
|
String[] |
getExtensionNames()
Returns the names of all extensions that have been negotiated
|
IExtension[] |
getExtensions()
Returns all extensions that have been negotiated
|
String |
getSubProtocol()
Return the negotiated sub-protocol.
|
URI |
getUri()
The URI identifying the Web Socket connection for both the client and
server sessions.
|
HandshakeFrame |
handshake()
Initiates the handshake phase by Web Socket clients.
|
HandshakeFrame |
handshake(HandshakeFrame frame)
Processes the handshake frame received from a Web Socket client.
|
boolean |
hasExtensions()
Tells is any extension has been negotiated
|
boolean |
isClientMode()
Tells the mode (server/client) this handshaker is operating
|
boolean |
isClosing()
Tells if this handshake is closing without successfully finishing the
handshake phase.
|
boolean |
isFinished()
Tells if this handshake has successfully finished the handshake phase.
|
void |
setSession(ISession session)
Sets the session object this handshaker is associated with.
|
void |
updateExtensionDecoders(ICodecPipeline pipeline)
Called to updated the pipeline decoders based on the negotiated extensions
|
void |
updateExtensionEncoders(ICodecPipeline pipeline)
Called to updated the pipeline encoders based on the negotiated extensions
|
public Handshaker(IWebSocketSessionConfig config, boolean clientMode)
config - the Web Socket configuration of the session this
handshaker should be associated withclientMode - the mode in witch this handshaker should operatepublic void setSession(ISession session)
IHandshakersetSession in interface IHandshakersession - the session objectpublic boolean isClientMode()
IHandshakerisClientMode in interface IHandshakertrue if this handshaker is operating in the client modepublic boolean isFinished()
IHandshakerisFinished in interface IHandshakertrue if the handshake phase has been successfully finishedpublic boolean isClosing()
IHandshakerisClosing in interface IHandshakertrue if this handshaker is closingpublic String getSubProtocol()
IHandshakergetSubProtocol in interface IHandshakernull if no sub-protocol has
been negotiated.public boolean hasExtensions()
IHandshakerhasExtensions in interface IHandshakertrue if at least one extension has been negotiatedpublic IExtension getExtension(String name)
IHandshakergetExtension in interface IHandshakername - the name of the extension to returnnull if no extension with specified name has
been negotiatedpublic IExtension[] getExtensions()
IHandshakergetExtensions in interface IHandshakerpublic String[] getExtensionNames()
IHandshakergetExtensionNames in interface IHandshakerpublic void updateExtensionEncoders(ICodecPipeline pipeline)
IHandshakerupdateExtensionEncoders in interface IHandshakerpipeline - the pipeline to be updatedpublic void updateExtensionDecoders(ICodecPipeline pipeline)
IHandshakerupdateExtensionDecoders in interface IHandshakerpipeline - the pipeline to be updatedpublic URI getUri()
IHandshakergetUri in interface IHandshakerpublic String getClosingReason()
IHandshakergetClosingReason in interface IHandshakerpublic HandshakeFrame handshake()
IHandshakerhandshake in interface IHandshakerpublic HandshakeFrame handshake(HandshakeFrame frame) throws InvalidHandshakeException
IHandshakerhandshake in interface IHandshakerframe - the received handshake frameInvalidHandshakeExceptionCopyright © 2017–2022 SNF4J.ORG. All rights reserved.