Merge pull request #810 from ashwinswaroop/feature_x

This is the fix for the JIRA issue CLOUDSTACK-8817.This is my first contribution to Apache CloudStack. The return values for endpoint and startpoint have now been changed to Integer instead of String. Please let me know if this is the only change that is required or if there are additional files which will be impacted by this change which require modification also.

* pr/810:
  CLOUDSTACK-8817: listFirewallRules response JSON startport/endport not an int
  This is the fix for the JIRA issue CLOUDSTACK-8817. The return values for endpoint and startpoint are now Integer instead of String.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
This commit is contained in:
Wido den Hollander 2015-09-13 22:24:00 +02:00
commit 120e1cc934
2 changed files with 6 additions and 6 deletions

View File

@ -37,11 +37,11 @@ public class FirewallResponse extends BaseResponse {
@SerializedName(ApiConstants.START_PORT)
@Param(description = "the starting port of firewall rule's port range")
private String startPort;
private Integer startPort;
@SerializedName(ApiConstants.END_PORT)
@Param(description = "the ending port of firewall rule's port range")
private String endPort;
private Integer endPort;
@SerializedName(ApiConstants.IP_ADDRESS_ID)
@Param(description = "the public ip address id for the firewall rule")
@ -87,11 +87,11 @@ public class FirewallResponse extends BaseResponse {
this.protocol = protocol;
}
public void setStartPort(String startPort) {
public void setStartPort(Integer startPort) {
this.startPort = startPort;
}
public void setEndPort(String endPort) {
public void setEndPort(Integer endPort) {
this.endPort = endPort;
}

View File

@ -2124,11 +2124,11 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setId(fwRule.getUuid());
response.setProtocol(fwRule.getProtocol());
if (fwRule.getSourcePortStart() != null) {
response.setStartPort(Integer.toString(fwRule.getSourcePortStart()));
response.setStartPort(fwRule.getSourcePortStart());
}
if (fwRule.getSourcePortEnd() != null) {
response.setEndPort(Integer.toString(fwRule.getSourcePortEnd()));
response.setEndPort(fwRule.getSourcePortEnd());
}
List<String> cidrs = ApiDBUtils.findFirewallSourceCidrs(fwRule.getId());