Platform SDK Java 8.5 API Reference

com.genesyslab.platform.applicationblocks.warmstandby
Class WarmStandbyService

java.lang.Object
  extended by com.genesyslab.platform.applicationblocks.warmstandby.WarmStandbyService

public class WarmStandbyService
extends java.lang.Object

WarmStandbyService class realizes a redundancy configuration consisting of two servers: Primary and Backup, where the Primary server operates in active mode and the Backup server in standby mode. Only the Primary server accepts connections and message exchanges with the clients. In case of the Primary server failure, the Backup server switches to active mode assuming the role and behavior of the Primary server.


Constructor Summary
WarmStandbyService(Protocol protocolChannel)
          Creates a WarmStandbyService instance.
 
Method Summary
 void addListener(WarmStandbyListener listener)
          Adds listener about WarmStandbyService events.
 void applyConfiguration(WarmStandbyConfiguration conf)
          Sets WarmStandby Configuration.
 void applyConfiguration(WarmStandbyConfiguration conf, boolean reset)
          Sets WarmStandby Configuration.
 short getAttempt()
          Gets current reconnection attempt value.
 Protocol getChannel()
          Gets the channel the WarmStandbyService is responsible for.
 WarmStandbyConfiguration getConfiguration()
          Gets WarmStandbyService Configuration.
protected  AsyncInvoker getInvoker()
          Access to the internal invoker.
 WarmStandbyState getState()
          Gets the WarmStandbyService State.
 short getSwitchover()
          Gets current switchover number value.
protected  void processConnectivityFailure(ChannelClosedEvent event)
          Callback method for connection lost event handling.
 void removeListener(WarmStandbyListener listener)
          Removes listener about WarmStandbyService events.
 void setConnectionFailureHandler(WarmStandbyConnectionFailureHandler handler)
           
 void setInvoker(AsyncInvoker invoker)
          Sets invoker.
 void start()
          Activates (switches on) the WarmStandbyService.
 void stop()
          Deactivates (switches off) the WarmStandbyService.
protected  void switchover()
          Switches over Active and Standby (server) Uri's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WarmStandbyService

public WarmStandbyService(Protocol protocolChannel)
Creates a WarmStandbyService instance.

Parameters:
protocolChannel - channel the WarmStandbyService is responsible for
Method Detail

start

public void start()
Activates (switches on) the WarmStandbyService.

Throws:
java.lang.IllegalStateException - if this class is in inappropriate state to start (already started, not configured)

stop

public void stop()
Deactivates (switches off) the WarmStandbyService.

Throws:
java.lang.IllegalStateException - if this class is in inappropriate state to stop (is not started)

setConnectionFailureHandler

public void setConnectionFailureHandler(WarmStandbyConnectionFailureHandler handler)

applyConfiguration

public void applyConfiguration(WarmStandbyConfiguration conf)
Sets WarmStandby Configuration.

Parameters:
conf - WarmStandby configuration

applyConfiguration

public void applyConfiguration(WarmStandbyConfiguration conf,
                               boolean reset)
Sets WarmStandby Configuration.

Parameters:
conf - WarmStandby configuration
reset - flag to reset reconnect attempt counter

addListener

public final void addListener(WarmStandbyListener listener)
Adds listener about WarmStandbyService events.

Parameters:
listener - event listener

removeListener

public final void removeListener(WarmStandbyListener listener)
Removes listener about WarmStandbyService events.

Parameters:
listener - event listener

getChannel

public final Protocol getChannel()
Gets the channel the WarmStandbyService is responsible for.

Returns:
the channel the WarmStandbyService is responsible for

setInvoker

public final void setInvoker(AsyncInvoker invoker)
Sets invoker. It's used by this class to perform asynchronous operations, such as firing events.

Parameters:
invoker - asynchronous invoker

getConfiguration

public final WarmStandbyConfiguration getConfiguration()
Gets WarmStandbyService Configuration.

Returns:
configuration in effect

getState

public final WarmStandbyState getState()
Gets the WarmStandbyService State.

Returns:
current state

getAttempt

public final short getAttempt()
Gets current reconnection attempt value.

Returns:
current count of attempts

getSwitchover

public final short getSwitchover()
Gets current switchover number value.

Returns:
current count of switchovers

switchover

protected void switchover()
Switches over Active and Standby (server) Uri's.


getInvoker

protected AsyncInvoker getInvoker()
Access to the internal invoker.

Returns:
invoker instance

processConnectivityFailure

protected void processConnectivityFailure(ChannelClosedEvent event)
Callback method for connection lost event handling. It implements default logic for choosing failure handler and calling it for appropriate connection restore actions.

Parameters:
event - connection lost event

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.