reSIProcate/DialogUsageManager  9694
Classes | Public Member Functions | Private Types | Private Attributes
RlsServerSubscriptionHandler Class Reference
Inheritance diagram for RlsServerSubscriptionHandler:
Inheritance graph
[legend]
Collaboration diagram for RlsServerSubscriptionHandler:
Collaboration graph
[legend]

List of all members.

Classes

class  RlsSubscription

Public Member Functions

 RlsServerSubscriptionHandler (const vector< string > inputFiles)
virtual void onNewSubscription (ServerSubscriptionHandle handle, const SipMessage &sub)
virtual void onTerminated (ServerSubscriptionHandle sub)
virtual void onRefresh (ServerSubscriptionHandle handle, const SipMessage &sub)
virtual bool hasDefaultExpires () const
 dcm! -- a bit clunky, but really want these objects to not have state
virtual int getDefaultExpires () const
virtual void sendNextNotify ()
virtual ~RlsServerSubscriptionHandler ()

Private Types

typedef map< DialogId,
RlsSubscription
DialogToHandle
typedef vector< Contents * > ContentsList

Private Attributes

DialogToHandle mHandleMap
vector< Contents * > mContentsList

Detailed Description

Definition at line 88 of file rlsServer.cxx.


Member Typedef Documentation

Definition at line 189 of file rlsServer.cxx.

Definition at line 187 of file rlsServer.cxx.


Constructor & Destructor Documentation

RlsServerSubscriptionHandler::RlsServerSubscriptionHandler ( const vector< string >  inputFiles) [inline]

Definition at line 110 of file rlsServer.cxx.

References readFromFile().

      {
         for (vector<string>::const_iterator it = inputFiles.begin(); it != inputFiles.end(); it++)
         {
            mContentsList.push_back(readFromFile(*it));
         }
      }

Here is the call graph for this function:

virtual RlsServerSubscriptionHandler::~RlsServerSubscriptionHandler ( ) [inline, virtual]

Definition at line 182 of file rlsServer.cxx.

      {
         //clean up map, contents
      }

Member Function Documentation

virtual int RlsServerSubscriptionHandler::getDefaultExpires ( ) const [inline, virtual]

Reimplemented from resip::ServerSubscriptionHandler.

Definition at line 159 of file rlsServer.cxx.

      {
         return 600;
      }
virtual bool RlsServerSubscriptionHandler::hasDefaultExpires ( ) const [inline, virtual]

dcm! -- a bit clunky, but really want these objects to not have state

Reimplemented from resip::ServerSubscriptionHandler.

Definition at line 154 of file rlsServer.cxx.

      {
         return true;
      }
virtual void RlsServerSubscriptionHandler::onNewSubscription ( ServerSubscriptionHandle  handle,
const SipMessage sub 
) [inline, virtual]

Implements resip::ServerSubscriptionHandler.

Definition at line 118 of file rlsServer.cxx.

References h_RequestLine, resip::SipMessage::header(), and InfoLog.

      {
         InfoLog ( << "onNewSubscription: " << sub.header(h_RequestLine) << "\t" << 
                   sub.header(h_From) << "\t" << handle->getAppDialog()->getDialogId());
         assert(mHandleMap.find(handle->getAppDialog()->getDialogId()) == mHandleMap.end());
         mHandleMap[handle->getAppDialog()->getDialogId()] = RlsSubscription(handle, 1);
         handle->send(handle->accept());
         SipMessage& notify = handle->update(mContentsList[0]);
         notify.header(h_Requires).push_back(Token("eventlist"));
         handle->send(notify);
      }

Here is the call graph for this function:

virtual void RlsServerSubscriptionHandler::onRefresh ( ServerSubscriptionHandle  handle,
const SipMessage sub 
) [inline, virtual]

Reimplemented from resip::ServerSubscriptionHandler.

Definition at line 137 of file rlsServer.cxx.

References resip::SipMessage::header().

      {
         DialogToHandle::iterator it = mHandleMap.find(handle->getAppDialog()->getDialogId());
         if (it == mHandleMap.end())
         {
            assert(0);
         }
         else
         {
            ServerSubscriptionHandle handle = it->second.handle;
            it->second.currentContent = 0;            
            SipMessage& notify = handle->update(mContentsList[it->second.currentContent++]);
            notify.header(h_Requires).push_back(Token("eventlist"));
            handle->send(notify);
         }
      }

Here is the call graph for this function:

virtual void RlsServerSubscriptionHandler::onTerminated ( ServerSubscriptionHandle  sub) [inline, virtual]

Implements resip::ServerSubscriptionHandler.

Definition at line 130 of file rlsServer.cxx.

References InfoLog.

      {
         InfoLog ( << "onTerminated: " << sub->getAppDialog()->getDialogId());
         mHandleMap.erase(sub->getAppDialog()->getDialogId());
      }
virtual void RlsServerSubscriptionHandler::sendNextNotify ( ) [inline, virtual]

Definition at line 164 of file rlsServer.cxx.

References resip::SipMessage::header().

      {
         for (DialogToHandle::iterator it = mHandleMap.begin(); it != mHandleMap.end(); it++)
         {
            ServerSubscriptionHandle handle = it->second.handle;
            if (it->second.currentContent > mContentsList.size())
            {
               handle->end();
            }
            else
            {
               SipMessage& notify = handle->update(mContentsList[it->second.currentContent++]);
               notify.header(h_Requires).push_back(Token("eventlist"));
               handle->send(notify);
            }
         }
      }

Here is the call graph for this function:


Member Data Documentation

Definition at line 190 of file rlsServer.cxx.

Definition at line 188 of file rlsServer.cxx.


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