Skip to content

Commit b708df7

Browse files
committed
CLOUDSTACK-8677: use wrapper classes for gson serialisation
1 parent fb4e6ed commit b708df7

651 files changed

Lines changed: 1627 additions & 1563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public String getName() {
313313
return _name;
314314
}
315315

316-
private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, final String encryptorPassword) {
316+
private void launchConsoleProxy(final Byte[] ksBits, final String ksPassword, final String encryptorPassword) {
317317
final Object resource = this;
318318
if (_consoleProxyMain == null) {
319319
_consoleProxyMain = new Thread(new ManagedContextRunnable() {

api/src/com/cloud/agent/api/Answer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.cloud.utils.exception.ExceptionUtil;
2020

2121
public class Answer extends Command {
22-
protected boolean result;
22+
protected Boolean result = false;
2323
protected String details;
2424

2525
protected Answer() {
@@ -39,7 +39,7 @@ public Answer(final Command command, final Exception e) {
3939
this(command, false, ExceptionUtil.toString(e));
4040
}
4141

42-
public boolean getResult() {
42+
public Boolean getResult() {
4343
return result;
4444
}
4545

@@ -48,7 +48,7 @@ public String getDetails() {
4848
}
4949

5050
@Override
51-
public boolean executeInSequence() {
51+
public Boolean executeInSequence() {
5252
return false;
5353
}
5454

api/src/com/cloud/agent/api/Command.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public static enum OnError {
3636
// allow command to carry over hypervisor or other environment related context info
3737
@LogLevel(Log4jLevel.Trace)
3838
protected Map<String, String> contextMap = new HashMap<String, String>();
39-
private int wait; //in second
39+
private Integer wait; //in second
4040

4141
protected Command() {
4242
this.wait = 0;
4343
}
4444

45-
public int getWait() {
45+
public Integer getWait() {
4646
return wait;
4747
}
4848

@@ -60,7 +60,7 @@ public final String toString() {
6060
* When this is set to true, the commands are executed by a single
6161
* thread on the agent.
6262
*/
63-
public abstract boolean executeInSequence();
63+
public abstract Boolean executeInSequence();
6464

6565
public void setContextParam(String name, String value) {
6666
contextMap.put(name, value);

api/src/com/cloud/agent/api/PvlanSetupCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static public PvlanSetupCommand createVmSetup(String op, URI uri, String network
6161
}
6262

6363
@Override
64-
public boolean executeInSequence() {
64+
public Boolean executeInSequence() {
6565
return true;
6666
}
6767

api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public CreateVolumeOVACommand(String secUrl, String volPath, String volName, Sto
3838
}
3939

4040
@Override
41-
public boolean executeInSequence() {
41+
public Boolean executeInSequence() {
4242
return true;
4343
}
4444

api/src/com/cloud/agent/api/storage/PrepareOVAPackingCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public PrepareOVAPackingCommand(String secUrl, String templatePath) {
3131
}
3232

3333
@Override
34-
public boolean executeInSequence() {
34+
public Boolean executeInSequence() {
3535
return true;
3636
}
3737

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ public interface DataTO {
3232
*/
3333
String getPath();
3434

35-
long getId();
35+
Long getId();
3636
}

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@
4040
*
4141
*/
4242
public class FirewallRuleTO implements InternalIdentity {
43-
long id;
43+
Long id;
4444
String srcVlanTag;
4545
String srcIp;
4646
String protocol;
47-
int[] srcPortRange;
48-
boolean revoked;
49-
boolean alreadyAdded;
47+
Integer[] srcPortRange;
48+
Boolean revoked;
49+
Boolean alreadyAdded;
5050
private List<String> sourceCidrList;
5151
FirewallRule.Purpose purpose;
5252
private Integer icmpType;
5353
private Integer icmpCode;
5454
private FirewallRule.TrafficType trafficType;
5555
private String guestCidr;
56-
private boolean defaultEgressPolicy;
56+
private Boolean defaultEgressPolicy = false;
5757
private FirewallRule.FirewallRuleType type;
5858

5959
protected FirewallRuleTO() {
6060
}
6161

62-
public FirewallRuleTO(long id, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded,
62+
public FirewallRuleTO(Long id, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, Boolean revoked, Boolean alreadyAdded,
6363
FirewallRule.Purpose purpose, List<String> sourceCidr, Integer icmpType, Integer icmpCode) {
6464
this(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, purpose, sourceCidr, icmpType, icmpCode);
6565
}
6666

67-
public FirewallRuleTO(long id, String srcVlanTag, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded,
67+
public FirewallRuleTO(Long id, String srcVlanTag, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, Boolean revoked, Boolean alreadyAdded,
6868
FirewallRule.Purpose purpose, List<String> sourceCidr, Integer icmpType, Integer icmpCode) {
6969
this.id = id;
7070
this.srcVlanTag = srcVlanTag;
@@ -78,10 +78,10 @@ public FirewallRuleTO(long id, String srcVlanTag, String srcIp, String protocol,
7878
portRange.add(srcPortEnd);
7979
}
8080

81-
srcPortRange = new int[portRange.size()];
81+
srcPortRange = new Integer[portRange.size()];
8282
int i = 0;
8383
for (Integer port : portRange) {
84-
srcPortRange[i] = port.intValue();
84+
srcPortRange[i] = port;
8585
i++;
8686
}
8787
}
@@ -157,7 +157,7 @@ public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, Firewa
157157
}
158158

159159
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType,
160-
boolean defaultEgressPolicy) {
160+
Boolean defaultEgressPolicy) {
161161
this(rule.getId(),
162162
srcVlanTag,
163163
srcIp,
@@ -174,7 +174,7 @@ public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, Firewa
174174
this.defaultEgressPolicy = defaultEgressPolicy;
175175
}
176176

177-
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, boolean revokeState, boolean alreadyAdded) {
177+
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, Boolean revokeState, Boolean alreadyAdded) {
178178
this(rule.getId(),
179179
srcVlanTag,
180180
srcIp,
@@ -189,7 +189,7 @@ public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, Firewa
189189
rule.getIcmpCode());
190190
}
191191

192-
public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType, String guestCidr, boolean defaultEgressPolicy,
192+
public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType, String guestCidr, Boolean defaultEgressPolicy,
193193
FirewallRule.FirewallRuleType type) {
194194
this(rule.getId(),
195195
guestVlanTag,
@@ -214,7 +214,7 @@ public FirewallRule.TrafficType getTrafficType() {
214214
}
215215

216216
@Override
217-
public long getId() {
217+
public Long getId() {
218218
return id;
219219
}
220220

@@ -230,7 +230,7 @@ public String getProtocol() {
230230
return protocol;
231231
}
232232

233-
public int[] getSrcPortRange() {
233+
public Integer[] getSrcPortRange() {
234234
return srcPortRange;
235235
}
236236

@@ -249,23 +249,23 @@ public String getStringSrcPortRange() {
249249
return NetUtils.portRangeToString(srcPortRange);
250250
}
251251

252-
public boolean revoked() {
252+
public Boolean revoked() {
253253
return revoked;
254254
}
255255

256256
public List<String> getSourceCidrList() {
257257
return sourceCidrList;
258258
}
259259

260-
public boolean isAlreadyAdded() {
260+
public Boolean isAlreadyAdded() {
261261
return alreadyAdded;
262262
}
263263

264264
public FirewallRule.Purpose getPurpose() {
265265
return purpose;
266266
}
267267

268-
public boolean isDefaultEgressPolicy() {
268+
public Boolean isDefaultEgressPolicy() {
269269
return defaultEgressPolicy;
270270
}
271271

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
public class IpAddressTO {
2222

23-
private long accountId;
23+
private Long accountId;
2424
private String publicIp;
25-
private boolean sourceNat;
26-
private boolean add;
27-
private boolean oneToOneNat;
28-
private boolean firstIP;
25+
private Boolean sourceNat;
26+
private Boolean add;
27+
private Boolean oneToOneNat;
28+
private Boolean firstIP;
2929
private String broadcastUri;
3030
private String vlanGateway;
3131
private String vlanNetmask;
@@ -34,10 +34,10 @@ public class IpAddressTO {
3434
private TrafficType trafficType;
3535
private String networkName;
3636
private Integer nicDevId;
37-
private boolean newNic;
37+
private Boolean newNic;
3838

39-
public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean sourceNat, String broadcastUri, String vlanGateway, String vlanNetmask,
40-
String vifMacAddress, Integer networkRate, boolean isOneToOneNat) {
39+
public IpAddressTO(Long accountId, String ipAddress, Boolean add, Boolean firstIP, Boolean sourceNat, String broadcastUri, String vlanGateway, String vlanNetmask,
40+
String vifMacAddress, Integer networkRate, Boolean isOneToOneNat) {
4141
this.accountId = accountId;
4242
this.publicIp = ipAddress;
4343
this.add = add;
@@ -49,12 +49,14 @@ public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstI
4949
this.vifMacAddress = vifMacAddress;
5050
this.networkRate = networkRate;
5151
this.oneToOneNat = isOneToOneNat;
52+
setNicDevId(0);
53+
setNewNic(false);
5254
}
5355

5456
protected IpAddressTO() {
5557
}
5658

57-
public long getAccountId() {
59+
public Long getAccountId() {
5860
return accountId;
5961
}
6062

@@ -78,23 +80,23 @@ public void setTrafficType(TrafficType trafficType) {
7880
this.trafficType = trafficType;
7981
}
8082

81-
public boolean isAdd() {
83+
public Boolean isAdd() {
8284
return add;
8385
}
8486

85-
public boolean isOneToOneNat() {
87+
public Boolean isOneToOneNat() {
8688
return this.oneToOneNat;
8789
}
8890

89-
public boolean isFirstIP() {
91+
public Boolean isFirstIP() {
9092
return firstIP;
9193
}
9294

93-
public void setSourceNat(boolean sourceNat) {
95+
public void setSourceNat(Boolean sourceNat) {
9496
this.sourceNat = sourceNat;
9597
}
9698

97-
public boolean isSourceNat() {
99+
public Boolean isSourceNat() {
98100
return sourceNat;
99101
}
100102

@@ -126,11 +128,11 @@ public void setNicDevId(Integer nicDevId) {
126128
this.nicDevId = nicDevId;
127129
}
128130

129-
public boolean isNewNic() {
131+
public Boolean isNewNic() {
130132
return newNic;
131133
}
132134

133-
public void setNewNic(boolean newNic) {
135+
public void setNewNic(Boolean newNic) {
134136
this.newNic = newNic;
135137
}
136138
}

0 commit comments

Comments
 (0)