Skip to content

Commit 84d5f05

Browse files
author
Alex Huang
committed
Changed network tags to network name as we no longer need to send the entire network tags down to the resource.
1 parent 1d268dc commit 84d5f05

11 files changed

Lines changed: 1878 additions & 1904 deletions

File tree

api/src/com/cloud/agent/api/to/IpAddressTO.java

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818

1919
package com.cloud.agent.api.to;
2020

21-
import java.util.List;
22-
2321
import com.cloud.network.Networks.TrafficType;
2422

2523

2624
public class IpAddressTO {
27-
28-
private long accountId;
25+
26+
private long accountId;
2927
private String publicIp;
3028
private boolean sourceNat;
3129
private boolean add;
@@ -38,8 +36,8 @@ public class IpAddressTO {
3836
private String guestIp;
3937
private Integer networkRate;
4038
private TrafficType trafficType;
41-
private String[] networkTags;
42-
39+
private String networkName;
40+
4341
public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp, Integer networkRate, boolean isOneToOneNat) {
4442
this.accountId = accountId;
4543
this.publicIp = ipAddress;
@@ -54,12 +52,12 @@ public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstI
5452
this.networkRate = networkRate;
5553
this.oneToOneNat = isOneToOneNat;
5654
}
57-
55+
5856
protected IpAddressTO() {
5957
}
60-
58+
6159
public long getAccountId() {
62-
return accountId;
60+
return accountId;
6361
}
6462

6563
public String getGuestIp(){
@@ -69,36 +67,32 @@ public String getGuestIp(){
6967
public String getPublicIp() {
7068
return publicIp;
7169
}
72-
70+
7371
public TrafficType getTrafficType() {
7472
return trafficType;
7573
}
76-
77-
public void setNetworkTags(List<String> tagsList) {
78-
if (tagsList == null || tagsList.size() == 0) {
79-
networkTags = null;
80-
} else {
81-
networkTags = tagsList.toArray(new String[tagsList.size()]);
82-
}
74+
75+
public void setNetworkName(String name) {
76+
this.networkName = name;
8377
}
84-
85-
public String[] getNetworkTags() {
86-
return networkTags;
78+
79+
public String getNetworkName() {
80+
return networkName;
8781
}
88-
89-
82+
83+
9084
public void setTrafficType(TrafficType trafficType) {
9185
this.trafficType = trafficType;
9286
}
9387

9488
public boolean isAdd() {
9589
return add;
9690
}
97-
91+
9892
public boolean isOneToOneNat(){
9993
return this.oneToOneNat;
10094
}
101-
95+
10296
public boolean isFirstIP() {
10397
return firstIP;
10498
}
@@ -110,23 +104,23 @@ public void setSourceNat(boolean sourceNat) {
110104
public boolean isSourceNat() {
111105
return sourceNat;
112106
}
113-
107+
114108
public String getVlanId() {
115109
return vlanId;
116110
}
117-
111+
118112
public String getVlanGateway() {
119113
return vlanGateway;
120114
}
121-
115+
122116
public String getVlanNetmask() {
123117
return vlanNetmask;
124118
}
125-
119+
126120
public String getVifMacAddress() {
127121
return vifMacAddress;
128122
}
129-
123+
130124
public Integer getNetworkRate() {
131125
return networkRate;
132126
}

api/src/com/cloud/agent/api/to/NetworkTO.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package com.cloud.agent.api.to;
1919

2020
import java.net.URI;
21-
import java.util.List;
2221

2322
import com.cloud.network.Networks.BroadcastDomainType;
2423
import com.cloud.network.Networks.TrafficType;
@@ -39,7 +38,7 @@ public class NetworkTO {
3938
protected URI broadcastUri;
4039
protected URI isolationUri;
4140
protected boolean isSecurityGroupEnabled;
42-
protected String[] tags;
41+
protected String name;
4342

4443
public NetworkTO() {
4544
}
@@ -88,12 +87,12 @@ public void setType(TrafficType type) {
8887
this.type = type;
8988
}
9089

91-
public void setTags(List<String> tags) {
92-
this.tags = tags.toArray(new String[tags.size()]);
90+
public void setName(String name) {
91+
this.name = name;
9392
}
9493

95-
public String[] getTags() {
96-
return tags;
94+
public String getName() {
95+
return name;
9796
}
9897

9998
public void setSecurityGroupEnabled(boolean enabled) {

api/src/com/cloud/vm/NicProfile.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
package com.cloud.vm;
2323

2424
import java.net.URI;
25-
import java.util.List;
2625

2726
import com.cloud.network.Network;
2827
import com.cloud.network.Networks.AddressFormat;
@@ -54,15 +53,15 @@ public class NicProfile {
5453
String dns2;
5554
Integer networkRate;
5655
boolean isSecurityGroupEnabled;
57-
List<String> tags;
56+
String name;
5857
String requestedIp;
5958

6059
public String getDns1() {
6160
return dns1;
6261
}
6362

64-
public List<String> getTags() {
65-
return tags;
63+
public String getName() {
64+
return name;
6665
}
6766

6867
public String getDns2() {
@@ -213,7 +212,7 @@ public ReservationStrategy getStrategy() {
213212
return strategy;
214213
}
215214

216-
public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate, boolean isSecurityGroupEnabled, List<String> tags) {
215+
public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate, boolean isSecurityGroupEnabled, String name) {
217216
this.id = nic.getId();
218217
this.networkId = network.getId();
219218
this.gateway = nic.getGateway();
@@ -233,7 +232,7 @@ public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri,
233232
this.netmask = nic.getNetmask();
234233
this.isSecurityGroupEnabled = isSecurityGroupEnabled;
235234
this.vmId = nic.getInstanceId();
236-
this.tags = tags;
235+
this.name = name;
237236

238237
if (networkRate != null) {
239238
this.networkRate = networkRate;
@@ -255,7 +254,7 @@ public NicProfile(ReservationStrategy strategy, String ip4Address, String macAdd
255254
this.netmask = netmask;
256255
this.strategy = strategy;
257256
}
258-
257+
259258
public NicProfile(String requestedIp) {
260259
this.requestedIp = requestedIp;
261260
}

0 commit comments

Comments
 (0)