You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/11/20 16:35:24 UTC
[37/51] [partial] Reformat all source code. Added checkstyle to check
the source code
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index ff63d08..73e5be2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -53,57 +53,58 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
- @Parameter(name = ApiConstants.IP_ADDRESS_ID, type = CommandType.UUID, entityType = IPAddressResponse.class,
- required = true,
- description = "the IP address id of the port forwarding rule")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID,
+ type = CommandType.UUID,
+ entityType = IPAddressResponse.class,
+ required = true,
+ description = "the IP address id of the port forwarding rule")
private Long ipAddressId;
- @Parameter(name = ApiConstants.PRIVATE_START_PORT, type = CommandType.INTEGER, required = true,
- description = "the starting port of port forwarding rule's private port range")
+ @Parameter(name = ApiConstants.PRIVATE_START_PORT, type = CommandType.INTEGER, required = true, description = "the starting port of port forwarding rule's private port range")
private Integer privateStartPort;
- @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, required = true,
- description = "the protocol for the port fowarding rule. Valid values are TCP or UDP.")
+ @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, required = true, description = "the protocol for the port fowarding rule. Valid values are TCP or UDP.")
private String protocol;
@Parameter(name = ApiConstants.PRIVATE_END_PORT, type = CommandType.INTEGER, required = false, description = "the ending port of port forwarding rule's private port range")
private Integer privateEndPort;
- @Parameter(name = ApiConstants.PUBLIC_START_PORT, type = CommandType.INTEGER, required = true,
- description = "the starting port of port forwarding rule's public port range")
+ @Parameter(name = ApiConstants.PUBLIC_START_PORT, type = CommandType.INTEGER, required = true, description = "the starting port of port forwarding rule's public port range")
private Integer publicStartPort;
@Parameter(name = ApiConstants.PUBLIC_END_PORT, type = CommandType.INTEGER, required = false, description = "the ending port of port forwarding rule's private port range")
private Integer publicEndPort;
- @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class,
- required = true,
- description = "the ID of the virtual machine for the port forwarding rule")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
+ type = CommandType.UUID,
+ entityType = UserVmResponse.class,
+ required = true,
+ description = "the ID of the virtual machine for the port forwarding rule")
private Long virtualMachineId;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING,
- description = "the cidr list to forward traffic from")
+ @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from")
private List<String> cidrlist;
- @Parameter(name = ApiConstants.OPEN_FIREWALL, type = CommandType.BOOLEAN,
- description = "if true, firewall rule for source/end pubic port is automatically created; " +
- "if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when PF" +
- " rule is being created for VPC guest network 2) in all other cases defaulted to true")
+ @Parameter(name = ApiConstants.OPEN_FIREWALL,
+ type = CommandType.BOOLEAN,
+ description = "if true, firewall rule for source/end pubic port is automatically created; "
+ + "if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when PF"
+ + " rule is being created for VPC guest network 2) in all other cases defaulted to true")
private Boolean openFirewall;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="The network of the vm the Port Forwarding rule will be created for. " +
- "Required when public Ip address is not associated with any Guest network yet (VPC case)")
+ @Parameter(name = ApiConstants.NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = NetworkResponse.class,
+ description = "The network of the vm the Port Forwarding rule will be created for. "
+ + "Required when public Ip address is not associated with any Guest network yet (VPC case)")
private Long networkId;
- @Parameter(name = ApiConstants.VM_GUEST_IP, type = CommandType.STRING, required = false,
- description = "VM guest nic Secondary ip address for the port forwarding rule")
+ @Parameter(name = ApiConstants.VM_GUEST_IP, type = CommandType.STRING, required = false, description = "VM guest nic Secondary ip address for the port forwarding rule")
private String vmSecondaryIp;
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
-
public Long getIpAddressId() {
return ipAddressId;
}
@@ -127,8 +128,8 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
public List<String> getSourceCidrList() {
if (cidrlist != null) {
- throw new InvalidParameterValueException("Parameter cidrList is deprecated; if you need to open firewall " +
- "rule for the specific cidr, please refer to createFirewallRule command");
+ throw new InvalidParameterValueException("Parameter cidrList is deprecated; if you need to open firewall "
+ + "rule for the specific cidr, please refer to createFirewallRule command");
}
return null;
}
@@ -169,7 +170,6 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
return s_name;
}
-
@Override
public void execute() throws ResourceUnavailableException {
CallContext callerContext = CallContext.current();
@@ -201,7 +201,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
try {
_rulesService.revokePortForwardingRule(getEntityId(), true);
- } catch (Exception ex){
+ } catch (Exception ex) {
//Ignore e.g. failed to apply rules to device error
}
@@ -221,7 +221,6 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
return null;
}
-
@Override
public String getUuid() {
// TODO Auto-generated method stub
@@ -240,7 +239,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public Integer getSourcePortEnd() {
- return (publicEndPort == null)? publicStartPort.intValue() : publicEndPort.intValue();
+ return (publicEndPort == null) ? publicStartPort.intValue() : publicEndPort.intValue();
}
@Override
@@ -265,7 +264,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
}
if (ntwkId == null) {
throw new InvalidParameterValueException("Unable to create port forwarding rule for the ipAddress id=" + ipAddressId +
- " as ip is not associated with any network and no networkId is passed in");
+ " as ip is not associated with any network and no networkId is passed in");
}
return ntwkId;
}
@@ -305,19 +304,20 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public int getDestinationPortEnd() {
- return (privateEndPort == null)? privateStartPort.intValue() : privateEndPort.intValue();
+ return (privateEndPort == null) ? privateStartPort.intValue() : privateEndPort.intValue();
}
@Override
public void create() {
// cidr list parameter is deprecated
if (cidrlist != null) {
- throw new InvalidParameterValueException("Parameter cidrList is deprecated; if you need to open firewall rule for the specific cidr, please refer to createFirewallRule command");
+ throw new InvalidParameterValueException(
+ "Parameter cidrList is deprecated; if you need to open firewall rule for the specific cidr, please refer to createFirewallRule command");
}
Ip privateIp = getVmSecondaryIp();
if (privateIp != null) {
- if ( !privateIp.isIp4()) {
+ if (!privateIp.isIp4()) {
throw new InvalidParameterValueException("Invalid vm ip address");
}
}
@@ -327,7 +327,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
setEntityId(result.getId());
setEntityUuid(result.getUuid());
} catch (NetworkRuleConflictException ex) {
- s_logger.info("Network rule conflict: " , ex);
+ s_logger.info("Network rule conflict: ", ex);
s_logger.trace("Network Rule Conflict: ", ex);
throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
index c3f1a94..5d23cc9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
@@ -38,7 +38,7 @@ import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
-@APICommand(name = "deleteEgressFirewallRule", description="Deletes an ggress firewall rule", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteEgressFirewallRule", description = "Deletes an ggress firewall rule", responseObject = SuccessResponse.class)
public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteEgressFirewallRuleCmd.class.getName());
private static final String s_name = "deleteegressfirewallruleresponse";
@@ -47,13 +47,13 @@ public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class, required=true, description="the ID of the firewall rule")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the firewall rule")
private Long id;
// unexposed parameter needed for events logging
- @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class, expose=false)
+ @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, expose = false)
private Long ownerId;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting egress firewall rule id=" + id);
+ return ("Deleting egress firewall rule id=" + id);
}
@Override
@@ -106,7 +106,6 @@ public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
}
}
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
index c04cae7..ab3298a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
@@ -35,7 +35,7 @@ import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
-@APICommand(name = "deleteFirewallRule", description="Deletes a firewall rule", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteFirewallRule", description = "Deletes a firewall rule", responseObject = SuccessResponse.class)
public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteFirewallRuleCmd.class.getName());
private static final String s_name = "deletefirewallruleresponse";
@@ -44,14 +44,13 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- required=true, description="the ID of the firewall rule")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the firewall rule")
private Long id;
// unexposed parameter needed for events logging
- @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class,
- expose=false)
+ @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, expose = false)
private Long ownerId;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -75,7 +74,7 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting firewall rule id=" + id);
+ return ("Deleting firewall rule id=" + id);
}
@Override
@@ -104,7 +103,6 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
}
}
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
index cbdd429..be1a8a3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
@@ -34,7 +34,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.rules.PortForwardingRule;
-@APICommand(name = "deletePortForwardingRule", description="Deletes a port forwarding rule", responseObject=SuccessResponse.class)
+@APICommand(name = "deletePortForwardingRule", description = "Deletes a port forwarding rule", responseObject = SuccessResponse.class)
public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName());
private static final String s_name = "deleteportforwardingruleresponse";
@@ -43,14 +43,13 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- required=true, description="the ID of the port forwarding rule")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the port forwarding rule")
private Long id;
// unexposed parameter needed for events logging
- @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class,
- expose=false)
+ @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, expose = false)
private Long ownerId;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -74,7 +73,7 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting port forwarding rule for id=" + id);
+ return ("Deleting port forwarding rule for id=" + id);
}
@Override
@@ -92,11 +91,11 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Rule Id: "+id);
+ public void execute() {
+ CallContext.current().setEventDetails("Rule Id: " + id);
//revoke corresponding firewall rule first
- boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
- result = result && _rulesService.revokePortForwardingRule(id, true);
+ boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
+ result = result && _rulesService.revokePortForwardingRule(id, true);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@@ -106,7 +105,6 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
}
}
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
index b5eed75..71e304a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
@@ -34,7 +34,7 @@ import org.apache.cloudstack.api.response.NetworkResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listEgressFirewallRules", description="Lists all egress firewall rules for network id.", responseObject=FirewallResponse.class)
+@APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network id.", responseObject = FirewallResponse.class)
public class ListEgressFirewallRulesCmd extends ListFirewallRulesCmd {
public static final Logger s_logger = Logger.getLogger(ListEgressFirewallRulesCmd.class.getName());
private static final String s_name = "listegressfirewallrulesresponse";
@@ -42,24 +42,24 @@ public class ListEgressFirewallRulesCmd extends ListFirewallRulesCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class, description="Lists rule with the specified ID.")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, description = "Lists rule with the specified ID.")
private Long id;
-
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class, description="the id network network for the egress firwall services")
+
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "the id network network for the egress firwall services")
private Long networkId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public Long getNetworkId() {
return networkId;
}
- public FirewallRule.TrafficType getTrafficType () {
+ public FirewallRule.TrafficType getTrafficType() {
return FirewallRule.TrafficType.Egress;
}
-
+
public Long getId() {
return id;
}
@@ -72,13 +72,13 @@ public class ListEgressFirewallRulesCmd extends ListFirewallRulesCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends FirewallRule>, Integer> result = _firewallService.listFirewallRules(this);
ListResponse<FirewallResponse> response = new ListResponse<FirewallResponse>();
List<FirewallResponse> fwResponses = new ArrayList<FirewallResponse>();
-
+
for (FirewallRule fwRule : result.first()) {
FirewallResponse ruleData = _responseGenerator.createFirewallResponse(fwRule);
ruleData.setObjectName("firewallrule");
@@ -86,6 +86,6 @@ public class ListEgressFirewallRulesCmd extends ListFirewallRulesCmd {
}
response.setResponses(fwResponses, result.second());
response.setResponseName(getCommandName());
- this.setResponseObject(response);
+ this.setResponseObject(response);
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
index ae1a2dd..bdfdd91 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
@@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listFirewallRules", description="Lists all firewall rules for an IP address.", responseObject=FirewallResponse.class)
+@APICommand(name = "listFirewallRules", description = "Lists all firewall rules for an IP address.", responseObject = FirewallResponse.class)
public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListFirewallRulesCmd.class.getName());
private static final String s_name = "listfirewallrulesresponse";
@@ -41,16 +41,13 @@ public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- description="Lists rule with the specified ID.")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, description = "Lists rule with the specified ID.")
private Long id;
- @Parameter(name=ApiConstants.IP_ADDRESS_ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- description="the id of IP address of the firwall services")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID, type = CommandType.UUID, entityType = IPAddressResponse.class, description = "the id of IP address of the firwall services")
private Long ipAddressId;
-
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="list firewall rules for ceratin network", since="4.3")
+
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "list firewall rules for ceratin network", since = "4.3")
private Long networkId;
/////////////////////////////////////////////////////
@@ -61,14 +58,14 @@ public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
return ipAddressId;
}
- public FirewallRule.TrafficType getTrafficType () {
- return FirewallRule.TrafficType.Ingress;
+ public FirewallRule.TrafficType getTrafficType() {
+ return FirewallRule.TrafficType.Ingress;
}
-
+
public Long getId() {
return id;
}
-
+
public Long getNetworkId() {
return networkId;
}
@@ -83,7 +80,7 @@ public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends FirewallRule>, Integer> result = _firewallService.listFirewallRules(this);
ListResponse<FirewallResponse> response = new ListResponse<FirewallResponse>();
List<FirewallResponse> fwResponses = new ArrayList<FirewallResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
index 7e96e0b..554ead6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
@@ -32,7 +32,7 @@ import org.apache.log4j.Logger;
import com.cloud.network.rules.PortForwardingRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listPortForwardingRules", description="Lists all port forwarding rules for an IP address.", responseObject=FirewallRuleResponse.class)
+@APICommand(name = "listPortForwardingRules", description = "Lists all port forwarding rules for an IP address.", responseObject = FirewallRuleResponse.class)
public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListPortForwardingRulesCmd.class.getName());
@@ -42,16 +42,20 @@ public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- description="Lists rule with the specified ID.")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, description = "Lists rule with the specified ID.")
private Long id;
- @Parameter(name=ApiConstants.IP_ADDRESS_ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- description="the id of IP address of the port forwarding services")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID,
+ type = CommandType.UUID,
+ entityType = IPAddressResponse.class,
+ description = "the id of IP address of the port forwarding services")
private Long ipAddressId;
-
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="list port forwarding rules for ceratin network", since="4.3")
+
+ @Parameter(name = ApiConstants.NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = NetworkResponse.class,
+ description = "list port forwarding rules for ceratin network",
+ since = "4.3")
private Long networkId;
/////////////////////////////////////////////////////
@@ -65,7 +69,7 @@ public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
public Long getId() {
return id;
}
-
+
public Long getNetworkId() {
return networkId;
}
@@ -80,7 +84,7 @@ public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends PortForwardingRule>, Integer> result = _rulesService.listPortForwardingRules(this);
ListResponse<FirewallRuleResponse> response = new ListResponse<FirewallRuleResponse>();
List<FirewallRuleResponse> fwResponses = new ArrayList<FirewallRuleResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 947c209..6ccf2ad 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -30,7 +30,9 @@ import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.IpAddress;
import com.cloud.user.Account;
-@APICommand(name = "updatePortForwardingRule", responseObject=FirewallRuleResponse.class, description="Updates a port forwarding rule. Only the private port and the virtual machine can be updated.")
+@APICommand(name = "updatePortForwardingRule",
+ responseObject = FirewallRuleResponse.class,
+ description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.")
public class UpdatePortForwardingRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(UpdatePortForwardingRuleCmd.class.getName());
private static final String s_name = "updateportforwardingruleresponse";
@@ -39,24 +41,29 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.PRIVATE_IP, type=CommandType.STRING, description="the private IP address of the port forwarding rule")
+ @Parameter(name = ApiConstants.PRIVATE_IP, type = CommandType.STRING, description = "the private IP address of the port forwarding rule")
private String privateIp;
- @Parameter(name=ApiConstants.PRIVATE_PORT, type=CommandType.STRING, required=true, description="the private port of the port forwarding rule")
+ @Parameter(name = ApiConstants.PRIVATE_PORT, type = CommandType.STRING, required = true, description = "the private port of the port forwarding rule")
private String privatePort;
- @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, required=true, description="the protocol for the port fowarding rule. Valid values are TCP or UDP.")
+ @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, required = true, description = "the protocol for the port fowarding rule. Valid values are TCP or UDP.")
private String protocol;
- @Parameter(name=ApiConstants.IP_ADDRESS_ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- required=true, description="the IP address id of the port forwarding rule")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID,
+ type = CommandType.UUID,
+ entityType = IPAddressResponse.class,
+ required = true,
+ description = "the IP address id of the port forwarding rule")
private Long publicIpId;
- @Parameter(name=ApiConstants.PUBLIC_PORT, type=CommandType.STRING, required=true, description="the public port of the port forwarding rule")
+ @Parameter(name = ApiConstants.PUBLIC_PORT, type = CommandType.STRING, required = true, description = "the public port of the port forwarding rule")
private String publicPort;
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- description="the ID of the virtual machine for the port forwarding rule")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
+ type = CommandType.UUID,
+ entityType = UserVmResponse.class,
+ description = "the ID of the virtual machine for the port forwarding rule")
private Long virtualMachineId;
/////////////////////////////////////////////////////
@@ -114,11 +121,11 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "updating port forwarding rule";
+ return "updating port forwarding rule";
}
@Override
- public void execute(){
+ public void execute() {
//FIXME: PortForwardingRule result = _mgr.updatePortForwardingRule(this);
// if (result != null) {
// FirewallRuleResponse response = _responseGenerator.createFirewallRuleResponse(result);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
index 19d2341..23d6cda 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
@@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import com.cloud.storage.GuestOsCategory;
import com.cloud.utils.Pair;
-@APICommand(name = "listOsCategories", description="Lists all supported OS categories for this cloud.", responseObject=GuestOSCategoryResponse.class)
+@APICommand(name = "listOsCategories", description = "Lists all supported OS categories for this cloud.", responseObject = GuestOSCategoryResponse.class)
public class ListGuestOsCategoriesCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
@@ -41,14 +41,12 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = GuestOSCategoryResponse.class,
- description="list Os category by id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = GuestOSCategoryResponse.class, description = "list Os category by id")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list os category by name", since="3.0.1")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "list os category by name", since = "3.0.1")
private String name;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -65,14 +63,13 @@ public class ListGuestOsCategoriesCmd extends BaseListCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
@Override
public String getCommandName() {
return s_name;
}
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends GuestOsCategory>, Integer> result = _mgr.listGuestOSCategoriesByCriteria(this);
ListResponse<GuestOSCategoryResponse> response = new ListResponse<GuestOSCategoryResponse>();
List<GuestOSCategoryResponse> osCatResponses = new ArrayList<GuestOSCategoryResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
index 1b050b8..27b7b85 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
@@ -32,7 +32,7 @@ import org.apache.log4j.Logger;
import com.cloud.storage.GuestOS;
import com.cloud.utils.Pair;
-@APICommand(name = "listOsTypes", description="Lists all supported OS types for this cloud.", responseObject=GuestOSResponse.class)
+@APICommand(name = "listOsTypes", description = "Lists all supported OS types for this cloud.", responseObject = GuestOSResponse.class)
public class ListGuestOsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
@@ -42,18 +42,15 @@ public class ListGuestOsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = GuestOSResponse.class,
- description="list by Os type Id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = GuestOSResponse.class, description = "list by Os type Id")
private Long id;
- @Parameter(name=ApiConstants.OS_CATEGORY_ID, type=CommandType.UUID, entityType = GuestOSCategoryResponse.class,
- description="list by Os Category id")
+ @Parameter(name = ApiConstants.OS_CATEGORY_ID, type = CommandType.UUID, entityType = GuestOSCategoryResponse.class, description = "list by Os Category id")
private Long osCategoryId;
- @Parameter(name=ApiConstants.DESCRIPTION, type=CommandType.STRING, description="list os by description", since="3.0.1")
+ @Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, description = "list os by description", since = "3.0.1")
private String description;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -80,7 +77,7 @@ public class ListGuestOsCmd extends BaseListCmd {
}
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends GuestOS>, Integer> result = _mgr.listGuestOSByCriteria(this);
ListResponse<GuestOSResponse> response = new ListResponse<GuestOSResponse>();
List<GuestOSResponse> osResponses = new ArrayList<GuestOSResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
index 11e4270..46488a0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
@@ -33,7 +33,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.uservm.UserVm;
-@APICommand(name = "attachIso", description="Attaches an ISO to a virtual machine.", responseObject=UserVmResponse.class)
+@APICommand(name = "attachIso", description = "Attaches an ISO to a virtual machine.", responseObject = UserVmResponse.class)
public class AttachIsoCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AttachIsoCmd.class.getName());
@@ -43,15 +43,12 @@ public class AttachIsoCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplateResponse.class,
- required=true, description="the ID of the ISO file")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "the ID of the ISO file")
private Long id;
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- required=true, description="the ID of the virtual machine")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "the ID of the virtual machine")
private Long virtualMachineId;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -64,7 +61,6 @@ public class AttachIsoCmd extends BaseAsyncCmd {
return virtualMachineId;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -91,12 +87,12 @@ public class AttachIsoCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "attaching ISO: " + getId() + " to vm: " + getVirtualMachineId();
+ return "attaching ISO: " + getId() + " to vm: " + getVirtualMachineId();
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Vm Id: " +getVirtualMachineId()+ " ISO Id: "+getId());
+ public void execute() {
+ CallContext.current().setEventDetails("Vm Id: " + getVirtualMachineId() + " ISO Id: " + getId());
boolean result = _templateService.attachIso(id, virtualMachineId);
if (result) {
UserVm userVm = _responseGenerator.findUserVmById(virtualMachineId);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
index 89aa71f..42e55d4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
@@ -21,9 +21,8 @@ import org.apache.cloudstack.api.command.user.template.CopyTemplateCmd;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
-@APICommand(name = "copyIso", description="Copies an iso from one zone to another.", responseObject=TemplateResponse.class)
+@APICommand(name = "copyIso", description = "Copies an iso from one zone to another.", responseObject = TemplateResponse.class)
public class CopyIsoCmd extends CopyTemplateCmd {
public static final Logger s_logger = Logger.getLogger(CopyIsoCmd.class.getName());
private static final String s_name = "copyisoresponse";
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
index a7ec9f6..df5e624 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
@@ -34,7 +34,7 @@ import com.cloud.event.EventTypes;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
-@APICommand(name = "deleteIso", description="Deletes an ISO file.", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteIso", description = "Deletes an ISO file.", responseObject = SuccessResponse.class)
public class DeleteIsoCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteIsoCmd.class.getName());
private static final String s_name = "deleteisosresponse";
@@ -43,15 +43,15 @@ public class DeleteIsoCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplateResponse.class,
- required=true, description="the ID of the ISO file")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "the ID of the ISO file")
private Long id;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ description = "the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones")
private Long zoneId;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -106,8 +106,8 @@ public class DeleteIsoCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("ISO Id: "+getId());
+ public void execute() {
+ CallContext.current().setEventDetails("ISO Id: " + getId());
boolean result = _templateService.deleteIso(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
index c04fba5..ce50b0f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
@@ -31,7 +31,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.uservm.UserVm;
-@APICommand(name = "detachIso", description="Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject=UserVmResponse.class)
+@APICommand(name = "detachIso", description = "Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject = UserVmResponse.class)
public class DetachIsoCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DetachIsoCmd.class.getName());
@@ -41,8 +41,7 @@ public class DetachIsoCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- required=true, description="The ID of the virtual machine")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "The ID of the virtual machine")
private Long virtualMachineId;
/////////////////////////////////////////////////////
@@ -79,11 +78,11 @@ public class DetachIsoCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "detaching ISO from vm: " + getVirtualMachineId();
+ return "detaching ISO from vm: " + getVirtualMachineId();
}
@Override
- public void execute(){
+ public void execute() {
boolean result = _templateService.detachIso(virtualMachineId);
if (result) {
UserVm userVm = _entityMgr.findById(UserVm.class, virtualMachineId);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
index 5378ceb..90744c2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
@@ -36,7 +36,7 @@ import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
-@APICommand(name = "extractIso", description="Extracts an ISO", responseObject=ExtractResponse.class)
+@APICommand(name = "extractIso", description = "Extracts an ISO", responseObject = ExtractResponse.class)
public class ExtractIsoCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ExtractIsoCmd.class.getName());
@@ -46,18 +46,20 @@ public class ExtractIsoCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplateResponse.class,
- required=true, description="the ID of the ISO file")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "the ID of the ISO file")
private Long id;
- @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the url to which the ISO would be extracted")
+ @Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = false, description = "the url to which the ISO would be extracted")
private String url;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- required=false, description="the ID of the zone where the ISO is originally located")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ required = false,
+ description = "the ID of the zone where the ISO is originally located")
private Long zoneId;
- @Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")
+ @Parameter(name = ApiConstants.MODE, type = CommandType.STRING, required = true, description = "the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")
private String mode;
/////////////////////////////////////////////////////
@@ -79,6 +81,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd {
public String getMode() {
return mode;
}
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -106,7 +109,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "extracting iso: " + getId() + " from zone: " + getZoneId();
+ return "extracting iso: " + getId() + " from zone: " + getZoneId();
}
public static String getStaticName() {
@@ -122,7 +125,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
+ public void execute() {
try {
CallContext.current().setEventDetails(getEventDescription());
String uploadUrl = _templateService.extract(this);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
index faa4f60..1e91640 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
@@ -24,7 +24,9 @@ import org.apache.log4j.Logger;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
-@APICommand(name="listIsoPermissions", description="List iso visibility and all accounts that have permissions to view this iso.", responseObject=TemplatePermissionsResponse.class)
+@APICommand(name = "listIsoPermissions",
+ description = "List iso visibility and all accounts that have permissions to view this iso.",
+ responseObject = TemplatePermissionsResponse.class)
public class ListIsoPermissionsCmd extends BaseListTemplateOrIsoPermissionsCmd {
protected String getResponseName() {
return "listisopermissionsresponse";
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
index c3f558b..4e55500 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
@@ -36,7 +36,7 @@ import com.cloud.template.VirtualMachineTemplate.TemplateFilter;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
-@APICommand(name = "listIsos", description="Lists all available ISO files.", responseObject=TemplateResponse.class)
+@APICommand(name = "listIsos", description = "Lists all available ISO files.", responseObject = TemplateResponse.class)
public class ListIsosCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListIsosCmd.class.getName());
@@ -46,44 +46,42 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.BOOTABLE, type=CommandType.BOOLEAN, description="true if the ISO is bootable, false otherwise")
+ @Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "true if the ISO is bootable, false otherwise")
private Boolean bootable;
- @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor for which to restrict the search")
+ @Parameter(name = ApiConstants.HYPERVISOR, type = CommandType.STRING, description = "the hypervisor for which to restrict the search")
private String hypervisor;
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplateResponse.class,
- description="list ISO by id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, description = "list ISO by id")
private Long id;
- @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if the ISO is publicly available to all users, false otherwise.")
+ @Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "true if the ISO is publicly available to all users, false otherwise.")
private Boolean publicIso;
- @Parameter(name=ApiConstants.IS_READY, type=CommandType.BOOLEAN, description="true if this ISO is ready to be deployed")
+ @Parameter(name = ApiConstants.IS_READY, type = CommandType.BOOLEAN, description = "true if this ISO is ready to be deployed")
private Boolean ready;
- @Parameter(name=ApiConstants.ISO_FILTER, type=CommandType.STRING, description="possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". " +
- "* featured : templates that have been marked as featured and public. " +
- "* self : templates that have been registered or created by the calling user. " +
- "* selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. " +
- "* sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. " +
- "* executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. " +
- "* community : templates that have been marked as public but not featured. " +
- "* all : all templates (only usable by admins).")
+ @Parameter(name = ApiConstants.ISO_FILTER,
+ type = CommandType.STRING,
+ description = "possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". "
+ + "* featured : templates that have been marked as featured and public. "
+ + "* self : templates that have been registered or created by the calling user. "
+ + "* selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. "
+ + "* sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. "
+ + "* executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. "
+ + "* community : templates that have been marked as public but not featured. " + "* all : all templates (only usable by admins).")
private String isoFilter = TemplateFilter.selfexecutable.toString();
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list all isos by name")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "list all isos by name")
private String isoName;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="the ID of the zone")
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "the ID of the zone")
private Long zoneId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
public Boolean isBootable() {
return bootable;
}
@@ -122,8 +120,9 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd {
boolean isAccountSpecific = (account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
// Show only those that are downloaded.
TemplateFilter templateFilter = TemplateFilter.valueOf(getIsoFilter());
- boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)
- || (templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);
+ boolean onlyReady = (templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) ||
+ (templateFilter == TemplateFilter.sharedexecutable) || (templateFilter == TemplateFilter.executable && isAccountSpecific) ||
+ (templateFilter == TemplateFilter.community);
if (!onlyReady) {
if (isReady() != null && isReady().booleanValue() != onlyReady) {
@@ -148,7 +147,7 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
ListResponse<TemplateResponse> response = _queryService.listIsos(this);
response.setResponseName(getCommandName());
this.setResponseObject(response);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
index 84f6980..a2b8a6e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
@@ -37,7 +37,7 @@ import org.apache.log4j.Logger;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.template.VirtualMachineTemplate;
-@APICommand(name = "registerIso", responseObject=TemplateResponse.class, description="Registers an existing ISO into the CloudStack Cloud.")
+@APICommand(name = "registerIso", responseObject = TemplateResponse.class, description = "Registers an existing ISO into the CloudStack Cloud.")
public class RegisterIsoCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(RegisterIsoCmd.class.getName());
@@ -47,54 +47,67 @@ public class RegisterIsoCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.BOOTABLE, type=CommandType.BOOLEAN, description="true if this ISO is bootable. If not passed explicitly its assumed to be true")
+ @Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "true if this ISO is bootable. If not passed explicitly its assumed to be true")
private Boolean bootable;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the ISO. This is usually used for display purposes.", length=4096)
+ @Parameter(name = ApiConstants.DISPLAY_TEXT,
+ type = CommandType.STRING,
+ required = true,
+ description = "the display text of the ISO. This is usually used for display purposes.",
+ length = 4096)
private String displayText;
- @Parameter(name=ApiConstants.IS_FEATURED, type=CommandType.BOOLEAN, description="true if you want this ISO to be featured")
+ @Parameter(name = ApiConstants.IS_FEATURED, type = CommandType.BOOLEAN, description = "true if you want this ISO to be featured")
private Boolean featured;
- @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if you want to register the ISO to be publicly available to all users, false otherwise.")
+ @Parameter(name = ApiConstants.IS_PUBLIC,
+ type = CommandType.BOOLEAN,
+ description = "true if you want to register the ISO to be publicly available to all users, false otherwise.")
private Boolean publicIso;
- @Parameter(name=ApiConstants.IS_EXTRACTABLE, type=CommandType.BOOLEAN, description="true if the iso or its derivatives are extractable; default is false")
+ @Parameter(name = ApiConstants.IS_EXTRACTABLE, type = CommandType.BOOLEAN, description = "true if the iso or its derivatives are extractable; default is false")
private Boolean extractable;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the ISO")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the ISO")
private String isoName;
- @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.UUID, entityType = GuestOSResponse.class,
- description="the ID of the OS Type that best represents the OS of this ISO. If the iso is bootable this parameter needs to be passed")
+ @Parameter(name = ApiConstants.OS_TYPE_ID,
+ type = CommandType.UUID,
+ entityType = GuestOSResponse.class,
+ description = "the ID of the OS Type that best represents the OS of this ISO. If the iso is bootable this parameter needs to be passed")
private Long osTypeId;
- @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL to where the ISO is currently being hosted")
+ @Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "the URL to where the ISO is currently being hosted")
private String url;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- required=true, description="the ID of the zone you wish to register the ISO to.")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ required = true,
+ description = "the ID of the zone you wish to register the ISO to.")
private Long zoneId;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
- description="an optional domainId. If the account parameter is used, domainId must also be used.")
+ @Parameter(name = ApiConstants.DOMAIN_ID,
+ type = CommandType.UUID,
+ entityType = DomainResponse.class,
+ description = "an optional domainId. If the account parameter is used, domainId must also be used.")
private Long domainId;
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account name. Must be used with domainId.")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account name. Must be used with domainId.")
private String accountName;
- @Parameter(name=ApiConstants.CHECKSUM, type=CommandType.STRING, description="the MD5 checksum value of this ISO")
+ @Parameter(name = ApiConstants.CHECKSUM, type = CommandType.STRING, description = "the MD5 checksum value of this ISO")
private String checksum;
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- description="Register iso for the project")
+ @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Register iso for the project")
private Long projectId;
- @Parameter(name=ApiConstants.IMAGE_STORE_UUID, type=CommandType.STRING,
- description="Image store uuid")
+ @Parameter(name = ApiConstants.IMAGE_STORE_UUID, type = CommandType.STRING, description = "Image store uuid")
private String imageStoreUuid;
- @Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE, type = CommandType.BOOLEAN, description = "true if iso contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
+ @Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE,
+ type = CommandType.BOOLEAN,
+ description = "true if iso contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
protected Boolean isDynamicallyScalable;
/////////////////////////////////////////////////////
@@ -154,7 +167,7 @@ public class RegisterIsoCmd extends BaseCmd {
}
public Boolean isDynamicallyScalable() {
- return isDynamicallyScalable == null ? false : isDynamicallyScalable;
+ return isDynamicallyScalable == null ? false : isDynamicallyScalable;
}
/////////////////////////////////////////////////////
@@ -177,7 +190,7 @@ public class RegisterIsoCmd extends BaseCmd {
}
@Override
- public void execute() throws ResourceAllocationException{
+ public void execute() throws ResourceAllocationException {
VirtualMachineTemplate template = _templateService.registerIso(this);
if (template != null) {
ListResponse<TemplateResponse> response = new ListResponse<TemplateResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
index 1d84847..64183ed 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
@@ -26,7 +26,7 @@ import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
-@APICommand(name = "updateIso", description="Updates an ISO file.", responseObject=TemplateResponse.class)
+@APICommand(name = "updateIso", description = "Updates an ISO file.", responseObject = TemplateResponse.class)
public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());
private static final String s_name = "updateisoresponse";
@@ -65,7 +65,7 @@ public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
}
@Override
- public void execute(){
+ public void execute() {
VirtualMachineTemplate result = _templateService.updateTemplate(this);
if (result != null) {
TemplateResponse response = _responseGenerator.createTemplateUpdateResponse(result);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
index 5e884df..e6d5ca7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
@@ -24,7 +24,7 @@ import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
-@APICommand(name = "updateIsoPermissions", description="Updates iso permissions", responseObject=SuccessResponse.class)
+@APICommand(name = "updateIsoPermissions", description = "Updates iso permissions", responseObject = SuccessResponse.class)
public class UpdateIsoPermissionsCmd extends BaseUpdateTemplateOrIsoPermissionsCmd {
protected String getResponseName() {
return "updateisopermissionsresponse";
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java b/api/src/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java
index 8506218..9d45d50 100644
--- a/api/src/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java
@@ -25,7 +25,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AsyncJobResponse;
import org.apache.cloudstack.api.response.ListResponse;
-@APICommand(name = "listAsyncJobs", description="Lists all pending asynchronous jobs for the account.", responseObject=AsyncJobResponse.class)
+@APICommand(name = "listAsyncJobs", description = "Lists all pending asynchronous jobs for the account.", responseObject = AsyncJobResponse.class)
public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
private static final String s_name = "listasyncjobsresponse";
@@ -33,10 +33,9 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.START_DATE, type=CommandType.TZDATE, description="the start date of the async job")
+ @Parameter(name = ApiConstants.START_DATE, type = CommandType.TZDATE, description = "the start date of the async job")
private Date startDate;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -54,7 +53,7 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
ListResponse<AsyncJobResponse> response = _queryService.searchForAsyncJobs(this);
response.setResponseName(getCommandName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
index 5d2ef68..a24ba66 100644
--- a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
@@ -25,7 +25,7 @@ import org.apache.log4j.Logger;
import com.cloud.user.Account;
-@APICommand(name = "queryAsyncJobResult", description="Retrieves the current status of asynchronous job.", responseObject=AsyncJobResponse.class)
+@APICommand(name = "queryAsyncJobResult", description = "Retrieves the current status of asynchronous job.", responseObject = AsyncJobResponse.class)
public class QueryAsyncJobResultCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(QueryAsyncJobResultCmd.class.getName());
@@ -35,8 +35,7 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.JOB_ID, type=CommandType.UUID, entityType=AsyncJobResponse.class,
- required=true, description="the ID of the asychronous job")
+ @Parameter(name = ApiConstants.JOB_ID, type = CommandType.UUID, entityType = AsyncJobResponse.class, required = true, description = "the ID of the asychronous job")
private Long id;
/////////////////////////////////////////////////////
@@ -62,7 +61,7 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
}
@Override
- public void execute(){
+ public void execute() {
AsyncJobResponse response = _responseGenerator.queryJobResult(this);
response.setResponseName(getCommandName());
this.setResponseObject(response);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
index 253c015..fa8b6fb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java
@@ -29,25 +29,21 @@ import org.apache.log4j.Logger;
@APICommand(name = "assignCertToLoadBalancer", description = "Assigns a certificate to a Load Balancer Rule", responseObject = SuccessResponse.class)
public class AssignCertToLoadBalancerCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger
- .getLogger(AssignCertToLoadBalancerCmd.class.getName());
+ public static final Logger s_logger = Logger.getLogger(AssignCertToLoadBalancerCmd.class.getName());
private static final String s_name = "assignCertToLoadBalancer";
-
- @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class,
- required = true, description = "the ID of the load balancer rule")
+ @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the load balancer rule")
Long lbRuleId;
- @Parameter(name = ApiConstants.CERTIFICATE_ID, type = CommandType.UUID, entityType = SslCertResponse.class,
- required = true, description = "the ID of the certificate")
+ @Parameter(name = ApiConstants.CERTIFICATE_ID, type = CommandType.UUID, entityType = SslCertResponse.class, required = true, description = "the ID of the certificate")
Long certId;
-
@Override
- public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException,
+ NetworkRuleConflictException {
//To change body of implemented methods use File | Settings | File Templates.
- if ( _lbService.assignCertToLoadBalancer( getLbRuleId(), getCertId()) ) {
+ if (_lbService.assignCertToLoadBalancer(getLbRuleId(), getCertId())) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
@@ -70,9 +66,8 @@ public class AssignCertToLoadBalancerCmd extends BaseAsyncCmd {
return "Assigining a certificate to a loadbalancer";
}
-
@Override
- public long getEntityOwnerId() {
+ public long getEntityOwnerId() {
LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLbRuleId());
if (lb == null) {
return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked
@@ -80,13 +75,11 @@ public class AssignCertToLoadBalancerCmd extends BaseAsyncCmd {
return lb.getAccountId();
}
-
-
- public Long getCertId(){
+ public Long getCertId() {
return certId;
}
- public Long getLbRuleId(){
+ public Long getLbRuleId() {
return lbRuleId;
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
index b94777e..3db326f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
@@ -37,7 +37,9 @@ import com.cloud.network.rules.LoadBalancer;
import com.cloud.user.Account;
import com.cloud.utils.StringUtils;
-@APICommand(name = "assignToLoadBalancerRule", description="Assigns virtual machine or a list of virtual machines to a load balancer rule.", responseObject=SuccessResponse.class)
+@APICommand(name = "assignToLoadBalancerRule",
+ description = "Assigns virtual machine or a list of virtual machines to a load balancer rule.",
+ responseObject = SuccessResponse.class)
public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
@@ -47,12 +49,15 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- required=true, description="the ID of the load balancer rule")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the load balancer rule")
private Long id;
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType = UserVmResponse.class,
- required=true, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_IDS,
+ type = CommandType.LIST,
+ collectionType = CommandType.UUID,
+ entityType = UserVmResponse.class,
+ required = true,
+ description = "the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)")
private List<Long> virtualMachineIds;
/////////////////////////////////////////////////////
@@ -96,8 +101,8 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Load balancer Id: "+getLoadBalancerId()+" VmIds: "+StringUtils.join(getVirtualMachineIds(), ","));
+ public void execute() {
+ CallContext.current().setEventDetails("Load balancer Id: " + getLoadBalancerId() + " VmIds: " + StringUtils.join(getVirtualMachineIds(), ","));
boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@@ -115,7 +120,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
@Override
public Long getSyncObjId() {
LoadBalancer lb = _lbService.findById(id);
- if(lb == null){
+ if (lb == null) {
throw new InvalidParameterValueException("Unable to find load balancer rule: " + id);
}
return lb.getNetworkId();