Platform SDK Java 8.5 API Reference

com.genesyslab.platform.outbound.protocol
Class OutboundServerProtocol

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.AbstractChannel
      extended by com.genesyslab.platform.commons.protocol.DuplexChannel
          extended by com.genesyslab.platform.commons.protocol.ClientChannel
              extended by com.genesyslab.platform.outbound.protocol.OutboundServerProtocol
All Implemented Interfaces:
AsyncChannel, AsyncChannelOperations, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, LogMessageFilterSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel, OutboundServerProtocolHandshakeOptions

@ProtocolDescription.Tag(sdkName="Outbound",
                         protocolName="OutboundServer")
public class OutboundServerProtocol
extends ClientChannel
implements OutboundServerProtocolHandshakeOptions

Use an OutboundServerProtocol object to establish communication between a client application and Outbound Server.

Here is a sample of how to establish communication with Outbound Server:

 OutboundServerProtocol outboundServerProtocol =
   new OutboundServerProtocol(
     new Endpoint(
       outboundServerEPName,
       host,
       port));
 outboundServerProtocol.setClientName(clientName);
 outboundServerProtocol.setClientPassword(clientPwd);
 outboundServerProtocol.setUserName(userName);
 outboundServerProtocol.setUserPassword(userPwd);
 outboundServerProtocol.open();
 
When you are finished communicating with the server, you can close the channel like this:
 outboundServerProtocol.close();
 

Note: Starting from Platform SDK 8.5.0 version, main protocol channel classes (including OutboundServerProtocol) are no longer "final".
It helps with applications unit testing. At the same time it opens access and allows to override protocols internal protected staff from custom child classes.
Changes or extensions of the protocols functionality in child classes must be done very carefully with clear understanding of affected components and functionality.
Also, protected PSDK methods and elements are not a part of public API, and may be a subject for changes without special notice. So, application, which uses or overrides internal/protected staff, may have compatibility issues on PSDK update.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.protocol.ClientChannel
ClientChannel.BasicClientHandshakeStep, ClientChannel.ClientHandshakeStep, ClientChannel.RegistrationHandler, ClientChannel.SimpleRegistrationHandler
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
AbstractChannel.AsyncErrorNotifier
 
Field Summary
 
Fields inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel
messageFilter
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver
DEF_INPUT_SIZE
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
 
Constructor Summary
OutboundServerProtocol()
          Creates instance of OutboundServerProtocol.
OutboundServerProtocol(Endpoint endpoint)
          Creates instance of OutboundServerProtocol.
OutboundServerProtocol(Endpoint endpoint, long timeout)
          Creates instance of OutboundServerProtocol.
 
Method Summary
 java.lang.String getClientName()
          Returns the Outbound Server client name for connection handshake procedure.
 java.lang.String getClientPassword()
          Returns optional client application password.
protected  com.genesyslab.platform.commons.protocol.runtime.license.LicenseRestriction getDefaultRestriction()
          Returns default restriction for protocol.
 java.lang.String getUserName()
          Returns user name property for the Outbound Server connection.
 java.lang.String getUserPassword()
          Returns user password property for the Outbound Server connection.
protected  void onOpen()
          This method is called when channel is opened and just about to call event handler.
 void setClientName(java.lang.String clientName)
          Sets the Outbound Server client name for connection handshake procedure.
 void setClientPassword(java.lang.String clientPassword)
          Sets optional client application password.
 void setUserName(java.lang.String userName)
          Sets user name property for the Outbound Server connection.
 void setUserPassword(java.lang.String userPassword)
          Sets user password property for the Outbound Server connection.
 
Methods inherited from class com.genesyslab.platform.commons.protocol.ClientChannel
beginClose, beginOpen, beginRequest, close, close, closeAsync, closeAsync, disableConnectionOperations, doBeginRequest, doBeginRequest, doRequest, endRequest, endRequest, fireUnsolicitedEvents, getCopyResponse, getInvoker, getOpenTimeoutException, getReferenceBuilder, onReceiveMessage, onSend, onUnexpectedHandshakeMessage, open, openAsync, openAsync, request, request, requestAsync, requestAsync, setAddressResolver, setAddressResolverParams, setAddressResolverParams, setCopyResponse, setEndpoint, setHandshakeFinished, setHandshakePhase, setHandshakeUnsolicitedEventsPassLimit, setRegistrationHandler, setState, submitRegMessage, throwOnUnReferenceableRequest
 
