networkmanager_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007   AUTHOR(S): Huang Yong Feng (hyf)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.39 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 #ifndef _NETWORKMANAGER_I_H_
00031 #define _NETWORKMANAGER_I_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 #include <string>
00037 #include <map>
00038 
00039 // + OSB library headers
00040 #include "mutex.h"
00041 #include "dbsession.h"
00042 
00043 #include "network.h"
00044 #include "resourcelists.h"
00045 
00046 // + local headers
00047 #include "utf8string.h"
00048 
00049 #include "inventorypoolC.h"
00050 #include "tariffobjectC.h"
00051 #include "networkmanagerS.h"
00052 #include "servantlocators.h"
00053 
00054 // class declaration
00055 namespace OSB_LIB {
00056     class ResourceLists;
00057     class InventoryPool;
00058 }
00059 
00060 namespace corba {
00061   namespace imgmt {
00062       class Pools;
00063       class Pool;
00064       class PoolId;
00065   }
00066 }
00067 
00068 // *********************************************************************
00069 // namespace extensions
00070 namespace OSB_CORBA {
00071     using namespace corba::nwmgr::nw;
00072     using namespace corba::nwmgr::nwe;
00073     using namespace corba::res;
00074     using namespace corba::nwmgr::trk;
00075     using namespace corba::nwmgr;
00076 
00077     using corba::common::OsbCorbaException;
00078     using corba::common::ServerInfo;
00079     using corba::tcat::cp::ConnectionPt;
00080     using corba::tcat::cp::ConnectionPtId;
00081     using corba::tcat::cp::ConnectionPtSeq;
00082 
00083     // *****************************************************************
00084     // class NetworkManager_i
00085     class NetworkManager_i :
00086         public virtual POA_corba::nwmgr::NetworkManager
00087     {
00088     public:
00089         static const std::string IFC;
00090 
00091         NetworkManager_i(
00092             const ServerInfo&              info,
00093             PortableServer::POA_ptr        rootPoa,
00094             PortableServer::POAManager_ptr poaManager
00095         ) throw (OsbCorbaException);
00096 
00097         virtual ~NetworkManager_i();
00098 
00099     private:
00101         NetworkManager_i(const NetworkManager_i&);
00103         NetworkManager_i& operator=(const NetworkManager_i&);
00104 
00105     public:                             // Network
00107         virtual ServerInfo* getServerInfo()
00108             throw (CORBA::SystemException);
00109 
00115         void ping() throw();
00116 
00118         virtual NetworkElementMgr_ptr getNetworkElementMgr()
00119             throw (CORBA::SystemException);
00120 
00122         virtual TrunkGroupMgr_ptr getTrunkGroupMgr()
00123             throw (CORBA::SystemException);
00124 
00126         virtual Network_ptr getNetwork(
00127             const NetworkId& id
00128         ) throw (CORBA::SystemException, OsbCorbaException);
00129 
00131         virtual NetworkSeq* getNetworks()
00132             throw (CORBA::SystemException, OsbCorbaException);
00133 
00135         virtual Network_ptr creNetwork(
00136             const Utf8String& name,
00137             const Utf8String& desc,
00138             const TimeZoneId& tzId,
00139             CORBA::Boolean    noWait
00140         ) throw (CORBA::SystemException, OsbCorbaException);
00141 
00143         virtual void delNetwork(
00144             const NetworkId& id,
00145             CORBA::Boolean   noWait
00146         ) throw (CORBA::SystemException, OsbCorbaException);
00147 
00155         corba::imgmt::Pools* inventoryPools(
00156             CORBA::Boolean force
00157         ) throw (CORBA::SystemException, OsbCorbaException);
00158 
00170         corba::imgmt::PoolId savePool (
00171           corba::imgmt::Pool& pool,
00172           CORBA::Boolean      noWait
00173         ) throw (CORBA::SystemException, OsbCorbaException);
00174 
00175         corba::imgmt::DvcRsrcMgr* mkDvcRsrcMgr()
00176           throw (CORBA::SystemException);
00177 
00179         OSB_LIB::ResourceLists& resourceLists();
00180 
00181     public:                             // TrunkResource
00183         typedef OSB_LIB::ResourceLists::TrList TrList;
00184 
00186         TrList& getTrList();
00187 
00189         virtual TrunkResource_ptr getTr(
00190             const ResourceId& id
00191         ) throw (CORBA::SystemException, OsbCorbaException);
00192 
00194         virtual TrunkResourceSeq* getTrs()
00195             throw (CORBA::SystemException, OsbCorbaException);
00196 
00198         virtual TrunkResourceSeq* getTrsOfNetwork(
00199             const NetworkId& id
00200         ) throw (CORBA::SystemException, OsbCorbaException);
00201 
00203         virtual TrunkResourceWriter_ptr creNewTr(
00204             const Utf8String& rn,
00205             const NetworkId&  nwId
00206         ) throw (CORBA::SystemException);
00207 
00209         virtual void delTr(
00210             const ResourceId&    id,
00211                   CORBA::Boolean noWait
00212         ) throw (CORBA::SystemException, OsbCorbaException);
00213 
00214     public:                             // AccessNumber
00216         typedef OSB_LIB::ResourceLists::AnList AnList;
00217 
00219         AnList& getAnList();
00220 
00222         virtual AccessNumber_ptr getAn(
00223             const ResourceId& id
00224         ) throw (CORBA::SystemException, OsbCorbaException);
00225 
00227         virtual AccessNumberSeq* getAns()
00228             throw (CORBA::SystemException, OsbCorbaException);
00229 
00231         virtual AccessNumberSeq* getAnsOfNetwork(
00232             const NetworkId& id
00233         ) throw (CORBA::SystemException, OsbCorbaException);
00234 
00236         virtual AccessNumberWriter_ptr creNewAn(
00237             const Utf8String& rn,
00238             const NetworkId&  nwId
00239         ) throw (CORBA::SystemException);
00240 
00242         virtual void delAn(
00243             const ResourceId&    id,
00244                   CORBA::Boolean noWait
00245         ) throw (CORBA::SystemException, OsbCorbaException);
00246 
00247     public:                             // E.164 resources
00249         typedef OSB_LIB::ResourceLists::E164List E164List;
00250 
00252         E164List& getE164List();
00253 
00255         E164Resource_ptr getE164(
00256             const ResourceId& id
00257         ) throw (CORBA::SystemException, OsbCorbaException);
00258 
00270         E164ResourceSeq* searchE164s(
00271                   ResourceStatus status,
00272             const Utf8String&    pattern,
00273                   int            maxNum
00274         ) throw (CORBA::SystemException, OsbCorbaException);
00275 
00287         E164ResourceSeq* createE164s(
00288             const NetworkElementId& neId,
00289             const Utf8String&       ccNdc,
00290             const Utf8String&       first,
00291                   int               qnty
00292         ) throw (CORBA::SystemException, OsbCorbaException);
00293 
00295         virtual void delE164(
00296             const ResourceId&    id,
00297                   CORBA::Boolean noWait
00298         ) throw (CORBA::SystemException, OsbCorbaException);
00299 
00300     private:
00302         E164ResourceSeq* creE164Servants(
00303             const E164List&    src,
00304             const std::string& module
00305         );
00306 
00307     public:                             // Connection point
00308         virtual ConnectionPt* getConnectionPt(
00309             const ConnectionPtId& cpId
00310         ) throw (CORBA::SystemException, OsbCorbaException);
00311 
00312         virtual ConnectionPtSeq* getConnectionPts()
00313             throw (CORBA::SystemException);
00314 
00315     public:                             // TimeZone
00316         virtual TimeZone* getTimeZone(const TimeZoneId& id)
00317             throw (CORBA::SystemException, OsbCorbaException);
00318 
00319         virtual TimeZoneSeq* getTimeZones()
00320             throw (CORBA::SystemException, OsbCorbaException);
00321 
00322     public:                             // Ip4Address
00324         typedef OSB_LIB::ResourceLists::Ip4List Ip4List;
00325 
00327         Ip4List& getIp4List();
00328 
00330         virtual Ip4Address_ptr getIp4(
00331             const ResourceId& id
00332         ) throw (CORBA::SystemException, OsbCorbaException);
00333 
00335         virtual Ip4AddressSeq* getIp4s()
00336             throw (CORBA::SystemException, OsbCorbaException);
00337 
00339         virtual Ip4AddressSeq* getIp4sOfNetwork(
00340             const NetworkId& id
00341         ) throw (CORBA::SystemException, OsbCorbaException);
00342 
00344         virtual Ip4AddressWriter_ptr creNewIp4(
00345             const Utf8String& rn,
00346             const NetworkId&  nwId
00347         ) throw (CORBA::SystemException);
00348 
00350         virtual void delIp4(
00351             const ResourceId&    id,
00352                   CORBA::Boolean noWait
00353         ) throw (CORBA::SystemException, OsbCorbaException);
00354 
00355     public:                             // IpGroup
00357         typedef OSB_LIB::ResourceLists::IpGroupList IpgList;
00358 
00360         IpgList& getIpgList();
00361 
00363         virtual IpGroup_ptr getIpg(
00364             const ResourceId& id
00365         ) throw (CORBA::SystemException, OsbCorbaException);
00366 
00368         virtual IpGroupSeq* getIpgs()
00369             throw (CORBA::SystemException, OsbCorbaException);
00370 
00372         virtual IpGroupSeq* getIpgsOfNetwork(
00373             const NetworkId& id
00374         ) throw (CORBA::SystemException, OsbCorbaException);
00375 
00377         virtual IpGroupWriter_ptr creNewIpg(
00378             const Utf8String& rn,
00379             const NetworkId&  nwId
00380         ) throw (CORBA::SystemException);
00381 
00383         virtual void delIpg(
00384             const ResourceId&    id,
00385                   CORBA::Boolean noWait
00386         ) throw (CORBA::SystemException, OsbCorbaException);
00387 
00388     public:
00390         PortableServer::POA_ptr networkPoa();
00391 
00393         PortableServer::POA_ptr nwElementPoa();
00394 
00396         PortableServer::POA_ptr trkGroupPoa();
00397 
00399         PortableServer::POA_ptr numAnalyzerPoa();
00400 
00402         PortableServer::POA_ptr writerPoa();
00403 
00405         PortableServer::POA_ptr nweMgrPoa();
00406 
00408         PortableServer::POA_ptr trkMgrPoa();
00409 
00411         PortableServer::POA_ptr rsrcPoa();
00413         PortableServer::POA_ptr dvcPoa();
00414 
00416         Locators& networkLoc();
00418         Locators& nwElementLoc();
00420         Locators& trkGroupLoc();
00422         Locators& numAnalyzerLoc();
00423 
00425         Locators& writerLoc();
00426 
00428         Locators& drMgrLoc();
00430         Locators& rsrcLoc();
00432         Locators& dvcLoc();
00433 
00434     private:
00436         typedef std::list<OSB_LIB::InventoryPool> InvPools;
00438         OSB_LIB::ResourceLists* resourceLists_;
00440         InvPools* invPools_;
00441 
00442     private:
00444         ServerInfo info_;
00445 
00447         const std::string nweMgrOidStr_;
00448 
00450         const std::string trkMgrOidStr_;
00451 
00452         // *************************************************************
00453         // POA definitions
00455         PortableServer::POA_var networkPoa_;
00457         PortableServer::POA_var nwElementPoa_;
00459         PortableServer::POA_var trkGroupPoa_;
00461         PortableServer::POA_var numAnalyzerPoa_;
00462 
00464         PortableServer::POA_var writerPoa_;
00465 
00467         PortableServer::POA_var nweMgrPoa_;
00469         PortableServer::POA_var trkMgrPoa_;
00470 
00472         PortableServer::POA_var rsrcPoa_;
00473 
00475         PortableServer::POA_var drMgrPoa_;
00476 
00478         PortableServer::POA_var dvcPoa_;
00479 
00480         // *************************************************************
00481         // Servant locator definitions
00483         Locators networkLoc_;
00485         Locators nwElementLoc_;
00487         Locators trkGroupLoc_;
00489         Locators numAnalyzerLoc_;
00490 
00492         Locators writerLoc_;
00493 
00495         Locators drMgrLoc_;
00497         Locators rsrcLoc_;
00499         Locators dvcLoc_;
00500 
00501     private:
00502         void createPoas(
00503             PortableServer::POA_ptr        rootPoa,
00504             PortableServer::POAManager_ptr poaManager
00505         );
00506 
00511         void createMgrPoas(
00512             PortableServer::POA_ptr        rootPoa,
00513             PortableServer::POAManager_ptr poaManager
00514         );
00515     };                                  // class NetworkManager_i
00516 
00517     // *****************************************************************
00518     // class NetworkElementMgr
00519     class NetworkElementMgr_i :
00520         public virtual POA_corba::nwmgr::NetworkElementMgr
00521     {
00522     public:
00523         static const std::string IFC;
00525         NetworkElementMgr_i(NetworkManager_i& nmgri);
00527         virtual ~NetworkElementMgr_i();
00528 
00530         NetworkElementWriter_ptr creNewElement(
00531             const NetworkId& id
00532         ) throw (CORBA::SystemException, OsbCorbaException);
00533 
00535         //NetworkElement_ptr addElement(
00536         //    NetworkElementWriter& nweWriter
00537         //) throw (OsbCorbaException);
00538 
00540         void delElement(
00541            const NetworkElementId& id,
00542                  CORBA::Boolean    noWait
00543         ) throw (CORBA::SystemException, OsbCorbaException);
00544 
00545     private:
00547         NetworkManager_i& nmgri_;
00548     };                                  // class NetworkElementMgr_i
00549 
00550     // *****************************************************************
00551     // class TrunkGroupMgr
00552     class TrunkGroupMgr_i :
00553         public virtual POA_corba::nwmgr::TrunkGroupMgr
00554     {
00555     public:
00556         static const std::string IFC;
00558         TrunkGroupMgr_i(NetworkManager_i& nmgri);
00559 
00560     public:
00562         TrunkGroup_ptr getTrkGroup(
00563             const TrunkGroupId& id
00564         ) throw (CORBA::SystemException, OsbCorbaException);
00565 
00567         TrunkGroupWriter_ptr creNewTrkGroup(
00568             const NetworkElementId& id
00569         ) throw (CORBA::SystemException, OsbCorbaException);
00570 
00572         //TrunkGroup_ptr addTrunkGroup(
00573         //    TrunkGroupWriter& trkWriter
00574         //) throw (OsbCorbException);
00575 
00577         void delTrkGroup(
00578             const NetworkElementId& eid,
00579             const TrunkGroupId&     tid,
00580                   CORBA::Boolean    noWait
00581         ) throw (CORBA::SystemException, OsbCorbaException);
00582 
00583     private:
00585         NetworkManager_i& nmgri_;
00586     };                                  // class TrunkGroupMgr_i
00587 }                                       // namespace OSB_CORBA
00588 #endif                                  // #ifndef _NETWORKMANAGER_I_H_

Generated on Sat Sep 2 14:25:52 2006 for OSB Library by  doxygen 1.4.7