gov.nist.javax.sip.stack
Class CongestionControlMessageValve

java.lang.Object
  extended by gov.nist.javax.sip.stack.CongestionControlMessageValve
All Implemented Interfaces:
SIPMessageValve

public class CongestionControlMessageValve
extends Object
implements SIPMessageValve

This is just a simple reusable congestion control valve JSIP apps can use to stop traffic when the number of server transactions reaches the limit specified in gov.nist.javax.sip.MAX_SERVER_TRANSACTIONS without breaking existing dialogs. The drop policy is specified in DROP_RESPONSE_STATUS where "0" means silent drop and any positive number will be interpreted as the status code of the error response that will be generated. To enable this in your application you must specify this property: gov.nist.javax.sip.SIP_MESSAGE_VALVE=gov.nist.javax.sip.stack.CongestionControlMessageValve It is advised to extend this class to add your application-specific control conditions

Author:
vladimirralev

Field Summary
protected  int dropResponseStatus
           
protected  int serverTransactionTableHighwaterMark
           
protected  SipStackImpl sipStack
           
 
Constructor Summary
CongestionControlMessageValve()
           
 
Method Summary
 void destroy()
          This method is called when the valve is about to be destroyed.
 void init(SipStack stack)
          This method is called when the valve is initialized.
 boolean processRequest(SIPRequest request, MessageChannel messageChannel)
          The callback method that is called for every request before any transaction/dialog mapping or allocation occur.
 boolean processResponse(Response response, MessageChannel messageChannel)
          The callback method that is called for every response before any transaction/dialog mapping or allocation occur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sipStack

protected SipStackImpl sipStack

serverTransactionTableHighwaterMark

protected int serverTransactionTableHighwaterMark

dropResponseStatus

protected int dropResponseStatus
Constructor Detail

CongestionControlMessageValve

public CongestionControlMessageValve()
Method Detail

processRequest

public boolean processRequest(SIPRequest request,
                              MessageChannel messageChannel)
Description copied from interface: SIPMessageValve
The callback method that is called for every request before any transaction/dialog mapping or allocation occur.

Specified by:
processRequest in interface SIPMessageValve
Returns:

processResponse

public boolean processResponse(Response response,
                               MessageChannel messageChannel)
Description copied from interface: SIPMessageValve
The callback method that is called for every response before any transaction/dialog mapping or allocation occur.

Specified by:
processResponse in interface SIPMessageValve
Returns:

destroy

public void destroy()
Description copied from interface: SIPMessageValve
This method is called when the valve is about to be destroyed. You can perform any cleanup here.

Specified by:
destroy in interface SIPMessageValve

init

public void init(SipStack stack)
Description copied from interface: SIPMessageValve
This method is called when the valve is initialized. You can perform any initialization here.

Specified by:
init in interface SIPMessageValve


Copyright © 2012. All Rights Reserved.