Platform SDK Java 8.5 API Reference

com.genesyslab.platform.clusterprotocol
Interface ClusterProtocol

All Superinterfaces:
AsyncChannel, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel
All Known Implementing Classes:
ClusterProtocolImpl, EspClusterProtocol, EspEmailClusterProtocol, FlexChatClusterProtocol, UcsClusterProtocol

public interface ClusterProtocol
extends Protocol

Interface representing a client protocol connection on top of encapsulated multiple protocol connections to a cluster of similarly configured servers.


Field Summary
 
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
 
Method Summary
 void addNodes(java.lang.Iterable<WSConfig> nodes)
          Adds collection of WarmStandby configurations as additional cluster protocol nodes.
 void addNodes(WSConfig... nodes)
          Adds list of WarmStandby configurations as additional cluster protocol nodes.
 void addNodesEndpoints(Endpoint... endpoints)
          Adds Endpoint's list as additional cluster protocol nodes.
 void addNodesEndpoints(java.lang.Iterable<Endpoint> endpoints)
          Adds Endpoint's collection as additional cluster protocol nodes.
<A> void
closeAsync(CompletionHandler<ChannelClosedEvent,? super A> handler, A attachment)
          Initiates connections close to all of the cluster nodes.
Provided Completion Handler will be notified when all cluster nodes connections got closed.
 java.util.List<Protocol> getAllNodesProtocols()
          Returns snapshot list of all cluster protocol nodes.
 Protocol getNextAvailableProtocol()
          Returns reference to some opened instance of protocol in the cluster nodes pool in accordance to the LB strategy.
 Protocol getNextAvailableProtocol(Message message)
          Returns reference to some opened instance of protocol in the cluster nodes pool in accordance to the LB strategy for handling of the given request message.
 Protocol getNodeProtocol(int protocolId)
          Returns cluster protocol node instance by PSDK Protocol Id.
It may be useful in cases, when it is required to get particular server connection by ProtocolId of specific response, or unsolicited event message.
 Protocol getNodeProtocol(java.lang.String nodeName)
          Returns cluster protocol node instance by name of configured Endpoint or WSConfig.
 java.util.List<WSConfig> getNodesConfig()
          Returns list of cluster nodes connections configurations.
 java.util.List<Protocol> getOpenedNodesProtocols()
          Returns snapshot list of cluster protocol nodes, which are tracked as Opened at the moment.
<A> void
openAsync(CompletionHandler<ChannelOpenedEvent,? super A> handler, A attachment)
          Initiates connections to the initialized set of cluster nodes.
The completion handler will be notified by the first connection open event.
 ClusterProtocolPolicy policy()
          Returns reference to the actual cluster protocol policy.
 void removeNodes(java.lang.Iterable<java.lang.String> names)
          Removes cluster protocol node(s) by given nodes names.
 void removeNodes(java.lang.String... names)
          Removes cluster protocol node(s) by given nodes names.
 void setNodes(java.lang.Iterable<WSConfig> nodes)
          Sets or resets actual cluster nodes WarmStandby connections configurations.
 void setNodes(WSConfig... nodes)
          Sets or resets actual cluster nodes WarmStandby connections configurations.
 void setNodesEndpoints(Endpoint... endpoints)
          Sets or resets actual cluster nodes Endpoint's list.
 void setNodesEndpoints(java.lang.Iterable<Endpoint> endpoints)
          Sets or resets actual cluster nodes Endpoint's list.
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Protocol
getProtocolId, getReferenceBuilder
 
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.RequestChannel
beginRequest, endRequest, endRequest, getCopyResponse, request, request, requestAsync, requestAsync, setCopyResponse
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
close, close, getTimeout, open, open, setTimeout
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel
beginClose, beginOpen, 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, setEndpoint
 
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
 

Method Detail

policy

ClusterProtocolPolicy policy()
Returns reference to the actual cluster protocol policy.

Returns:
the cluster protocol policy reference.

setNodes

void setNodes(WSConfig... nodes)
Sets or resets actual cluster nodes WarmStandby connections configurations.

Parameters:
nodes - list of cluster nodes configuration.
Throws:
java.lang.IllegalArgumentException - in the following cases: given nodes list is null, it contains null value, or there is an unnamed WSConfig.

setNodes

void setNodes(java.lang.Iterable<WSConfig> nodes)
Sets or resets actual cluster nodes WarmStandby connections configurations.

Parameters:
nodes - collection of cluster nodes configuration.
Throws:
java.lang.IllegalArgumentException - in the following cases: given nodes collection is null, it contains null value, or there is an unnamed WSConfig.

setNodesEndpoints

void setNodesEndpoints(Endpoint... endpoints)
Sets or resets actual cluster nodes Endpoint's list.

Parameters:
endpoints - list of cluster nodes Endpoint's.
Throws:
java.lang.IllegalArgumentException - in the following cases: given Endpoint's list is null, it contains null value, or there is an unnamed Endpoint.

