|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
Abstract base class that provides a basic congestion management interface. More...
#include <CongestionManager.hxx>
Public Types | |
| enum | RejectionBehavior { NORMAL =0 , REJECTING_NEW_WORK =1 , REJECTING_NON_ESSENTIAL =2 } |
Public Member Functions | |
| CongestionManager () | |
| Constructor. | |
| virtual | ~CongestionManager () |
| virtual RejectionBehavior | getRejectionBehavior (const FifoStatsInterface *fifo) const =0 |
| Return the current rejection behavior for this fifo. | |
| virtual void | registerFifo (resip::FifoStatsInterface *fifo)=0 |
| Registers a fifo with the congestion manager. | |
| virtual void | unregisterFifo (resip::FifoStatsInterface *fifo)=0 |
| Unregisters a fifo with the congestion manager. | |
| virtual void | logCurrentState () const =0 |
| Log the current state of all monitored fifos. | |
| virtual EncodeStream & | encodeCurrentState (EncodeStream &strm) const =0 |
| Get the current state of all monitored fifos.to a stream. | |
Abstract base class that provides a basic congestion management interface.
The primary job of subclasses is to implement getRejectionBehavior() such that it will return REJECTING_NEW_WORK or REJECTING_NON_ESSENTIAL when sufficient congestion is detected in the fifo in question. logCurrentState() is used to provide a logging statement for the current state of the queueing system.
In order to write a CongestionManager that determines congestion state for specific fifos based on the state of the whole system, you will need to override getRejectionBehavior() to examine the fifo being passed to determine what role it has in the system (this is done by calling FifoStatsInterface::getDescription()), and assigning a role-number that designates the role of this fifo (this means you only need to perform a string comparison the first time getRejectionBehavior() is called for a particular fifo). Here are the returns you will get from FifoStatsInterface::getDescription() on a number of key fifos in the resiprocate stack:
The following fifos don't see much use, and are therefore not that vital, but they do have descriptions.
Definition at line 43 of file CongestionManager.hxx.
Definition at line 54 of file CongestionManager.hxx.
|
inline |
Constructor.
Definition at line 51 of file CongestionManager.hxx.
|
inlinevirtual |
Definition at line 52 of file CongestionManager.hxx.
|
pure virtual |
Get the current state of all monitored fifos.to a stream.
Implemented in resip::GeneralCongestionManager.
|
pure virtual |
Return the current rejection behavior for this fifo.
This is the primary functionality provided by this class. Implementors may merely examine the current state of the fifo in question, or they may make the decision based on the state of the entire system.
| fifo | The fifo in question. |
Implemented in resip::GeneralCongestionManager.
|
pure virtual |
Log the current state of all monitored fifos.
Implemented in resip::GeneralCongestionManager.
|
pure virtual |
Registers a fifo with the congestion manager.
May be a no-op, or may assign a role number to the fifo.
Implemented in resip::GeneralCongestionManager.
|
pure virtual |
Unregisters a fifo with the congestion manager.
Implemented in resip::GeneralCongestionManager.