00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _IPGROUP_I_H_
00033 #define _IPGROUP_I_H_
00034
00035
00036
00037
00038
00039
00040 #include "resourcelists.h"
00041
00042 #include "ipgroupS.h"
00043 #include "resource_i.h"
00044
00045
00046
00047 namespace OSB_CORBA {
00048 using namespace corba::common;
00049 using namespace corba::nwmgr;
00050 using namespace corba::nwmgr::nw;
00051 using namespace corba::nwmgr::nwe;
00052 using namespace corba::res;
00053
00054
00055
00061 class IpGroup_i :
00062 public virtual POA_corba::res::IpGroup,
00063 public virtual Resource_i
00064 {
00065 public:
00067 static const std::string IFC;
00068
00070 IpGroup_i(
00071 NetworkManager_i& nmgri,
00072 const OSB_LIB::Resource::Oid& oid
00073 );
00074
00076 virtual ~IpGroup_i();
00077
00085
00086 virtual Utf8String* desc()
00087 throw (CORBA::SystemException, OsbCorbaException);
00088
00090 virtual AssignedIp4Seq* getIp4s()
00091 throw (CORBA::SystemException, OsbCorbaException);
00092
00094 virtual Ip4AddressSeq* getCurIp4s()
00095 throw (CORBA::SystemException, OsbCorbaException);
00096
00098 virtual AssignedIp4Seq* getCurAssIp4s()
00099 throw (CORBA::SystemException, OsbCorbaException);
00100
00102 virtual AssignableIp4Seq* getAssignableIp4s()
00103 throw (CORBA::SystemException, OsbCorbaException);
00105
00107 virtual IpGroupWriter_ptr getWriter()
00108 throw (CORBA::SystemException, OsbCorbaException);
00109
00110 protected:
00112 typedef OSB_LIB::ResourceLists::IpGroupList IpgList;
00113
00129 virtual IpgList::Rg lockIpg() const;
00130
00131
00132 ReadGuard lock() const;
00133
00135 virtual Ip4Address_ptr getAvailIp4(
00136 const ResourceId& id
00137 ) throw (CORBA::SystemException, OsbCorbaException);
00138 };
00139
00140
00141
00147 class IpGroupWriter_i :
00148 public POA_corba::res::IpGroupWriter,
00149 public IpGroup_i,
00150 public ResourceWriter_i
00151 {
00152 public:
00154 static const std::string IFC;
00155
00157 IpGroupWriter_i(
00158 NetworkManager_i& nmgri,
00159 const OSB_LIB::IpGroup& ipg
00160 );
00161
00163 virtual void setDesc(const Utf8String& desc)
00164 throw (CORBA::SystemException);
00165
00182 virtual void addIp4(
00183 const ResourceId& id,
00184 corba::res::Direction dir,
00185 const Date& start,
00186 CORBA::Boolean noWait
00187 ) throw (OsbCorbaException);
00188
00204 virtual void delIp4(
00205 const ResourceId& id,
00206 corba::res::Direction dir,
00207 CORBA::Boolean noWait
00208 ) throw (OsbCorbaException);
00209
00210 private:
00216 IpGroup_i::IpgList::Rg lockIpg() const;
00217
00218
00219 OSB_LIB::Resource& resource();
00220
00221 bool writeToList(bool isNew) const;
00222
00223 private:
00225 OSB_LIB::IpGroup ipg_;
00226 };
00227
00228
00229
00230
00237 OSB_LIB::IpGroup::Direction direction(
00238 corba::res::Direction dir
00239 );
00240
00247 corba::res::Direction direction(
00248 const OSB_LIB::IpGroup::Direction& dir
00249 );
00250
00251
00252 }
00253 #endif // #ifndef _IPGROUP_I_H_