Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.protocol
Class ClientChannel.BasicClientHandshakeStep

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.ClientChannel.BasicClientHandshakeStep
All Implemented Interfaces:
ClientChannel.ClientHandshakeStep
Enclosing class:
ClientChannel

protected abstract class ClientChannel.BasicClientHandshakeStep
extends java.lang.Object
implements ClientChannel.ClientHandshakeStep

Abstract class with common or some default logic for client handshake steps.

See Also:
ClientChannel.setHandshakePhase(ClientHandshakeStep), ClientChannel.onOpen()

Field Summary
protected  ILogger log
           
protected  Message theRequest
           
protected  java.lang.Object theRequestRefId
           
 
Constructor Summary
protected ClientChannel.BasicClientHandshakeStep()
           
 
Method Summary
protected  boolean checkReferenceId(Message event)
          Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to compare incoming message ReferenceID with ReferenceID of the request sent by initState().
protected  ClientChannel.ClientHandshakeStep getNextStep()
          Creates and returns instance of the next handshake step.
protected  ClientChannel.ClientHandshakeStep gotoNextStep()
          Gets instance of the next step with virtual getNextStep().
 ClientChannel.ClientHandshakeStep initState()
          Default implementation of this interface method is very simple.
It gets new instance of the request message, sends it and returns self reference to be called when server response arrived.
protected  ClientChannel.ClientHandshakeStep passEventDirectly(Message event)
          Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to enqueue and later pass unsolicited protocol messages to user code after handshake finished and the channel set as "Opened".
protected  ClientChannel.ClientHandshakeStep passEventThrough(Message event)
          Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to enqueue and later pass unsolicited protocol messages to user code after handshake finished and the channel set as "Opened".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ClientChannel.ClientHandshakeStep
getRegistrationRequest, handleMessage
 

Field Detail

log

protected final ILogger log

theRequest

protected Message theRequest

theRequestRefId

protected java.lang.Object theRequestRefId
Constructor Detail

ClientChannel.BasicClientHandshakeStep

protected ClientChannel.BasicClientHandshakeStep()
Method Detail

initState

public ClientChannel.ClientHandshakeStep initState()
                                            throws ProtocolException
Default implementation of this interface method is very simple.
It gets new instance of the request message, sends it and returns self reference to be called when server response arrived.

Specified by:
initState in interface ClientChannel.ClientHandshakeStep
Returns:
step reference to wait for server response or null if there is no need to wait for any server response (handshake successfully finished).
Throws:
ProtocolException - in case of problem on send of the request message.
See Also:
ClientChannel.ClientHandshakeStep.getRegistrationRequest()

checkReferenceId

protected boolean checkReferenceId(Message event)
Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to compare incoming message ReferenceID with ReferenceID of the request sent by initState().

Parameters:
event - incoming protocol message.
Returns:
true if ReferenceIDs are the same or the request was unreferenced; elsewhere it returns false.

passEventThrough

protected ClientChannel.ClientHandshakeStep passEventThrough(Message event)
                                                      throws ProtocolException
Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to enqueue and later pass unsolicited protocol messages to user code after handshake finished and the channel set as "Opened".

This method checks deliverMessagesWhileHandshake flag. It delivers given event to application or throws exception if this feature is not enabled (by default it is not enabled).

Parameters:
event - incoming message to be passed to user code.
Returns:
self reference.
Throws:
ProtocolException - if the channel rejected the unsolicited message. See the exception message for details.
See Also:
passEventDirectly(Message)

passEventDirectly

protected ClientChannel.ClientHandshakeStep passEventDirectly(Message event)
Its an utility method to be used from particular steps implementations in ClientChannel.ClientHandshakeStep.handleMessage(Message) to enqueue and later pass unsolicited protocol messages to user code after handshake finished and the channel set as "Opened".

Parameters:
event - incoming message to be passed to user code.
Returns:
self reference.
Throws:
java.lang.IllegalStateException - if the channel rejected the unsolicited message. See the exception message for details.
See Also:
passEventThrough(Message)

gotoNextStep

protected ClientChannel.ClientHandshakeStep gotoNextStep()
                                                  throws ProtocolException
Gets instance of the next step with virtual getNextStep(). Then it initializes the next step (if it is not null).
This method returns initialized instance of the next step, or null if next step is null or its initialization method returned null.

Returns:
initialized instance of next state or null.
Throws:
ProtocolException - in case of error in initialization of the next step or problem on send of the next request message.
See Also:
getNextStep()

getNextStep

protected ClientChannel.ClientHandshakeStep getNextStep()
Creates and returns instance of the next handshake step. It is intended to be called from gotoNextStep() before return from ClientChannel.ClientHandshakeStep.handleMessage(Message) or initState().

Default implementation returns null.

Returns:
new instance of the next step or null.

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.