org.mobicents.tools.sip.balancer
Class HeaderConsistentHashBalancerAlgorithm
java.lang.Object
org.mobicents.tools.sip.balancer.DefaultBalancerAlgorithm
org.mobicents.tools.sip.balancer.HeaderConsistentHashBalancerAlgorithm
- All Implemented Interfaces:
- BalancerAlgorithm
public class HeaderConsistentHashBalancerAlgorithm
- extends DefaultBalancerAlgorithm
| Methods inherited from class org.mobicents.tools.sip.balancer.DefaultBalancerAlgorithm |
assignToNode, getBalancerContext, getProperties, jvmRouteSwitchover, processAssignedExternalRequest, processExternalResponse, processInternalRequest, processInternalResponse, setProperties, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sipHeaderAffinityKey
protected java.lang.String sipHeaderAffinityKey
httpAffinityKey
protected java.lang.String httpAffinityKey
HeaderConsistentHashBalancerAlgorithm
public HeaderConsistentHashBalancerAlgorithm()
HeaderConsistentHashBalancerAlgorithm
public HeaderConsistentHashBalancerAlgorithm(java.lang.String headerName)
processExternalRequest
public SIPNode processExternalRequest(javax.sip.message.Request request)
- Description copied from interface:
BalancerAlgorithm
- When a request comes it is passed to the algorithm. The algorithm must add the Route headers
to the node or nodes where the request should go. The actual proxying is done at the LB.
Allowing the algorithm to add headers allows more flexibility for example when you need to
pass some information to the AS or the application to make further LB decisions or multiprotocol
cooperative load balancing. It is very little effort for great flexibility.
- Returns:
nodeAdded
public void nodeAdded(SIPNode node)
- Description copied from interface:
BalancerAlgorithm
- Notify the algorithm when a node is added.
- Specified by:
nodeAdded in interface BalancerAlgorithm- Overrides:
nodeAdded in class DefaultBalancerAlgorithm
nodeRemoved
public void nodeRemoved(SIPNode node)
- Description copied from interface:
BalancerAlgorithm
- Notifying the algorithm when a node is dead.
- Specified by:
nodeRemoved in interface BalancerAlgorithm- Overrides:
nodeRemoved in class DefaultBalancerAlgorithm
processHttpRequest
public SIPNode processHttpRequest(org.jboss.netty.handler.codec.http.HttpRequest request)
- Description copied from interface:
BalancerAlgorithm
- Handle HttpRequests here. Use the Netty API for Http request analysis.
- Specified by:
processHttpRequest in interface BalancerAlgorithm- Overrides:
processHttpRequest in class DefaultBalancerAlgorithm
- Returns:
hashAffinityKeyword
protected int hashAffinityKeyword(java.lang.String keyword)
init
public void init()
- Description copied from interface:
BalancerAlgorithm
- Lifecycle method. Notifies the algorithm when it's initialized with properties and balancer context.
Copyright © 2010. All Rights Reserved.