trunkresource_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.18 $
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 _TRUNKRESOURCE_I_H_
00031 #define _TRUNKRESOURCE_I_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "resourcelists.h"
00039 
00040 #include "trunkresourceS.h"
00041 #include "resource_i.h"
00042 #include "trunkgroup_i.h"
00043 
00044 // *********************************************************************
00045 // class definitions
00046 namespace OSB_CORBA {
00047     using namespace corba::common;
00048     using namespace corba::nwmgr;
00049     using namespace corba::nwmgr::nw;
00050     using namespace corba::nwmgr::nwe;
00051     using namespace corba::res;
00052 
00053     // *****************************************************************
00054     // class TrunkResource_i
00060     class TrunkResource_i :
00061         public virtual POA_corba::res::TrunkResource,
00062         public virtual Resource_i
00063     {
00064     public:
00066         static const std::string IFC;
00067 
00069         TrunkResource_i(
00070                   NetworkManager_i&       nmgri,
00071             const OSB_LIB::Resource::Oid& oid
00072         );
00073 
00075         virtual ~TrunkResource_i();
00076 
00084 
00085         virtual Utf8String* desc()
00086             throw (CORBA::SystemException, OsbCorbaException);
00087 
00089         virtual NetworkId extNetworkId()
00090             throw (CORBA::SystemException, OsbCorbaException);
00091 
00093         virtual CORBA::Boolean canSetExtNw()
00094             throw (CORBA::SystemException, OsbCorbaException);
00095 
00097         virtual AssignedTrunkSeq* getTrkGroups()
00098             throw (CORBA::SystemException, OsbCorbaException);
00099 
00101         virtual TrunkGroupSeq* getCurTrkGroups()
00102             throw (CORBA::SystemException, OsbCorbaException);
00103 
00105         virtual AssignedTrunkSeq* getCurAssTrkGroups()
00106             throw (CORBA::SystemException, OsbCorbaException);
00107 
00109         virtual TrunkGroupSeq* getAvailTrkGroups()
00110             throw (CORBA::SystemException, OsbCorbaException);
00112 
00114         virtual TrunkResourceWriter_ptr getWriter()
00115             throw (CORBA::SystemException, OsbCorbaException);
00116 
00117     protected:
00119         typedef OSB_LIB::ResourceLists::TrList TrList;
00120 
00122         virtual TrList::Rg lockTr() const;
00123 
00124         // documentation from base class
00125         ReadGuard lock() const;
00126 
00128         virtual TrunkGroup_ptr getAvailTrkGroup(
00129             const TrunkGroupId& id
00130         ) throw (CORBA::SystemException, OsbCorbaException);
00131     };
00132 
00133     // *****************************************************************
00134     // class TrunkResourceWriter_i
00141     class TrunkResourceWriter_i :
00142         public POA_corba::res::TrunkResourceWriter,
00143         public TrunkResource_i,
00144         public ResourceWriter_i
00145     {
00146     public:
00148         static const std::string IFC;
00149 
00151         TrunkResourceWriter_i(
00152                   NetworkManager_i&       nmgri,
00153             const OSB_LIB::TrunkResource& tr
00154         );
00155 
00157         void setDesc(const Utf8String& desc)
00158             throw (CORBA::SystemException);
00159 
00161         void setExtNetwork(const NetworkId& id)
00162             throw (CORBA::SystemException, SameNetwork,
00163                    TrunksAssigned, StatusIsAssigned);
00164 
00180         void addTrkGroup(
00181             const TrunkGroupId& id,
00182             const Date&         start,
00183             CORBA::Boolean      noWait
00184         ) throw (OsbCorbaException);
00185 
00200         void delTrkGroup(
00201             const TrunkGroupId& id,
00202             CORBA::Boolean      noWait
00203         ) throw (OsbCorbaException);
00204 
00205     protected:
00212         TrunkResource_i::TrList::Rg lockTr() const;
00213 
00214         // documentation from base class
00215         OSB_LIB::Resource& resource();
00216         // documentation from base
00217         bool writeToList(bool isNew) const;
00218 
00219     private:
00221         OSB_LIB::TrunkResource tr_;
00222     };
00223 }                                       // namespace OSB_CORBA
00224 #endif                                  // #ifndef _TRUNKRESOURCE_I_H_

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