com.multisoftgroup.jerry.webchat.managers.balancer
Class OperatorBalancer

java.lang.Object
  extended by com.multisoftgroup.jerry.webchat.managers.balancer.OperatorBalancer
Direct Known Subclasses:
BalancedLoading, FirstAvailableOperator

public abstract class OperatorBalancer
extends Object

This class is the abstract base class for all conventional Operator Load Balancers. Extend this class, implement the nextAvailableOperator method, and add your load distribution algorithm.
The nextAvailableOperator method returns next available operator during chat creation.

An Operator Load Balancer should be defined in jerry.xml config file:

<operatorBalancer class="classname" />

Author:
Pavel Savin
See Also:
FirstAvailableOperator, BalancedLoading

Constructor Summary
OperatorBalancer()
           
 
Method Summary
protected  int getLoading(Operator operator)
          This method allows to get an number of active chats (at a current moment) for the specified operator
protected  boolean isOperatorAvailable(Operator operator)
          This method allows to check if the operator has available status on Jabber server
abstract  Operator nextAvailableOperator(JerryAccount account)
          The implementation of this method should return next available operator for the specified account.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperatorBalancer

public OperatorBalancer()
Method Detail

nextAvailableOperator

public abstract Operator nextAvailableOperator(JerryAccount account)
The implementation of this method should return next available operator for the specified account.

Parameters:
account - Jerry account in which the chat is created
Returns:
available operator

isOperatorAvailable

protected boolean isOperatorAvailable(Operator operator)
This method allows to check if the operator has available status on Jabber server

Parameters:
operator - Operator to check
Returns:
"true" means the operator is available

getLoading

protected int getLoading(Operator operator)
This method allows to get an number of active chats (at a current moment) for the specified operator

Parameters:
operator - Operator to check
Returns:
current active chats