00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _TRUNKRESOURCE_I_H_
00031 #define _TRUNKRESOURCE_I_H_
00032
00033
00034
00035
00036
00037
00038 #include "resourcelists.h"
00039
00040 #include "trunkresourceS.h"
00041 #include "resource_i.h"
00042 #include "trunkgroup_i.h"
00043
00044
00045
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
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
00125 ReadGuard lock() const;
00126
00128 virtual TrunkGroup_ptr getAvailTrkGroup(
00129 const TrunkGroupId& id
00130 ) throw (CORBA::SystemException, OsbCorbaException);
00131 };
00132
00133
00134
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
00215 OSB_LIB::Resource& resource();
00216
00217 bool writeToList(bool isNew) const;
00218
00219 private:
00221 OSB_LIB::TrunkResource tr_;
00222 };
00223 }
00224 #endif // #ifndef _TRUNKRESOURCE_I_H_