3030
3131import com .cloud .network .Network .TrafficType ;
3232import com .cloud .offering .NetworkOffering ;
33+ import com .cloud .service .ServiceOfferingVO ;
3334import com .cloud .utils .db .GenericDao ;
3435
3536@ Entity
@@ -72,6 +73,9 @@ public class NetworkOfferingVO implements NetworkOffering {
7273 @ Column (name ="system_only" )
7374 boolean systemOnly ;
7475
76+ @ Column (name ="service_offering_id" )
77+ Long serviceOfferingId ;
78+
7579 @ Column (name ="tags" )
7680 String tags ;
7781
@@ -128,6 +132,14 @@ public Date getRemoved() {
128132 return removed ;
129133 }
130134
135+ public Long getServiceOfferingId () {
136+ return serviceOfferingId ;
137+ }
138+
139+ public void setServiceOfferingId (long serviceOfferingId ) {
140+ this .serviceOfferingId = serviceOfferingId ;
141+ }
142+
131143 @ Override
132144 public Integer getConcurrentConnections () {
133145 return concurrentConnections ;
@@ -144,6 +156,50 @@ public void setTags(String tags) {
144156 public NetworkOfferingVO () {
145157 }
146158
159+ public void setName (String name ) {
160+ this .name = name ;
161+ }
162+
163+ public void setDisplayText (String displayText ) {
164+ this .displayText = displayText ;
165+ }
166+
167+ public void setRateMbps (Integer rateMbps ) {
168+ this .rateMbps = rateMbps ;
169+ }
170+
171+ public void setMulticastRateMbps (Integer multicastRateMbps ) {
172+ this .multicastRateMbps = multicastRateMbps ;
173+ }
174+
175+ public void setConcurrentConnections (Integer concurrentConnections ) {
176+ this .concurrentConnections = concurrentConnections ;
177+ }
178+
179+ public void setGuestIpType (GuestIpType guestIpType ) {
180+ this .guestIpType = guestIpType ;
181+ }
182+
183+ public void setTrafficType (TrafficType trafficType ) {
184+ this .trafficType = trafficType ;
185+ }
186+
187+ public void setSystemOnly (boolean systemOnly ) {
188+ this .systemOnly = systemOnly ;
189+ }
190+
191+ public void setServiceOfferingId (Long serviceOfferingId ) {
192+ this .serviceOfferingId = serviceOfferingId ;
193+ }
194+
195+ public void setRemoved (Date removed ) {
196+ this .removed = removed ;
197+ }
198+
199+ public void setCreated (Date created ) {
200+ this .created = created ;
201+ }
202+
147203 public NetworkOfferingVO (String name , String displayText , TrafficType trafficType , GuestIpType type , boolean systemOnly , Integer rateMbps , Integer multicastRateMbps , Integer concurrentConnections ) {
148204 this .name = name ;
149205 this .displayText = displayText ;
@@ -155,6 +211,11 @@ public NetworkOfferingVO(String name, String displayText, TrafficType trafficTyp
155211 this .systemOnly = systemOnly ;
156212 }
157213
214+ public NetworkOfferingVO (ServiceOfferingVO offering ) {
215+ this ("Network Offering for " + offering .getName (), "Network Offering for " + offering .getDisplayText (), TrafficType .Guest , offering .getGuestIpType (), false , offering .getRateMbps (), offering .getMulticastRateMbps (), null );
216+ this .serviceOfferingId = offering .getId ();
217+ }
218+
158219 /**
159220 * Network Offering for all system vms.
160221 * @param name
0 commit comments