setNodesEndpoints

void setNodesEndpoints(java.lang.Iterable<Endpoint> endpoints)
Sets or resets actual cluster nodes Endpoint's list.

Parameters:
endpoints - collection of cluster nodes Endpoint's.
Throws:
java.lang.IllegalArgumentException - in the following cases: given Endpoint's collection is null, it contains null value, or there is an unnamed Endpoint.

addNodes

void addNodes(WSConfig... nodes)
Adds list of WarmStandby configurations as additional cluster protocol nodes.

Parameters:
nodes - list of cluster nodes configuration.
Throws:
java.lang.IllegalArgumentException - in the following cases: given nodes list is null, it contains null value, or there is an unnamed WSConfig.

addNodes

void addNodes(java.lang.Iterable<WSConfig> nodes)
Adds collection of WarmStandby configurations as additional cluster protocol nodes.

Parameters:
nodes - connection of cluster nodes configurations.
Throws:
java.lang.IllegalArgumentException - in the following cases: given nodes collection is null, it contains null value, or there is an unnamed WSConfig.

addNodesEndpoints

void addNodesEndpoints(Endpoint... endpoints)
Adds Endpoint's list as additional cluster protocol nodes.

Parameters:
endpoints - list of cluster nodes Endpoint's.
Throws:
java.lang.IllegalArgumentException - in the following cases: given Endpoint's list is null, it contains null value, or there is an unnamed Endpoint.

addNodesEndpoints

void addNodesEndpoints(java.lang.Iterable<Endpoint> endpoints)
Adds Endpoint's collection as additional cluster protocol nodes.

Parameters:
endpoints - collection of cluster nodes Endpoint's.
Throws:
java.lang.IllegalArgumentException - in the following cases: given Endpoint's collection is null, it contains null value, or there is an unnamed Endpoint.

removeNodes

void removeNodes(java.lang.String... names)
Removes cluster protocol node(s) by given nodes names.

Parameters:
names - list of Endpoint's/WSConfig's names.

removeNodes

void removeNodes(java.lang.Iterable<java.lang.String> names)
Removes cluster protocol node(s) by given nodes names.

Parameters:
names - collection of Endpoint's/WSConfig's names.

getNodesConfig

java.util.List<WSConfig> getNodesConfig()
Returns list of cluster nodes connections configurations.

Returns:
list of cluster protocol nodes connections configurations.

openAsync

<A> void openAsync(CompletionHandler<ChannelOpenedEvent,? super A> handler,
                   A attachment)
               throws ProtocolException
Initiates connections to the initialized set of cluster nodes.
The completion handler will be notified by the first connection open event.

Parameters:
handler - the completion handler to be notified with the operation result.
attachment - user defined optional attachment for the handler.
Throws:
ProtocolException

closeAsync

<A> void closeAsync(CompletionHandler<ChannelClosedEvent,? super A> handler,
                    A attachment)
Initiates connections close to all of the cluster nodes.
Provided Completion Handler will be notified when all cluster nodes connections got closed.

Parameters:
handler - the completion handler to be notified with the operation result.
attachment - user defined optional attachment for the handler.

getNextAvailableProtocol

Protocol getNextAvailableProtocol()
Returns reference to some opened instance of protocol in the cluster nodes pool in accordance to the LB strategy.

Returns:
reference to a protocol instance wrapper.
See Also:
ClusterProtocolLoadBalancer

getNextAvailableProtocol

Protocol getNextAvailableProtocol(Message message)
Returns reference to some opened instance of protocol in the cluster nodes pool in accordance to the LB strategy for handling of the given request message.

Parameters:
message - the protocol message.
Returns:
reference to a protocol instance wrapper.
See Also:
ClusterProtocolLoadBalancer, ClusterProtocolLoadBalancer.chooseNode(Message)

getOpenedNodesProtocols

java.util.List<Protocol> getOpenedNodesProtocols()
Returns snapshot list of cluster protocol nodes, which are tracked as Opened at the moment.

Returns:
list with cluster nodes protocols.

getAllNodesProtocols

java.util.List<Protocol> getAllNodesProtocols()
Returns snapshot list of all cluster protocol nodes.

Returns:
list with cluster nodes protocols.

getNodeProtocol

Protocol getNodeProtocol(int protocolId)
Returns cluster protocol node instance by PSDK Protocol Id.
It may be useful in cases, when it is required to get particular server connection by ProtocolId of specific response, or unsolicited event message.

Parameters:
protocolId - the protocol id.
Returns:
the cluster protocol node with the given id, or null.

getNodeProtocol

Protocol getNodeProtocol(java.lang.String nodeName)
Returns cluster protocol node instance by name of configured Endpoint or WSConfig.

Parameters:
nodeName - name of configured Endpoint or WSConfig.
Returns:
the cluster protocol node, 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.