SipPersistentSubscriptionMgr Class Reference

#include <SipPersistentSubscriptionMgr.h>

Inheritance diagram for SipPersistentSubscriptionMgr:

SipSubscriptionMgr

List of all members.


Detailed Description

Class for maintaining SUBSCRIBE dialog information in subscription server and storing the subscription states in the subscription.xml table.


Public Member Functions

 SipPersistentSubscriptionMgr (const UtlString &component, const UtlString &domain, const UtlString &fileName="subscription")
 Default constructor.
virtual ~SipPersistentSubscriptionMgr ()
 Destructor.
virtual void initialize (OsMsgQ *pMsgQ)
 Asks the SipPersistentSubscriptionMgr to initialize itself and sets the address.
virtual UtlBoolean updateDialogInfo (const SipMessage &subscribeRequest, UtlString &resourceId, UtlString &eventTypeKey, UtlString &eventType, UtlString &subscribeDialogHandle, UtlBoolean &isNew, UtlBoolean &isExpired, SipMessage &subscribeResponse, SipSubscribeServerEventHandler &handler)
 Add/Update subscription for the given SUBSCRIBE request.
virtual UtlBoolean insertDialogInfo (const SipMessage &subscribeRequest, const UtlString &resourceId, const UtlString &eventTypeKey, const UtlString &eventType, int expires, int notifyCSeq, int version, UtlString &subscribeDialogHandle, UtlBoolean &isNew)
 Insert subscription dialog info without checking for the existence of the dialog.
virtual UtlBoolean getNotifyDialogInfo (const UtlString &subscribeDialogHandle, SipMessage &notifyRequest, const char *subscriptionStateFormat, UtlString *resourceId=NULL, UtlString *eventTypeKey=NULL, UtlString *eventType=NULL, UtlString *acceptHeaderValue=NULL, bool *fullContent=NULL)
 Set the subscription dialog information and cseq for the next NOTIFY request.
virtual UtlBoolean endSubscription (const UtlString &dialogHandle, enum SipSubscriptionMgr::subscriptionChange change)
 End the dialog for the subscription indicated, by the dialog handle.
virtual void removeOldSubscriptions (long oldEpochTimeSeconds)
 Remove old subscriptions that expired before given date.
virtual void setNextNotifyCSeq (const UtlString &dialogHandleString, int nextLocalCseq, int version)
 Set stored value for the next NOTIFY CSeq and version.
virtual void updateVersion (SipMessage &notifyRequest, int version, const UtlString &eventTypeKey)
 Update the saved value of the NOTIFY CSeq (now in notifyRequest) and the XML version (as specified).
virtual int getNextAllowedVersion (const UtlString &resourceId)
 get the next notify body "version" value that is allowed for a resource (as far as is known by this SipSubscriptionMgr).

Private Member Functions

 SipPersistentSubscriptionMgr (const SipPersistentSubscriptionMgr &rSipPersistentSubscriptionMgr)
 Copy constructor NOT ALLOWED.
SipPersistentSubscriptionMgroperator= (const SipPersistentSubscriptionMgr &rhs)
 Assignment operator NOT ALLOWED.

Private Attributes

UtlString mComponent
 "component" value to use in IMDB rows.
UtlString mDomain
 the AOR domain name
SubscriptionDBmSubscriptionDBInstance
 Pointer to the SubscriptionDB instance that handles persistence.
OsTimer mPersistenceTimer
 Timer for flushing changes to disk.
SipPersistentSubscriptionMgrTask mPersistTask
 Task to save changes to disk.

Static Private Attributes

static const OsTime sPersistInterval
 Time interval to save changes to disk.

Constructor & Destructor Documentation

SipPersistentSubscriptionMgr ( const UtlString component,
const UtlString domain,
const UtlString fileName = "subscription" 
)

Default constructor.

Parameters:
component  the "component" name for the table rows
domain  the AOR domain name
fileName  the name of the IMDB file

~SipPersistentSubscriptionMgr (  )  [virtual]

Destructor.

SipPersistentSubscriptionMgr ( const SipPersistentSubscriptionMgr rSipPersistentSubscriptionMgr  )  [private]

