📄 hbservercontainer.hxx
字号:
#ifndef HBServerContainer_HXX#define HBServerContainer_HXX/* ==================================================================== * The Vovida Software License, Version 1.0 * * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The names "VOCAL", "Vovida Open Communication Application Library", * and "Vovida Open Communication Application Library (VOCAL)" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact vocal@vovida.org. * * 4. Products derived from this software may not be called "VOCAL", nor * may "VOCAL" appear in their name, without prior written * permission of Vovida Networks, Inc. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * ==================================================================== * * This software consists of voluntary contributions made by Vovida * Networks, Inc. and many individuals on behalf of Vovida Networks, * Inc. For more information on Vovida Networks, Inc., please see * <http://www.vovida.org/>. * */#include "ServerWithSnmp.hxx"#include "BaseServerContainer.hxx"#include "VRWLock.hxx"static const char* const HBServerContainerVersion = "$Id: HBServerContainer.hxx,v 1.15 2001/02/05 19:50:41 maivu Exp $";/// Prototype for the Provisioning Server Callbackvoid updateHBRedirectServers(const string& data, const string& fileName, bool );void updateHBMarshalServers(const string& data, const string& fileName, bool );void updateHBFeatureServers(const string& data, const string& fileName, bool );void updateHBJtapiServers(const string& data, const string& fileName, bool );void updateHBPolicyServers(const string& data, const string& fileName, bool );void updateHBCdrServers(const string& data, const string& fileName, bool );void updateHBHeartbeatParms( const string& data, const string& fileName, bool );/** * This class defines a container of Servers */class HBServerContainer : public BaseServerContainer{ public: /// get the one and only one instance of this object static HBServerContainer& instance(); /// dtor virtual ~HBServerContainer(); /// create ServerWithGroup entry void addServerWithSnmp( const Data& key, const ServerType serverType); /// get list of all Servers in system void getListofAllServers( Sptr < vector < Data > > & listofServers); /// get list of Active Servers specified by ServerType void getListofActive( const ServerType type, Sptr < vector < Data > > & listofActiveServers); /// get the total number of servers in the system int getServerCount() { return (int)serverList.size(); } /// update heartbeat data bool processHeartbeat( const Data& key); /// do housekeeping void doHouseKeeping(); /// update RS from Provisioning void updateRSsFromPS(); /// update MS from Provisioning void updateMSsFromPS(); /// update FS from Provisioning void updateFSsFromPS(); /// update JS from Provisioning void updateJSsFromPS(); /// update POS from Provisioning void updatePOSsFromPS(); /// update CDR from Provisioning void updateCDRsFromPS(); /// update Global Heartbeat Data from Provisioning void updateHBParmsFromPS(); /// display list of servers by type void displayLists(); protected: /// ctor HBServerContainer(); /// This is the single instance of HBServerContainer static Sptr < HBServerContainer > theRSSrvContainer; /// configure Redirect Servers with Provisioning data. void configRedirectServers(); /// configure Marshal Servers with Provisioning data. void configMarshalServers(); /// configure Feature Servers with Provisioning data. void configFeatureServers(); /// configure Jtapi Servers with Provisioning data. void configJtapiServers(); /// configure Policy Servers with Provisioning data. void configPolicyServers(); /// configure CDR Servers with Provisioning data. void configCdrServers(); /// get Servers of Type from PS void getServersFromPS( const ServerType type, vector < Data > & retList); /// remove duplicate entries that already exist in container. void removeDuplicatesFromList( vector < Data > & list); private: /// its list of RS's vector < Data > itsRSList; /// lock helper for use of RS List VRWLock rsLock; /// its list of MS's vector < Data > itsMSList; /// lock helper for use of MS List VRWLock msLock; /// its list of FS's vector < Data > itsFSList; /// lock helper for use of FS List VRWLock fsLock; /// its list of JS's vector < Data > itsJSList; /// lock helper for use of JS List VRWLock jsLock; /// its list of POS's vector < Data > itsPOSList; /// lock helper for use of POS List VRWLock posLock; /// its list of CDR's vector < Data > itsCDRList; /// lock helper for use of CDR List VRWLock cdrLock;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -