Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

XX-10481 - Removed reference to SubscribePersistThread. This is no lo…

…nger required since mongo is real time. It schedules timers that currently point to persist() function of SuscribeServerThread which is blanked out.
  • Loading branch information...
commit 5a77262f383ae1f7ad4d04b7e82b8160003074f1 1 parent 0ba8453
Joegen Baclor authored
View
1  sipXpublisher/include/Makefile.am
@@ -12,7 +12,6 @@ nobase_include_HEADERS = \
statusserver/PluginXmlParser.h \
statusserver/StatusPluginReference.h \
statusserver/StatusServer.h \
- statusserver/SubscribePersistThread.h \
statusserver/SubscribeServerPluginBase.h \
statusserver/SubscribeServerThread.h \
statusserver/WebServer.h
View
6 sipXpublisher/include/statusserver/StatusServer.h
@@ -49,7 +49,6 @@
// FORWARD DECLARATIONS
class OsConfigDb;
class SubscribeServerThread;
-class SubscribePersistThread;
class StatusServer;
class HttpServer;
class Notifier;
@@ -84,7 +83,6 @@ class StatusServer : public OsServerTask
// assumes singleton is getStatusServer
static OsConfigDb& getConfigDb();
- SubscribePersistThread* getSubscribePersistThread();
SubscribeServerThread* getSubscribeServerThread();
virtual UtlBoolean handleMessage(OsMsg& eventMessage);
@@ -111,7 +109,6 @@ class StatusServer : public OsServerTask
SubscribeServerThread* mSubscribeServerThread;
OsMsgQ* mSubscribeServerThreadQ;
UtlBoolean mSubscribeThreadInitialized;
- SubscribePersistThread* mSubscribePersistThread;
UtlBoolean mIsCredentialDB;
int mDefaultRegistryPeriod;
int mDefaultQvalue;
@@ -146,9 +143,6 @@ class StatusServer : public OsServerTask
OsServerSocket* serverSocket,
HttpServer* httpServer );
- /// Start the thread that periodically persists the subscription DB
- void startSubscribePersistThread();
-
/* ============================ SUBSCRIBE =================================== */
void startSubscribeServerThread();
void sendToSubscribeServerThread(OsMsg& eventMessage);
View
73 sipXpublisher/include/statusserver/SubscribePersistThread.h
@@ -1,73 +0,0 @@
-//
-// Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement.
-// Contributors retain copyright to elements licensed under a Contributor Agreement.
-// Licensed to the User under the LGPL license.
-//
-// $$
-//////////////////////////////////////////////////////////////////////////////
-#ifndef _SUBSCRIBEPERSISTTHREAD_H_
-#define _SUBSCRIBEPERSISTTHREAD_H_
-
-// SYSTEM INCLUDES
-
-// APPLICATION INCLUDES
-#include "os/OsTimer.h"
-#include "os/OsServerTask.h"
-
-// DEFINES
-// CONSTANTS
-// TYPEDEFS
-// FORWARD DECLARATIONS
-class StatusServer;
-class SubscribeServerThread;
-
-
-/**
- * This thread is responsible for periodically persisting the subscription DB
- */
-class SubscribePersistThread : public OsServerTask
-{
-public:
- /// Constructor
- SubscribePersistThread(StatusServer& statusServer);
-
- /// Destructor
- virtual ~SubscribePersistThread();
-
- /// Start the timer that triggers DB persistence, if it's not running
- void schedulePersist();
-
-protected:
- /// Default persist interval, in units of seconds
- static const int SIP_STATUS_DEFAULT_PERSIST_INTERVAL;
-
- /// Mutex must be locked with OsLock to access any shared member variables
- OsBSem mLock;
-
- bool mIsTimerRunning;
-
- OsTimer mPersistTimer;
-
- /// The top level task - do not delete
- StatusServer& mStatusServer;
-
- /// Time interval for garbage collection and persistence
- int mPersistInterval;
-
- /// Handle the expiration of the persist timer
- UtlBoolean handleMessage(OsMsg& eventMessage); ///< Timer expiration msg
-
- /// Persist the subscription DB
- void persist();
-
- SubscribeServerThread* getSubscribeServerThread();
-
-private:
- /// There is no copy constructor
- SubscribePersistThread(const SubscribePersistThread&);
-
- /// There is no assignment operator
- SubscribePersistThread& operator=(const SubscribePersistThread&);
-};
-
-#endif // _SUBSCRIBEPERSISTTHREAD_H_
View
8 sipXpublisher/include/statusserver/SubscribeServerThread.h
@@ -53,14 +53,6 @@ class SubscribeServerThread : public OsServerTask
virtual ~SubscribeServerThread();
- /// Schedule persisting the subscription DB
- void schedulePersist();
-
- //========== Methods that modify subscription DB: requires holding a lock ==========
-
- /// Persist the subscription DB
- void persist();
-
/// Insert a row in the subscription DB
UtlBoolean insertRow (
const UtlString& uri,
View
1  sipXpublisher/src/Makefile.am
@@ -25,7 +25,6 @@ sipstatus_SOURCES = \
statusserver/PluginXmlParser.cpp \
statusserver/StatusPluginReference.cpp \
statusserver/StatusServer.cpp \
- statusserver/SubscribePersistThread.cpp \
statusserver/SubscribeServerPluginBase.cpp \
statusserver/SubscribeServerThread.cpp \
statusserver/WebServer.cpp
View
22 sipXpublisher/src/statusserver/StatusServer.cpp
@@ -28,7 +28,6 @@
#include "statusserver/Notifier.h"
#include "statusserver/WebServer.h"
#include "statusserver/StatusServer.h"
-#include "statusserver/SubscribePersistThread.h"
#include "statusserver/SubscribeServerThread.h"
#include "config.h"
#include "assert.h"
@@ -64,7 +63,6 @@ StatusServer::StatusServer(
mSubscribeServerThread(NULL),
mSubscribeServerThreadQ(NULL),
mSubscribeThreadInitialized(FALSE),
- mSubscribePersistThread(NULL),
mpServerSocket(serverSocket),
mHttpServer(httpServer),
mSubscribeDb( NULL ),
@@ -144,7 +142,6 @@ StatusServer::StatusServer(
mHttpServer->start();
- startSubscribePersistThread();
startSubscribeServerThread();
}
@@ -162,11 +159,6 @@ StatusServer::~StatusServer()
mSubscribeServerThread = NULL;
mSubscribeServerThreadQ = NULL;
}
- if ( mSubscribePersistThread)
- {
- delete mSubscribePersistThread;
- mSubscribePersistThread = NULL;
- }
// HTTP server shutdown
if (mHttpServer)
{
@@ -602,11 +594,6 @@ OsConfigDb& StatusServer::getConfigDb()
}
-SubscribePersistThread* StatusServer::getSubscribePersistThread()
-{
- return mSubscribePersistThread;
-}
-
SubscribeServerThread* StatusServer::getSubscribeServerThread()
{
@@ -618,15 +605,6 @@ SubscribeServerThread* StatusServer::getSubscribeServerThread()
/////////////////////////////////////////////////////////////////////////////
-/// Start the thread that periodically persists the subscription DB
-void
-StatusServer::startSubscribePersistThread()
-{
- mSubscribePersistThread = new SubscribePersistThread(*this);
- mSubscribePersistThread->start();
-}
-
-
void
StatusServer::startSubscribeServerThread()
{
View
122 sipXpublisher/src/statusserver/SubscribePersistThread.cpp
@@ -1,122 +0,0 @@
-//
-// Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement.
-// Contributors retain copyright to elements licensed under a Contributor Agreement.
-// Licensed to the User under the LGPL license.
-//
-// $$
-//////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES
-
-// APPLICATION INCLUDES
-#include "os/OsConfigDb.h"
-#include "os/OsEventMsg.h"
-#include "os/OsTime.h"
-#include "os/OsLock.h"
-#include "statusserver/SubscribePersistThread.h"
-#include "statusserver/SubscribeServerThread.h"
-#include "statusserver/StatusServer.h"
-#include "assert.h"
-
-// DEFINES
-// CONSTANTS
-// STATIC VARIABLE INITIALIZATIONS
-
-const int SubscribePersistThread::SIP_STATUS_DEFAULT_PERSIST_INTERVAL = 20; // units are seconds
-
-// TYPEDEFS
-// FORWARD DECLARATIONS
-
-
-/// Constructor
-SubscribePersistThread::SubscribePersistThread(StatusServer& statusServer) :
- OsServerTask("SubscribePersistThread", NULL, 2000),
- mLock(OsBSem::Q_PRIORITY, OsBSem::FULL),
- mIsTimerRunning(false),
- mPersistTimer(getMessageQueue(), 0),
- mStatusServer(statusServer),
- mPersistInterval(-1)
-{
- // Get the persist interval. This configuration parameter is provided mainly for
- // testing and debugging. Usually it is not set explicitly in the configuration file.
- mStatusServer.getConfigDb().get("SIP_STATUS_PERSIST_INTERVAL", mPersistInterval);
- if (mPersistInterval == -1)
- {
- mPersistInterval = SIP_STATUS_DEFAULT_PERSIST_INTERVAL;
- }
- Os::Logger::instance().log(FAC_SIP, PRI_DEBUG, "SubscribePersistThread::SubscribePersistThread "
- "persist interval = %d seconds", mPersistInterval);
-};
-
-
-/// Destructor
-SubscribePersistThread::~SubscribePersistThread()
-{
- Os::Logger::instance().log(FAC_SIP, PRI_DEBUG, "SubscribePersistThread::~SubscribePersistThread ");
- waitUntilShutDown();
-}
-
-
-// Start the timer that triggers DB persistence, if it's not running.
-// This is called by SubscribeServerThread to start the timer.
-void SubscribePersistThread::schedulePersist()
-{
- OsLock mutex(mLock);
-
- if (!mIsTimerRunning)
- {
- // Start the timer
- mIsTimerRunning = true;
- Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
- "SubscribePersistThread::schedulePersist in %d seconds"
- ,mPersistInterval);
- assert(mPersistInterval > 0);
- mPersistTimer.oneshotAfter(OsTime(mPersistInterval, 0));
- }
-}
-
-
-// Handle the expiration of the persist timer
-UtlBoolean SubscribePersistThread::handleMessage(OsMsg& eventMessage) ///< Timer expiration msg
-{
- UtlBoolean handled = FALSE;
-
- int msgType = eventMessage.getMsgType();
- int msgSubType = eventMessage.getMsgSubType();
-
- Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
- "SubscribePersistThread::handleMessage received message %d/%d",
- msgType, msgSubType);
-
- if ( OsMsg::OS_EVENT == msgType
- && OsEventMsg::NOTIFY == msgSubType
- )
- {
- persist();
- handled = TRUE;
- }
-
- return handled;
-}
-
-
-/// Persist the subscription DB
-void SubscribePersistThread::persist()
-{
- // Change state to indicate that the timer is no longer running.
- // Do this *before* saving the DB so that any DB changes that happen just after
- // we write the changes to disk will cause the timer to restart.
- {
- OsLock mutex(mLock);
- mIsTimerRunning = false;
- }
-
- // Save the DB
- getSubscribeServerThread()->persist();
-}
-
-
-SubscribeServerThread* SubscribePersistThread::getSubscribeServerThread()
-{
- return mStatusServer.getSubscribeServerThread();
-}
View
22 sipXpublisher/src/statusserver/SubscribeServerThread.cpp
@@ -25,7 +25,6 @@
#include "statusserver/Notifier.h"
#include "statusserver/PluginXmlParser.h"
#include "statusserver/StatusServer.h"
-#include "statusserver/SubscribePersistThread.h"
#include "statusserver/SubscribeServerThread.h"
#include "statusserver/SubscribeServerPluginBase.h"
#include "statusserver/StatusPluginReference.h"
@@ -158,22 +157,6 @@ SubscribeServerThread::initialize (
}
-/// Schedule persisting the subscription DB
-void SubscribeServerThread::schedulePersist()
-{
- SubscribePersistThread* persistThread = mStatusServer.getSubscribePersistThread();
- assert(persistThread);
- persistThread->schedulePersist();
-}
-
-
-// Persist the subscription DB.
-// This is actually invoked from the thread SubscribePersistThread, which does the scheduling.
-void SubscribeServerThread::persist()
-{
-}
-
-
/// Insert a row in the subscription DB and schedule persisting the DB
UtlBoolean SubscribeServerThread::insertRow(
const UtlString& uri,
@@ -203,7 +186,6 @@ UtlBoolean SubscribeServerThread::insertRow(
CONTENT_TYPE_SIMPLE_MESSAGE_SUMMARY, 0);
}
- schedulePersist();
return status;
}
@@ -218,8 +200,6 @@ void SubscribeServerThread::removeRow(
{
StatusServer::getInstance()->getSubscribeDb()->remove(SUBSCRIPTION_COMPONENT_STATUS, to, from, callid, subscribeCseq);
}
-
- schedulePersist();
}
/// Remove an error row from the subscription DB and schedule persisting the DB
@@ -231,8 +211,6 @@ void SubscribeServerThread::removeErrorRow (
{
StatusServer::getInstance()->getSubscribeDb()->removeError(SUBSCRIPTION_COMPONENT_STATUS, to, from, callid);
}
-
- schedulePersist();
}
Please sign in to comment.
Something went wrong with that request. Please try again.