reSIProcate/repro  9694
Public Member Functions
repro::RecursiveRedirect Class Reference

#include <RecursiveRedirect.hxx>

Inheritance diagram for repro::RecursiveRedirect:
Inheritance graph
[legend]
Collaboration diagram for repro::RecursiveRedirect:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RecursiveRedirect ()
virtual ~RecursiveRedirect ()
virtual processor_action_t process (RequestContext &)

Detailed Description

Definition at line 9 of file RecursiveRedirect.hxx.


Constructor & Destructor Documentation

RecursiveRedirect::RecursiveRedirect ( )

Definition at line 20 of file RecursiveRedirect.cxx.

                                     :
   Processor("RecursiveRedirectHandler")
{}
RecursiveRedirect::~RecursiveRedirect ( ) [virtual]

Definition at line 25 of file RecursiveRedirect.cxx.

{}

Member Function Documentation

Processor::processor_action_t RecursiveRedirect::process ( RequestContext context) [virtual]

Implements repro::Processor.

Definition at line 30 of file RecursiveRedirect.cxx.

{
   DebugLog(<< "Lemur handling request: " << *this 
            << "; reqcontext = " << context);
   
   const SipMessage* response = dynamic_cast<const SipMessage*>(context.getCurrentEvent());
   if (response && 
       response->isResponse() && 
       response->header(h_StatusLine).statusCode() / 100 == 3)
   {
      TargetPtrList batch;
      for (NameAddrs::const_iterator i=response->header(h_Contacts).begin(); 
           i != response->header(h_Contacts).end(); ++i)
      {
         if(i->isWellFormed() && !i->isAllContacts())
         {
            QValueTarget* target = new QValueTarget(*i);
            batch.push_back(target);
         }
      }
      if(!batch.empty())
      {
#ifdef __SUNPRO_CC
         sort(batch.begin(), batch.end(), Target::priorityMetricCompare);
#else
         batch.sort(Target::priorityMetricCompare);
#endif
         context.getResponseContext().addTargetBatch(batch);
         //ResponseContext should be consuming the vector
         assert(batch.empty());
      }
      return Processor::SkipAllChains;
   }
   return Processor::Continue;   
}

The documentation for this class was generated from the following files: