Platform SDK Java 8.5 API Reference

com.genesyslab.platform.standby
Class WSConfig

java.lang.Object
  extended by com.genesyslab.platform.standby.WSConfig
All Implemented Interfaces:
java.lang.Cloneable

public final class WSConfig
extends java.lang.Object
implements java.lang.Cloneable

The warm standby configuration helps to define endpoint pool and other delays and timeout properties


Constructor Summary
WSConfig()
          Create a warm standby configuration instance without a specified name.
WSConfig(java.lang.String name)
          Create a warm standby configuration instance with a specified name.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 boolean equalsIgnoreName(WSConfig wsConfig)
          Compares with other configurations ignoring its names.
static boolean equalsIgnoreName(WSConfig wsConfig1, WSConfig wsConfig2)
          Compares two configurations ignoring its names.
 int getBackupDelay()
          Gets the backup delay that is applied after failure of the first reconnection attempt and before switching to backup endpoint.
 java.util.List<Endpoint> getEndpoints()
          Gets list of endpoints.
 java.lang.String getName()
          Gets name.
 int getReconnectionRandomDelayRange()
          Gets the random delay range before reconnection to the last opened endpoint in case of disconnection.
 int[] getRetryDelay()
          Gets retry delays that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.
 int getRetryDelay(int retryNumber)
          Gets retry delay that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.
 java.lang.Integer getTimeout()
          Gets the open timeout that is used for connection to endpoints.
 int hashCode()
           
 WSConfig setBackupDelay(int delayMs)
          Sets the backup delay that is applied after failure of the first reconnection attempt and before switching to backup endpoint.
 WSConfig setEndpoints(Endpoint... value)
          Sets endpoints array.
 WSConfig setEndpoints(java.util.List<? extends Endpoint> value)
          Sets endpoints list.
 WSConfig setEndpointsCollection(java.util.Collection<? extends Endpoint> value)
          Sets endpoints collection.
 WSConfig setReconnectionRandomDelayRange(int delayMs)
          Sets the random delay range before reconnection to the last opened endpoint in case of disconnection.
 WSConfig setRetryDelay(int... delayMs)
          Sets retry delays that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.
 WSConfig setTimeout(java.lang.Integer valueMs)
          Sets the open timeout that is used for connection to the endpoints.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WSConfig

public WSConfig()
Create a warm standby configuration instance without a specified name.


WSConfig

public WSConfig(java.lang.String name)
Create a warm standby configuration instance with a specified name.

Method Detail

getName

public java.lang.String getName()
Gets name.

Returns:
name.

getEndpoints

public java.util.List<Endpoint> getEndpoints()
Gets list of endpoints.

Note: if endpoints with same app,host and port occurs multiple times then only first one will be used while opening.

The iteration through endpoints always starts from the begin of the ednpoint pool.
Endpoint from which channel has been disconnected and endpoints which have been already checked unsuccessfully after disconnection, are skipped from the iteration.
If some other order of iteration is desired than in the appropriate event handler (onChannelDisconnected, onEndpointCheckUnsuccessfully, ..) the endpoints order in the pool can be changed appropriately.

Returns:
list of endpoints.

setEndpointsCollection

public WSConfig setEndpointsCollection(java.util.Collection<? extends Endpoint> value)
Sets endpoints collection.

Note: if endpoints with same app,host and port will be passed multiple times then only first one will be used while opening.

The iteration through endpoints always starts from the begin of the ednpoint pool.
Endpoint from which channel has been disconnected and endpoints which have been already checked unsuccessfully after disconnection, are skipped from the iteration.
If some other order of iteration is desired than in the appropriate event handler (onChannelDisconnected, onEndpointCheckUnsuccessfully, ..) the endpoints order in the pool can be changed appropriately.

Parameters:
value - collection of endpoints.
Throws:
java.lang.IllegalArgumentException - if null endpoint occurs in the collection.
See Also:
setEndpoints(Endpoint[]), setEndpoints(List)

setEndpoints

public WSConfig setEndpoints(java.util.List<? extends Endpoint> value)
Sets endpoints list.

Note: if endpoints with same app,host and port will be passed multiple times then only first one will be used while opening.

The iteration through endpoints always starts from the begin of the ednpoint pool.
Endpoint from which channel has been disconnected and endpoints which have been already checked unsuccessfully after disconnection, are skipped from the iteration.
If some other order of iteration is desired than in the appropriate event handler (onChannelDisconnected, onEndpointCheckUnsuccessfully, ..) the endpoints order in the pool can be changed appropriately.

Parameters:
value - list of endpoints.
Throws:
java.lang.IllegalArgumentException - if null endpoint occurs in the list.
See Also:
setEndpoints(Endpoint[]), setEndpointsCollection(Collection)

setEndpoints

public WSConfig setEndpoints(Endpoint... value)
Sets endpoints array.

Note: if endpoints with same app,host and port will be passed multiple times then only first one will be used while opening.

The iteration through endpoints always starts from the begin of the ednpoint pool.
Endpoint from which channel has been disconnected and endpoints which have been already checked unsuccessfully after disconnection, are skipped from the iteration.
If some other order of iteration is desired than in the appropriate event handler (onChannelDisconnected, onEndpointCheckUnsuccessfully, ..) the endpoints order in the pool can be changed appropriately.

Parameters:
value - array of endpoints.
Throws:
java.lang.IllegalArgumentException - if null endpoint occurs in the array.
See Also:
setEndpoints(List), setEndpointsCollection(Collection)

getReconnectionRandomDelayRange

public int getReconnectionRandomDelayRange()
Gets the random delay range before reconnection to the last opened endpoint in case of disconnection.

Returns:
current range for random delay in milliseconds.

setReconnectionRandomDelayRange

public WSConfig setReconnectionRandomDelayRange(int delayMs)
Sets the random delay range before reconnection to the last opened endpoint in case of disconnection.

Parameters:
delayMs - new range for random delay in milliseconds.

getBackupDelay

public int getBackupDelay()
Gets the backup delay that is applied after failure of the first reconnection attempt and before switching to backup endpoint. It represents time which is enough for backup server to switchover to primary mode.

Returns:
current backup delay in milliseconds.

setBackupDelay

public WSConfig setBackupDelay(int delayMs)
Sets the backup delay that is applied after failure of the first reconnection attempt and before switching to backup endpoint. It represents time which is enough for backup server to switchover to primary mode.

Parameters:
delayMs - new backup delay in milliseconds.
Throws:
java.lang.IllegalArgumentException - if the argument delayMs is negative.

getTimeout

public java.lang.Integer getTimeout()
Gets the open timeout that is used for connection to endpoints.

Returns:
current open timeout in milliseconds.

setTimeout

public WSConfig setTimeout(java.lang.Integer valueMs)
Sets the open timeout that is used for connection to the endpoints.

Parameters:
valueMs - new open timeout in milliseconds.

getRetryDelay

public int getRetryDelay(int retryNumber)
Gets retry delay that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.

Parameters:
retryNumber -
Returns:
retry delay in milliseconds.

getRetryDelay

public int[] getRetryDelay()
Gets retry delays that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.

The default value is 1000 ms.

Returns:
array of delays in milliseconds.

setRetryDelay

public WSConfig setRetryDelay(int... delayMs)
Sets retry delays that is applied after all endpoints has been checked unsuccessfully and before next iteration will be started.

Parameters:
delayMs - array of delays in milliseconds, if it's null then there is no any delay.
Throws:
java.lang.IllegalArgumentException - if the argument delayMs contains negative delay.

equalsIgnoreName

public boolean equalsIgnoreName(WSConfig wsConfig)
Compares with other configurations ignoring its names.

Parameters:
wsConfig -
Returns:

equalsIgnoreName

public static boolean equalsIgnoreName(WSConfig wsConfig1,
                                       WSConfig wsConfig2)
Compares two configurations ignoring its names.

Parameters:
wsConfig1 -
wsConfig2 -
Returns:

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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.