1818
1919import java .util .Date ;
2020import java .util .List ;
21+ import java .util .HashSet ;
22+ import java .util .Set ;
23+
2124
2225import org .apache .cloudstack .api .ApiConstants ;
2326import com .cloud .serializer .Param ;
2629import com .google .gson .annotations .SerializedName ;
2730
2831@ SuppressWarnings ("unused" )
29- public class DomainRouterResponse extends BaseResponse implements ControlledEntityResponse {
32+ public class DomainRouterResponse extends BaseResponse implements ControlledViewEntityResponse {
3033 @ SerializedName (ApiConstants .ID ) @ Param (description ="the id of the router" )
31- private IdentityProxy id = new IdentityProxy ( "vm_instance" ) ;
34+ private String id ;
3235
3336 @ SerializedName (ApiConstants .ZONE_ID ) @ Param (description ="the Zone ID for the router" )
34- private IdentityProxy zoneId = new IdentityProxy ( "data_center" ) ;
37+ private String zoneId ;
3538
3639 @ SerializedName (ApiConstants .ZONE_NAME ) @ Param (description ="the Zone name for the router" )
3740 private String zoneName ;
@@ -52,10 +55,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
5255 private String name ;
5356
5457 @ SerializedName (ApiConstants .POD_ID ) @ Param (description ="the Pod ID for the router" )
55- private IdentityProxy podId = new IdentityProxy ( "host_pod_ref" ) ;
58+ private String podId ;
5659
5760 @ SerializedName (ApiConstants .HOST_ID ) @ Param (description ="the host ID for the router" )
58- private IdentityProxy hostId = new IdentityProxy ( "host" ) ;
61+ private String hostId ;
5962
6063 @ SerializedName ("hostname" ) @ Param (description ="the hostname for the router" )
6164 private String hostName ;
@@ -70,7 +73,7 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
7073 private String linkLocalNetmask ;
7174
7275 @ SerializedName (ApiConstants .LINK_LOCAL_NETWORK_ID ) @ Param (description ="the ID of the corresponding link local network" )
73- private IdentityProxy linkLocalNetworkId = new IdentityProxy ( "networks" ) ;
76+ private String linkLocalNetworkId ;
7477
7578 @ SerializedName (ApiConstants .PUBLIC_IP ) @ Param (description ="the public IP address for the router" )
7679 private String publicIp ;
@@ -82,7 +85,7 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
8285 private String publicNetmask ;
8386
8487 @ SerializedName ("publicnetworkid" ) @ Param (description ="the ID of the corresponding public network" )
85- private IdentityProxy publicNetworkId = new IdentityProxy ( "networks" ) ;
88+ private String publicNetworkId ;
8689
8790 @ SerializedName ("guestipaddress" ) @ Param (description ="the guest IP address for the router" )
8891 private String guestIpAddress ;
@@ -94,10 +97,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
9497 private String guestNetmask ;
9598
9699 @ SerializedName ("guestnetworkid" ) @ Param (description ="the ID of the corresponding guest network" )
97- private IdentityProxy guestNetworkId = new IdentityProxy ( "networks" ) ;
100+ private String guestNetworkId ;
98101
99102 @ SerializedName (ApiConstants .TEMPLATE_ID ) @ Param (description ="the template ID for the router" )
100- private IdentityProxy templateId = new IdentityProxy ( "vm_template" ) ;
103+ private String templateId ;
101104
102105 @ SerializedName (ApiConstants .CREATED ) @ Param (description ="the date and time the router was created" )
103106 private Date created ;
@@ -109,19 +112,19 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
109112 private String accountName ;
110113
111114 @ SerializedName (ApiConstants .PROJECT_ID ) @ Param (description ="the project id of the ipaddress" )
112- private IdentityProxy projectId = new IdentityProxy ( "projects" ) ;
115+ private String projectId ;
113116
114117 @ SerializedName (ApiConstants .PROJECT ) @ Param (description ="the project name of the address" )
115118 private String projectName ;
116119
117120 @ SerializedName (ApiConstants .DOMAIN_ID ) @ Param (description ="the domain ID associated with the router" )
118- private IdentityProxy domainId = new IdentityProxy ( "domain" ) ;
121+ private String domainId ;
119122
120123 @ SerializedName (ApiConstants .DOMAIN ) @ Param (description ="the domain associated with the router" )
121124 private String domainName ;
122125
123126 @ SerializedName (ApiConstants .SERVICE_OFFERING_ID ) @ Param (description ="the ID of the service offering of the virtual machine" )
124- private IdentityProxy serviceOfferingId = new IdentityProxy ( "disk_offering" ) ;
127+ private String serviceOfferingId ;
125128
126129 @ SerializedName ("serviceofferingname" ) @ Param (description ="the name of the service offering of the virtual machine" )
127130 private String serviceOfferingName ;
@@ -139,27 +142,31 @@ public class DomainRouterResponse extends BaseResponse implements ControlledEnti
139142 private String scriptsVersion ;
140143
141144 @ SerializedName (ApiConstants .VPC_ID ) @ Param (description ="VPC the network belongs to" )
142- private IdentityProxy vpcId = new IdentityProxy ( "vpc" ) ;
145+ private String vpcId ;
143146
144147 @ SerializedName ("nic" ) @ Param (description ="the list of nics associated with the router" ,
145148 responseObject = NicResponse .class , since ="4.0" )
146- private List <NicResponse > nics ;
149+ private Set <NicResponse > nics ;
150+
151+ public DomainRouterResponse (){
152+ nics = new HashSet <NicResponse >();
153+ }
147154
148155 @ Override
149- public Long getObjectId () {
150- return getId ();
156+ public String getObjectUuid () {
157+ return this . getId ();
151158 }
152159
153- public Long getId () {
154- return id . getValue () ;
160+ public String getId () {
161+ return id ;
155162 }
156163
157- public void setId (Long id ) {
158- this .id . setValue ( id ) ;
164+ public void setId (String id ) {
165+ this .id = id ;
159166 }
160167
161- public void setZoneId (Long zoneId ) {
162- this .zoneId . setValue ( zoneId ) ;
168+ public void setZoneId (String zoneId ) {
169+ this .zoneId = zoneId ;
163170 }
164171
165172 public void setZoneName (String zoneName ) {
@@ -186,12 +193,12 @@ public void setName(String name) {
186193 this .name = name ;
187194 }
188195
189- public void setPodId (Long podId ) {
190- this .podId . setValue ( podId ) ;
196+ public void setPodId (String podId ) {
197+ this .podId = podId ;
191198 }
192199
193- public void setHostId (Long hostId ) {
194- this .hostId . setValue ( hostId ) ;
200+ public void setHostId (String hostId ) {
201+ this .hostId = hostId ;
195202 }
196203
197204 public void setHostName (String hostName ) {
@@ -222,8 +229,8 @@ public void setGuestNetmask(String guestNetmask) {
222229 this .guestNetmask = guestNetmask ;
223230 }
224231
225- public void setTemplateId (Long templateId ) {
226- this .templateId . setValue ( templateId ) ;
232+ public void setTemplateId (String templateId ) {
233+ this .templateId = templateId ;
227234 }
228235
229236 public void setCreated (Date created ) {
@@ -240,21 +247,21 @@ public void setAccountName(String accountName) {
240247 }
241248
242249 @ Override
243- public void setDomainId (Long domainId ) {
244- this .domainId . setValue ( domainId ) ;
250+ public void setDomainId (String domainId ) {
251+ this .domainId = domainId ;
245252 }
246253
247254 @ Override
248255 public void setDomainName (String domainName ) {
249256 this .domainName = domainName ;
250257 }
251258
252- public void setPublicNetworkId (Long publicNetworkId ) {
253- this .publicNetworkId . setValue ( publicNetworkId ) ;
259+ public void setPublicNetworkId (String publicNetworkId ) {
260+ this .publicNetworkId = publicNetworkId ;
254261 }
255262
256- public void setGuestNetworkId (Long guestNetworkId ) {
257- this .guestNetworkId . setValue ( guestNetworkId ) ;
263+ public void setGuestNetworkId (String guestNetworkId ) {
264+ this .guestNetworkId = guestNetworkId ;
258265 }
259266
260267 public void setLinkLocalIp (String linkLocalIp ) {
@@ -269,12 +276,12 @@ public void setLinkLocalNetmask(String linkLocalNetmask) {
269276 this .linkLocalNetmask = linkLocalNetmask ;
270277 }
271278
272- public void setLinkLocalNetworkId (Long linkLocalNetworkId ) {
273- this .linkLocalNetworkId . setValue ( linkLocalNetworkId ) ;
279+ public void setLinkLocalNetworkId (String linkLocalNetworkId ) {
280+ this .linkLocalNetworkId = linkLocalNetworkId ;
274281 }
275282
276- public void setServiceOfferingId (Long serviceOfferingId ) {
277- this .serviceOfferingId . setValue ( serviceOfferingId ) ;
283+ public void setServiceOfferingId (String serviceOfferingId ) {
284+ this .serviceOfferingId = serviceOfferingId ;
278285 }
279286
280287 public void setServiceOfferingName (String serviceOfferingName ) {
@@ -305,20 +312,24 @@ public void setScriptsVersion(String scriptsVersion) {
305312 this .scriptsVersion = scriptsVersion ;
306313 }
307314 @ Override
308- public void setProjectId (Long projectId ) {
309- this .projectId . setValue ( projectId ) ;
315+ public void setProjectId (String projectId ) {
316+ this .projectId = projectId ;
310317 }
311318
312319 @ Override
313320 public void setProjectName (String projectName ) {
314321 this .projectName = projectName ;
315322 }
316323
317- public void setVpcId (Long vpcId ) {
318- this .vpcId . setValue ( vpcId ) ;
324+ public void setVpcId (String vpcId ) {
325+ this .vpcId = vpcId ;
319326 }
320327
321- public void setNics (List <NicResponse > nics ) {
328+ public void setNics (Set <NicResponse > nics ) {
322329 this .nics = nics ;
323330 }
331+
332+ public void addNic (NicResponse nic ) {
333+ this .nics .add (nic );
334+ }
324335}
0 commit comments