Methods inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel
addListener, applyConfiguration, cancelCloseTimeout, cancelOpenTimeout, clearInput, close, closeAsync, createChannelClosedEvent, createConnection, createConnectionClosedEvent, doBeginClose, doClose, doSend, downgradeConnection, getEnpointPrefixInfo, getInputSize, getInterceptor, getLocalEndPoint, getLocalEndpointInfo, getLogMessageFilter, getProtocolDescription, getProtocolFactory, getProtocolId, getRemoteEndPoint, getTimeoutException, initPackager, isMessageAllowed, notifyWithObject, onClose, onFireClosed, onFireErrorEvent, onFireOpened, open, openAsync, openAsync, processClose, processCloseAll, receive, receive, receivedMessage, releaseReceivers, removeListener, resetReceiver, resumeReading, send, setConnectionInvoker, setExternalTransport, setInputSize, setLogMessageFilter, setMessageHandler, setProtocolData, setReceiver, startUpgradeConnection, stopReading, toString, triggerWithObject, upgradeConnection, waitForObject
 
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getServerContext, getState, getStateMods, getTimeout, internal, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setInvoker, setServerContext, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Protocol
getProtocolId
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.InputChannel
setMessageHandler
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.MessageReceiver
receive, receive
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Receiver
clearInput, getInputSize, releaseReceivers, setInputSize
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.OutputChannel
addListener, removeListener, send
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
close, getTimeout, open, setTimeout
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel
getState
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ChannelListenerSupport
addChannelListener, removeChannelListener
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.InterceptorSupport
getInterceptor
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.MessageReceiverManagement
setReceiver
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ReceiverManagement
resetReceiver
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConfigurationSupport
configure, getConfiguration
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.EndpointSupport
getEndpoint
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ProtocolDescriptionSupport
getProtocolDescription
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncInvokerSupport
setInvoker
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConnectionInvokerSupport
setConnectionInvoker
 

Constructor Detail

OutboundServerProtocol

public OutboundServerProtocol()
Creates instance of OutboundServerProtocol.


OutboundServerProtocol

public OutboundServerProtocol(Endpoint endpoint)
Creates instance of OutboundServerProtocol.

Parameters:
endpoint - Parameters of the connection to create

OutboundServerProtocol

public OutboundServerProtocol(Endpoint endpoint,
                              long timeout)
Creates instance of OutboundServerProtocol.

Parameters:
endpoint - Parameters of the connection to create
timeout - Timeout to wait for message (in milliseconds)
Method Detail

getDefaultRestriction

protected com.genesyslab.platform.commons.protocol.runtime.license.LicenseRestriction getDefaultRestriction()
Description copied from class: DuplexChannel
Returns default restriction for protocol. By default returns empty restriction, so that all operations are allowed.

Overrides:
getDefaultRestriction in class DuplexChannel
Returns:
licensing restriction

getClientName

public java.lang.String getClientName()
Returns the Outbound Server client name for connection handshake procedure. Usually it represents application name of this Outbound Server client.

Specified by:
getClientName in interface OutboundServerProtocolHandshakeOptions
Returns:
client name
See Also:
setClientName(String)

setClientName

public void setClientName(java.lang.String clientName)
Sets the Outbound Server client name for connection handshake procedure. Usually it represents application name of this Outbound Server client.

Specified by:
setClientName in interface OutboundServerProtocolHandshakeOptions
Parameters:
clientName - client name

getClientPassword

public java.lang.String getClientPassword()
Returns optional client application password.

Specified by:
getClientPassword in interface OutboundServerProtocolHandshakeOptions
Returns:
application password or null
See Also:
setClientPassword(String)

setClientPassword

public void setClientPassword(java.lang.String clientPassword)
Sets optional client application password.

Specified by:
setClientPassword in interface OutboundServerProtocolHandshakeOptions
Parameters:
clientPassword - application password

getUserName

public java.lang.String getUserName()
Returns user name property for the Outbound Server connection.

Specified by:
getUserName in interface OutboundServerProtocolHandshakeOptions
Returns:
user name
See Also:
setUserName(String)

setUserName

public void setUserName(java.lang.String userName)
Sets user name property for the Outbound Server connection.

Specified by:
setUserName in interface OutboundServerProtocolHandshakeOptions
Parameters:
userName - user name

getUserPassword

public java.lang.String getUserPassword()
Returns user password property for the Outbound Server connection.

Specified by:
getUserPassword in interface OutboundServerProtocolHandshakeOptions
Returns:
user password
See Also:
setUserPassword(String)

setUserPassword

public void setUserPassword(java.lang.String userPassword)
Sets user password property for the Outbound Server connection.

Specified by:
setUserPassword in interface OutboundServerProtocolHandshakeOptions
Parameters:
userPassword - user password

onOpen

protected void onOpen()
               throws ProtocolException
Description copied from class: DuplexChannel
This method is called when channel is opened and just about to call event handler. You usually will need to add some logic here and call super.onOpen() at the end of your method. Please note, that calling super.onOpen() on the thread other then open() was called will most probably result in deadlock for some scenarios (like calling close() inside of onChannelOpened())

Overrides:
onOpen in class ClientChannel
Throws:
ProtocolException - if there are problems during post open operations (e.g. registration)

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.