Copy constructor NOT ALLOWED.


Member Function Documentation

void initialize ( OsMsgQ *  pMsgQ  )  [virtual]

Asks the SipPersistentSubscriptionMgr to initialize itself and sets the address.

Reimplemented from SipSubscriptionMgr.

UtlBoolean updateDialogInfo ( const SipMessage subscribeRequest,
UtlString resourceId,
UtlString eventTypeKey,
UtlString eventType,
UtlString subscribeDialogHandle,
UtlBoolean isNew,
UtlBoolean isExpired,
SipMessage subscribeResponse,
SipSubscribeServerEventHandler handler 
) [virtual]

Add/Update subscription for the given SUBSCRIBE request.

Reimplemented from SipSubscriptionMgr.

UtlBoolean insertDialogInfo ( const SipMessage subscribeRequest,
const UtlString resourceId,
const UtlString eventTypeKey,
const UtlString eventType,
int  expires,
int  notifyCSeq,
int  version,
UtlString subscribeDialogHandle,
UtlBoolean isNew 
) [virtual]

Insert subscription dialog info without checking for the existence of the dialog.

This method blindly inserts dialog information and should only be called from from the SipPersistentSubscriptionMgr. It is intended to insert subscription information into memory from the IMDB.

NOTE: This method is not implemented in SipPersistentSubscriptionMgr.

Reimplemented from SipSubscriptionMgr.

UtlBoolean getNotifyDialogInfo ( const UtlString subscribeDialogHandle,
SipMessage notifyRequest,
const char *  subscriptionStateFormat,
UtlString resourceId = NULL,
UtlString eventTypeKey = NULL,
UtlString eventType = NULL,
UtlString acceptHeaderValue = NULL,
bool *  fullContent = NULL 
) [virtual]

Set the subscription dialog information and cseq for the next NOTIFY request.

Reimplemented from SipSubscriptionMgr.

UtlBoolean endSubscription ( const UtlString dialogHandle,
enum SipSubscriptionMgr::subscriptionChange  change 
) [virtual]

End the dialog for the subscription indicated, by the dialog handle.

Finds a matching dialog and expires the subscription if it has not already expired.

Parameters:
dialogHandle - a fully established SIP dialog handle
change - describes whether the subscription should end silently - subscriptionTerminatedSilently means that IMDB record of subscription should be retained. Returns TRUE if a matching dialog was found regardless of whether the subscription was already expired or not.

Reimplemented from SipSubscriptionMgr.

void removeOldSubscriptions ( long  oldEpochTimeSeconds  )  [virtual]

Remove old subscriptions that expired before given date.

void setNextNotifyCSeq ( const UtlString dialogHandleString,
int  nextLocalCseq,
int  version 
) [virtual]

Set stored value for the next NOTIFY CSeq and version.

Reimplemented from SipSubscriptionMgr.

void updateVersion ( SipMessage notifyRequest,
int  version,
const UtlString eventTypeKey 
) [virtual]

Update the saved value of the NOTIFY CSeq (now in notifyRequest) and the XML version (as specified).

Reimplemented from SipSubscriptionMgr.

int getNextAllowedVersion ( const UtlString resourceId  )  [virtual]

get the next notify body "version" value that is allowed for a resource (as far as is known by this SipSubscriptionMgr).

If no information is available, returns 0.

Reimplemented from SipSubscriptionMgr.

SipPersistentSubscriptionMgr& operator= ( const SipPersistentSubscriptionMgr rhs  )  [private]

Assignment operator NOT ALLOWED.


Member Data Documentation

UtlString mComponent [private]

"component" value to use in IMDB rows.

UtlString mDomain [private]

the AOR domain name

Pointer to the SubscriptionDB instance that handles persistence.

Timer for flushing changes to disk.

When the IMDB table is dirty (changes have not been written to disk), this timer is running; when it is clean, this timer is stopped. (This works because the OsTimer start and stop methods are fully interlocked, and report whether the timer was previously running.)

const OsTime sPersistInterval [static, private]

Time interval to save changes to disk.

Task to save changes to disk.


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild