ClientChannel.BasicClientHandshakeStep
protected static interface ClientChannel.ClientHandshakeStep
ClientHandshakeStep
.EventProtocolVersion
response.EventClientRegistered
.ClientChannel.onOpen()
, where creates and sets
(ClientChannel.setHandshakePhase(ClientHandshakeStep)
) the initial step/state.
@Override
protected void onReceiveMessage(final Message msg) {
if (handshakeState != null) {
handshakeState = handshakeState.handleMessage(msg);
if (handshakeState == null) {
// handshake successfully finished
finalyzeHandshake(); // switch channel from 'Opening' to 'Opened'
}
}
...
}
Modifier and Type | Method | Description |
---|---|---|
Message |
getRegistrationRequest() |
This method is intended to be used from
initState() to get
a new instance of handshake request message. |
ClientChannel.ClientHandshakeStep |
handleMessage(Message event) |
This method handles incoming message assuming it is a server response
for the request by
initState() .It is responsible for the following operations: Check that the incoming message is a "successful" response to the request, extract store useful information like session id, server version, etc. If the message is an error message, it should throw appropriate exception. If the message is some acceptable unsolicited event, it may be passed through to user code. It returns null if handshake is successfully finished.
It returns "self" reference to handle next incoming message with this state.
It returns something like (new NextStep()).initState()
to successfully pass this step and to switch to the next one. |
ClientChannel.ClientHandshakeStep |
initState() |
General goal of this method is to send the request message and get ready
to handle server response with
handleMessage(Message) . |
ClientChannel.ClientHandshakeStep initState() throws ProtocolException
handleMessage(Message)
.
Several variations of a handshake step:null
in case of
handshake finish, or "recursively" returns something like
(new NextStep()).initState()
if this step is not the last one.(new NextStep()).initState()
if this step is not the last one.getRegistrationRequest()
.null
if there is no need to wait for any server response
(handshake successfully finished).ProtocolException
- in case of problem on send of the request message.getRegistrationRequest()
,
handleMessage(Message)
Message getRegistrationRequest() throws ProtocolException
initState()
to get
a new instance of handshake request message.ProtocolException
ClientChannel.ClientHandshakeStep handleMessage(Message event) throws ProtocolException
initState()
.null
if handshake is successfully finished.(new NextStep()).initState()
to successfully pass this step and to switch to the next one.event
- incoming message from the server side.ProtocolException
- in case of handshake error
or in case of problem on send of next request message.Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.