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:22 UTC
[35/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/nat/EnableStaticNatCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
index 2e2e150..1b91173 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
@@ -35,8 +35,8 @@ import com.cloud.network.IpAddress;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
-@APICommand(name = "enableStaticNat", description="Enables static nat for given ip address", responseObject=SuccessResponse.class)
-public class EnableStaticNatCmd extends BaseCmd{
+@APICommand(name = "enableStaticNat", description = "Enables static nat for given ip address", responseObject = SuccessResponse.class)
+public class EnableStaticNatCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(CreateIpForwardingRuleCmd.class.getName());
private static final String s_name = "enablestaticnatresponse";
@@ -45,22 +45,27 @@ public class EnableStaticNatCmd extends BaseCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.IP_ADDRESS_ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- required=true, description="the public IP " +
- "address id for which static nat feature is being enabled")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID,
+ type = CommandType.UUID,
+ entityType = IPAddressResponse.class,
+ required = true,
+ description = "the public IP " + "address id for which static nat feature is being enabled")
private Long ipAddressId;
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- required=true, description="the ID of " +
- "the virtual machine for enabling static nat feature")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
+ type = CommandType.UUID,
+ entityType = UserVmResponse.class,
+ required = true,
+ description = "the ID of " + "the virtual machine for enabling static nat feature")
private Long virtualMachineId;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="The network of the vm the static nat will be enabled 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 static nat will be enabled 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;
/////////////////////////////////////////////////////
@@ -93,13 +98,13 @@ public class EnableStaticNatCmd extends BaseCmd{
}
// in case of portable public IP, network ID passed takes precedence
- if (ip.isPortable() && networkId != null ) {
+ if (ip.isPortable() && networkId != null) {
ntwkId = networkId;
}
if (ntwkId == null) {
throw new InvalidParameterValueException("Unable to enable static nat 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;
}
@@ -124,7 +129,7 @@ public class EnableStaticNatCmd extends BaseCmd{
}
@Override
- public void execute() throws ResourceUnavailableException{
+ public void execute() throws ResourceUnavailableException {
try {
boolean result = _rulesService.enableStaticNat(ipAddressId, virtualMachineId, getNetworkId(), getVmSecondaryIp());
if (result) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
index 776639b..08d45f7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
@@ -34,7 +34,7 @@ import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.StaticNatRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listIpForwardingRules", description="List the ip forwarding rules", responseObject=FirewallRuleResponse.class)
+@APICommand(name = "listIpForwardingRules", description = "List the ip forwarding rules", responseObject = FirewallRuleResponse.class)
public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListIpForwardingRulesCmd.class.getName());
@@ -44,23 +44,19 @@ public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResources
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.IP_ADDRESS_ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- description="list the rule belonging to this public ip address")
+ @Parameter(name = ApiConstants.IP_ADDRESS_ID, type = CommandType.UUID, entityType = IPAddressResponse.class, description = "list the rule belonging to this public ip address")
private Long publicIpAddressId;
- @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.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- description="Lists all rules applied to the specified Vm.")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, description = "Lists all rules applied to the specified Vm.")
private Long vmId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -82,9 +78,9 @@ public class ListIpForwardingRulesCmd extends BaseListProjectAndAccountResources
}
@Override
- public void execute(){
- Pair<List<? extends FirewallRule>, Integer> result = _rulesService.searchStaticNatRules(publicIpAddressId, id, vmId,
- this.getStartIndex(), this.getPageSizeVal(), this.getAccountName(), this.getDomainId(), this.getProjectId(), this.isRecursive(), this.listAll());
+ public void execute() {
+ Pair<List<? extends FirewallRule>, Integer> result = _rulesService.searchStaticNatRules(publicIpAddressId, id, vmId, this.getStartIndex(), this.getPageSizeVal(),
+ this.getAccountName(), this.getDomainId(), this.getProjectId(), this.isRecursive(), this.listAll());
ListResponse<IpForwardingRuleResponse> response = new ListResponse<IpForwardingRuleResponse>();
List<IpForwardingRuleResponse> ipForwardingResponses = new ArrayList<IpForwardingRuleResponse>();
for (FirewallRule rule : result.first()) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
index b0a8555..8d2aa25 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
@@ -40,8 +40,7 @@ import com.cloud.network.vpc.NetworkACLItem;
import com.cloud.user.Account;
import com.cloud.utils.net.NetUtils;
-@APICommand(name = "createNetworkACL", description = "Creates a ACL rule in the given network (the network has to belong to VPC)",
-responseObject = NetworkACLItemResponse.class)
+@APICommand(name = "createNetworkACL", description = "Creates a ACL rule in the given network (the network has to belong to VPC)", responseObject = NetworkACLItemResponse.class)
public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreateNetworkACLCmd.class.getName());
@@ -51,8 +50,10 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
- @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, required = true, description =
- "the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number")
+ @Parameter(name = ApiConstants.PROTOCOL,
+ type = CommandType.STRING,
+ required = true,
+ description = "the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number")
private String protocol;
@Parameter(name = ApiConstants.START_PORT, type = CommandType.INTEGER, description = "the starting port of ACL")
@@ -61,8 +62,7 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "the ending port of ACL")
private Integer publicEndPort;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING,
- description = "the cidr list to allow traffic from/to")
+ @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to allow traffic from/to")
private List<String> cidrlist;
@Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the icmp message being sent")
@@ -71,22 +71,20 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.ICMP_CODE, type = CommandType.INTEGER, description = "error code for this icmp message")
private Integer icmpCode;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="The network of the vm the ACL will be created for")
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "The network of the vm the ACL will be created for")
private Long networkId;
- @Parameter(name=ApiConstants.ACL_ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- description="The network of the vm the ACL will be created for")
+ @Parameter(name = ApiConstants.ACL_ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, description = "The network of the vm the ACL will be created for")
private Long aclId;
- @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="the traffic type for the ACL," +
- "can be Ingress or Egress, defaulted to Ingress if not specified")
+ @Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "the traffic type for the ACL,"
+ + "can be Ingress or Egress, defaulted to Ingress if not specified")
private String trafficType;
- @Parameter(name=ApiConstants.NUMBER, type=CommandType.INTEGER, description="The network of the vm the ACL will be created for")
+ @Parameter(name = ApiConstants.NUMBER, type = CommandType.INTEGER, description = "The network of the vm the ACL will be created for")
private Integer number;
- @Parameter(name=ApiConstants.ACTION, type=CommandType.STRING, description="scl entry action, allow or deny")
+ @Parameter(name = ApiConstants.ACTION, type = CommandType.STRING, description = "scl entry action, allow or deny")
private String action;
// ///////////////////////////////////////////////////
@@ -94,15 +92,15 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
// ///////////////////////////////////////////////////
public String getProtocol() {
- String p = protocol.trim();
- // Deal with ICMP(protocol number 1) specially because it need to be paired with icmp type and code
- if(StringUtils.isNumeric(p)){
+ String p = protocol.trim();
+ // Deal with ICMP(protocol number 1) specially because it need to be paired with icmp type and code
+ if (StringUtils.isNumeric(p)) {
int protoNumber = Integer.parseInt(p);
if (protoNumber == 1) {
- p = "icmp";
+ p = "icmp";
}
- }
- return p;
+ }
+ return p;
}
public List<String> getSourceCidrList() {
@@ -193,7 +191,7 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
if (icmpType != null) {
return icmpType;
} else if (getProtocol().equalsIgnoreCase(NetUtils.ICMP_PROTO)) {
- return -1;
+ return -1;
}
return null;
@@ -235,4 +233,3 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
index 52a4281..cd0eb32 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java
@@ -34,8 +34,7 @@ import com.cloud.network.vpc.NetworkACL;
import com.cloud.network.vpc.Vpc;
import com.cloud.user.Account;
-@APICommand(name = "createNetworkACLList", description = "Creates a Network ACL for the given VPC",
-responseObject = NetworkACLResponse.class)
+@APICommand(name = "createNetworkACLList", description = "Creates a Network ACL for the given VPC", responseObject = NetworkACLResponse.class)
public class CreateNetworkACLListCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreateNetworkACLListCmd.class.getName());
@@ -51,7 +50,11 @@ public class CreateNetworkACLListCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, description = "Description of the network ACL List")
private String description;
- @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, required = true, entityType = VpcResponse.class, description = "Id of the VPC associated with this network ACL List")
+ @Parameter(name = ApiConstants.VPC_ID,
+ type = CommandType.UUID,
+ required = true,
+ entityType = VpcResponse.class,
+ description = "Id of the VPC associated with this network ACL List")
private Long vpcId;
// ///////////////////////////////////////////////////
@@ -89,7 +92,7 @@ public class CreateNetworkACLListCmd extends BaseAsyncCreateCmd {
@Override
public void execute() throws ResourceUnavailableException {
NetworkACL acl = _networkACLService.getNetworkACL(getEntityId());
- if(acl != null){
+ if (acl != null) {
NetworkACLResponse aclResponse = _responseGenerator.createNetworkACLResponse(acl);
setResponseObject(aclResponse);
aclResponse.setResponseName(getCommandName());
@@ -116,6 +119,6 @@ public class CreateNetworkACLListCmd extends BaseAsyncCreateCmd {
@Override
public String getEventDescription() {
- return "Creating Network ACL with id: "+getEntityUuid();
+ return "Creating Network ACL with id: " + getEntityUuid();
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
index 5ce0000..3760337 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
@@ -42,7 +42,7 @@ import com.cloud.network.Network;
import com.cloud.network.Network.GuestType;
import com.cloud.offering.NetworkOffering;
-@APICommand(name = "createNetwork", description="Creates a network", responseObject=NetworkResponse.class)
+@APICommand(name = "createNetwork", description = "Creates a network", responseObject = NetworkResponse.class)
public class CreateNetworkCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(CreateNetworkCmd.class.getName());
@@ -52,91 +52,95 @@ public class CreateNetworkCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the network")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the network")
private String name;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the network")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "the display text of the network")
private String displayText;
- @Parameter(name=ApiConstants.NETWORK_OFFERING_ID, type=CommandType.UUID, entityType = NetworkOfferingResponse.class,
- required=true, description="the network offering id")
+ @Parameter(name = ApiConstants.NETWORK_OFFERING_ID,
+ type = CommandType.UUID,
+ entityType = NetworkOfferingResponse.class,
+ required = true,
+ description = "the network offering id")
private Long networkOfferingId;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- required=true, description="the Zone ID for the network")
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "the Zone ID for the network")
private Long zoneId;
- @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
- description="the Physical Network ID the network belongs to")
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = PhysicalNetworkResponse.class,
+ description = "the Physical Network ID the network belongs to")
private Long physicalNetworkId;
- @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, description="the gateway of the network. Required " +
- "for Shared networks and Isolated networks when it belongs to VPC")
+ @Parameter(name = ApiConstants.GATEWAY, type = CommandType.STRING, description = "the gateway of the network. Required "
+ + "for Shared networks and Isolated networks when it belongs to VPC")
private String gateway;
- @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, description="the netmask of the network. Required " +
- "for Shared networks and Isolated networks when it belongs to VPC")
+ @Parameter(name = ApiConstants.NETMASK, type = CommandType.STRING, description = "the netmask of the network. Required "
+ + "for Shared networks and Isolated networks when it belongs to VPC")
private String netmask;
- @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, description="the beginning IP address in the network IP range")
+ @Parameter(name = ApiConstants.START_IP, type = CommandType.STRING, description = "the beginning IP address in the network IP range")
private String startIp;
- @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address in the network IP" +
- " range. If not specified, will be defaulted to startIP")
+ @Parameter(name = ApiConstants.END_IP, type = CommandType.STRING, description = "the ending IP address in the network IP"
+ + " range. If not specified, will be defaulted to startIP")
private String endIp;
- @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the ID or VID of the network")
+ @Parameter(name = ApiConstants.VLAN, type = CommandType.STRING, description = "the ID or VID of the network")
private String vlan;
- @Parameter(name=ApiConstants.ISOLATED_PVLAN, type=CommandType.STRING, description="the isolated private vlan for this network")
+ @Parameter(name = ApiConstants.ISOLATED_PVLAN, type = CommandType.STRING, description = "the isolated private vlan for this network")
private String isolatedPvlan;
- @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="network domain")
+ @Parameter(name = ApiConstants.NETWORK_DOMAIN, type = CommandType.STRING, description = "network domain")
private String networkDomain;
- @Parameter(name=ApiConstants.ACL_TYPE, type=CommandType.STRING, description="Access control type; supported values" +
- " are account and domain. In 3.0 all shared networks should have aclType=Domain, and all Isolated networks" +
- " - Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network")
+ @Parameter(name = ApiConstants.ACL_TYPE,
+ type = CommandType.STRING,
+ description = "Access control type; supported values" + " are account and domain. In 3.0 all shared networks should have aclType=Domain, and all Isolated networks"
+ + " - Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network")
private String aclType;
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the network")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "account who will own the network")
private String accountName;
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- description="an optional project for the ssh key")
+ @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the ssh key")
private Long projectId;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
- description="domain ID of the account owning a network")
+ @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "domain ID of the account owning a network")
private Long domainId;
- @Parameter(name=ApiConstants.SUBDOMAIN_ACCESS, type=CommandType.BOOLEAN, description="Defines whether to allow" +
- " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
+ @Parameter(name = ApiConstants.SUBDOMAIN_ACCESS,
+ type = CommandType.BOOLEAN,
+ description = "Defines whether to allow"
+ + " subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified")
private Boolean subdomainAccess;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- description="the VPC network belongs to")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC network belongs to")
private Long vpcId;
- @Parameter(name=ApiConstants.START_IPV6, type=CommandType.STRING, description="the beginning IPv6 address in the IPv6 network range")
+ @Parameter(name = ApiConstants.START_IPV6, type = CommandType.STRING, description = "the beginning IPv6 address in the IPv6 network range")
private String startIpv6;
- @Parameter(name=ApiConstants.END_IPV6, type=CommandType.STRING, description="the ending IPv6 address in the IPv6 network range")
+ @Parameter(name = ApiConstants.END_IPV6, type = CommandType.STRING, description = "the ending IPv6 address in the IPv6 network range")
private String endIpv6;
- @Parameter(name=ApiConstants.IP6_GATEWAY, type=CommandType.STRING, description="the gateway of the IPv6 network. Required " +
- "for Shared networks and Isolated networks when it belongs to VPC")
+ @Parameter(name = ApiConstants.IP6_GATEWAY, type = CommandType.STRING, description = "the gateway of the IPv6 network. Required "
+ + "for Shared networks and Isolated networks when it belongs to VPC")
private String ip6Gateway;
-
- @Parameter(name=ApiConstants.IP6_CIDR, type=CommandType.STRING, description="the CIDR of IPv6 network, must be at least /64")
+
+ @Parameter(name = ApiConstants.IP6_CIDR, type = CommandType.STRING, description = "the CIDR of IPv6 network, must be at least /64")
private String ip6Cidr;
- @Parameter(name=ApiConstants.DISPLAY_NETWORK, type=CommandType.BOOLEAN, description="an optional field, whether to the display the network to the end user or not.")
+ @Parameter(name = ApiConstants.DISPLAY_NETWORK, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the network to the end user or not.")
private Boolean displayNetwork;
- @Parameter(name=ApiConstants.ACL_ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- description="Network ACL Id associated for the network")
+ @Parameter(name = ApiConstants.ACL_ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, description = "Network ACL Id associated for the network")
private Long aclId;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -239,30 +243,30 @@ public class CreateNetworkCmd extends BaseCmd {
}
public String getStartIpv6() {
- if (startIpv6 == null) {
- return null;
- }
+ if (startIpv6 == null) {
+ return null;
+ }
return startIpv6.toLowerCase();
}
public String getEndIpv6() {
- if (endIpv6 == null) {
- return null;
- }
+ if (endIpv6 == null) {
+ return null;
+ }
return endIpv6.toLowerCase();
}
public String getIp6Gateway() {
- if (ip6Gateway == null) {
- return null;
- }
+ if (ip6Gateway == null) {
+ return null;
+ }
return ip6Gateway.toLowerCase();
}
public String getIp6Cidr() {
- if (ip6Cidr == null) {
- return null;
- }
+ if (ip6Cidr == null) {
+ return null;
+ }
return ip6Cidr.toLowerCase();
}
@@ -290,13 +294,14 @@ public class CreateNetworkCmd extends BaseCmd {
@Override
// an exception thrown by createNetwork() will be caught by the dispatcher.
- public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{
+ public
+ void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException {
Network result = _networkService.createGuestNetwork(this);
if (result != null) {
NetworkResponse response = _responseGenerator.createNetworkResponse(result);
response.setResponseName(getCommandName());
setResponseObject(response);
- }else {
+ } else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network");
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
index 351371b..7413ea5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
@@ -32,7 +32,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
-@APICommand(name = "deleteNetworkACL", description="Deletes a Network ACL", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteNetworkACL", description = "Deletes a Network ACL", responseObject = SuccessResponse.class)
public class DeleteNetworkACLCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteNetworkACLCmd.class.getName());
private static final String s_name = "deletenetworkaclresponse";
@@ -41,8 +41,7 @@ public class DeleteNetworkACLCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkACLItemResponse.class,
- required=true, description="the ID of the network ACL")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkACLItemResponse.class, required = true, description = "the ID of the network ACL")
private Long id;
/////////////////////////////////////////////////////
@@ -68,7 +67,7 @@ public class DeleteNetworkACLCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting Network ACL id=" + id);
+ return ("Deleting Network ACL id=" + id);
}
@Override
@@ -91,4 +90,3 @@ public class DeleteNetworkACLCmd extends BaseAsyncCmd {
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
index 1b20658..632d710 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLListCmd.java
@@ -32,7 +32,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
-@APICommand(name = "deleteNetworkACLList", description="Deletes a Network ACL", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteNetworkACLList", description = "Deletes a Network ACL", responseObject = SuccessResponse.class)
public class DeleteNetworkACLListCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteNetworkACLListCmd.class.getName());
private static final String s_name = "deletenetworkacllistresponse";
@@ -41,8 +41,7 @@ public class DeleteNetworkACLListCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- required=true, description="the ID of the network ACL")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, required = true, description = "the ID of the network ACL")
private Long id;
/////////////////////////////////////////////////////
@@ -68,7 +67,7 @@ public class DeleteNetworkACLListCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting Network ACL id=" + id);
+ return ("Deleting Network ACL id=" + id);
}
@Override
@@ -90,4 +89,3 @@ public class DeleteNetworkACLListCmd extends BaseAsyncCmd {
}
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
index 6e1b380..0fd5864 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
@@ -33,8 +33,8 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network;
-@APICommand(name = "deleteNetwork", description="Deletes a network", responseObject=SuccessResponse.class)
-public class DeleteNetworkCmd extends BaseAsyncCmd{
+@APICommand(name = "deleteNetwork", description = "Deletes a network", responseObject = SuccessResponse.class)
+public class DeleteNetworkCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteNetworkOfferingCmd.class.getName());
private static final String s_name = "deletenetworkresponse";
@@ -42,11 +42,9 @@ public class DeleteNetworkCmd extends BaseAsyncCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- required=true, description="the ID of the network")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkResponse.class, required = true, description = "the ID of the network")
private Long id;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -55,7 +53,6 @@ public class DeleteNetworkCmd extends BaseAsyncCmd{
return id;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -66,7 +63,7 @@ public class DeleteNetworkCmd extends BaseAsyncCmd{
}
@Override
- public void execute(){
+ public void execute() {
CallContext.current().setEventDetails("Network Id: " + id);
boolean result = _networkService.deleteNetwork(id);
if (result) {
@@ -77,7 +74,6 @@ public class DeleteNetworkCmd extends BaseAsyncCmd{
}
}
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.networkSyncObject;
@@ -95,7 +91,7 @@ public class DeleteNetworkCmd extends BaseAsyncCmd{
@Override
public String getEventDescription() {
- return "Deleting network: " + id;
+ return "Deleting network: " + id;
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
index bb825d9..d2081fb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLListsCmd.java
@@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
-@APICommand(name = "listNetworkACLLists", description="Lists all network ACLs", responseObject=NetworkACLResponse.class)
+@APICommand(name = "listNetworkACLLists", description = "Lists all network ACLs", responseObject = NetworkACLResponse.class)
public class ListNetworkACLListsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNetworkACLListsCmd.class.getName());
@@ -40,22 +40,18 @@ public class ListNetworkACLListsCmd extends BaseListCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- description="Lists network ACL with the specified ID.")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, description = "Lists network ACL with the specified ID.")
private Long id;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="list network ACLs by network Id")
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "list network ACLs by network Id")
private Long networkId;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- description="list network ACLs by Vpc Id")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "list network ACLs by Vpc Id")
private Long vpcId;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list network ACLs by specified name")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "list network ACLs by specified name")
private String name;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -72,7 +68,7 @@ public class ListNetworkACLListsCmd extends BaseListCmd {
return vpcId;
}
- public String getName(){
+ public String getName() {
return name;
}
@@ -86,8 +82,8 @@ public class ListNetworkACLListsCmd extends BaseListCmd {
}
@Override
- public void execute(){
- Pair<List<? extends NetworkACL>,Integer> result = _networkACLService.listNetworkACLs(getId(), getName(), getNetworkId(), getVpcId());
+ public void execute() {
+ Pair<List<? extends NetworkACL>, Integer> result = _networkACLService.listNetworkACLs(getId(), getName(), getNetworkId(), getVpcId());
ListResponse<NetworkACLResponse> response = new ListResponse<NetworkACLResponse>();
List<NetworkACLResponse> aclResponses = new ArrayList<NetworkACLResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
index df21a72..a538439 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listNetworkACLs", description="Lists all network ACL items", responseObject=NetworkACLItemResponse.class)
+@APICommand(name = "listNetworkACLs", description = "Lists all network ACL items", responseObject = NetworkACLItemResponse.class)
public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListNetworkACLsCmd.class.getName());
@@ -39,25 +39,22 @@ public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = FirewallRuleResponse.class,
- description="Lists network ACL Item with the specified ID")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, description = "Lists network ACL Item with the specified ID")
private Long id;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="list network ACL Items by network Id")
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "list network ACL Items by network Id")
private Long networkId;
- @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="list network ACL Items by traffic type - Ingress or Egress")
+ @Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "list network ACL Items by traffic type - Ingress or Egress")
private String trafficType;
- @Parameter(name=ApiConstants.ACL_ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- description="list network ACL Items by ACL Id")
+ @Parameter(name = ApiConstants.ACL_ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, description = "list network ACL Items by ACL Id")
private Long aclId;
- @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="list network ACL Items by Protocol")
+ @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "list network ACL Items by Protocol")
private String protocol;
- @Parameter(name=ApiConstants.ACTION, type=CommandType.STRING, description="list network ACL Items by Action")
+ @Parameter(name = ApiConstants.ACTION, type = CommandType.STRING, description = "list network ACL Items by Action")
private String action;
/////////////////////////////////////////////////////
@@ -76,7 +73,7 @@ public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
return trafficType;
}
- public Long getAclId(){
+ public Long getAclId() {
return aclId;
}
@@ -98,8 +95,8 @@ public class ListNetworkACLsCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
- Pair<List<? extends NetworkACLItem>,Integer> result = _networkACLService.listNetworkACLItems(this);
+ public void execute() {
+ Pair<List<? extends NetworkACLItem>, Integer> result = _networkACLService.listNetworkACLItems(this);
ListResponse<NetworkACLItemResponse> response = new ListResponse<NetworkACLItemResponse>();
List<NetworkACLItemResponse> aclResponses = new ArrayList<NetworkACLItemResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
index e2c9701..622e080 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
@@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import com.cloud.offering.NetworkOffering;
-@APICommand(name = "listNetworkOfferings", description="Lists all available network offerings.", responseObject=NetworkOfferingResponse.class)
+@APICommand(name = "listNetworkOfferings", description = "Lists all available network offerings.", responseObject = NetworkOfferingResponse.class)
public class ListNetworkOfferingsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName());
private static final String _name = "listnetworkofferingsresponse";
@@ -39,59 +39,66 @@ public class ListNetworkOfferingsCmd extends BaseListCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkOfferingResponse.class,
- description="list network offerings by id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkOfferingResponse.class, description = "list network offerings by id")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list network offerings by name")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "list network offerings by name")
private String networkOfferingName;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="list network offerings by display text")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "list network offerings by display text")
private String displayText;
- @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="list by traffic type")
+ @Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "list by traffic type")
private String trafficType;
- @Parameter(name=ApiConstants.IS_DEFAULT, type=CommandType.BOOLEAN, description="true if need to list only default network offerings. Default value is false")
+ @Parameter(name = ApiConstants.IS_DEFAULT, type = CommandType.BOOLEAN, description = "true if need to list only default network offerings. Default value is false")
private Boolean isDefault;
- @Parameter(name=ApiConstants.SPECIFY_VLAN, type=CommandType.BOOLEAN, description="the tags for the network offering.")
+ @Parameter(name = ApiConstants.SPECIFY_VLAN, type = CommandType.BOOLEAN, description = "the tags for the network offering.")
private Boolean specifyVlan;
- @Parameter(name=ApiConstants.AVAILABILITY, type=CommandType.STRING, description="the availability of network offering. Default value is Required")
+ @Parameter(name = ApiConstants.AVAILABILITY, type = CommandType.STRING, description = "the availability of network offering. Default value is Required")
private String availability;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="list netowrk offerings available for network creation in specific zone")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ description = "list netowrk offerings available for network creation in specific zone")
private Long zoneId;
- @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="list network offerings by state")
+ @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "list network offerings by state")
private String state;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to.")
+ @Parameter(name = ApiConstants.NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = NetworkResponse.class,
+ description = "the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to.")
private Long networkId;
- @Parameter(name=ApiConstants.GUEST_IP_TYPE, type=CommandType.STRING, description="list network offerings by guest type: Shared or Isolated")
+ @Parameter(name = ApiConstants.GUEST_IP_TYPE, type = CommandType.STRING, description = "list network offerings by guest type: Shared or Isolated")
private String guestIpType;
- @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list network offerings supporting certain services")
+ @Parameter(name = ApiConstants.SUPPORTED_SERVICES,
+ type = CommandType.LIST,
+ collectionType = CommandType.STRING,
+ description = "list network offerings supporting certain services")
private List<String> supportedServices;
- @Parameter(name=ApiConstants.SOURCE_NAT_SUPPORTED, type=CommandType.BOOLEAN, description="true if need to list only netwok offerings where source nat is supported, false otherwise")
+ @Parameter(name = ApiConstants.SOURCE_NAT_SUPPORTED,
+ type = CommandType.BOOLEAN,
+ description = "true if need to list only netwok offerings where source nat is supported, false otherwise")
private Boolean sourceNatSupported;
- @Parameter(name=ApiConstants.SPECIFY_IP_RANGES, type=CommandType.BOOLEAN, description="true if need to list only network offerings which support specifying ip ranges")
+ @Parameter(name = ApiConstants.SPECIFY_IP_RANGES, type = CommandType.BOOLEAN, description = "true if need to list only network offerings which support specifying ip ranges")
private Boolean specifyIpRanges;
- @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="list network offerings by tags", length=4096)
+ @Parameter(name = ApiConstants.TAGS, type = CommandType.STRING, description = "list network offerings by tags", length = 4096)
private String tags;
- @Parameter(name=ApiConstants.IS_TAGGED, type=CommandType.BOOLEAN, description="true if offering has tags specified")
+ @Parameter(name = ApiConstants.IS_TAGGED, type = CommandType.BOOLEAN, description = "true if offering has tags specified")
private Boolean isTagged;
- @Parameter(name=ApiConstants.FOR_VPC, type=CommandType.BOOLEAN, description="the network offering can be used" +
- " only for network creation inside the VPC")
+ @Parameter(name = ApiConstants.FOR_VPC, type = CommandType.BOOLEAN, description = "the network offering can be used" + " only for network creation inside the VPC")
private Boolean forVpc;
/////////////////////////////////////////////////////
@@ -175,7 +182,7 @@ public class ListNetworkOfferingsCmd extends BaseListCmd {
}
@Override
- public void execute(){
+ public void execute() {
List<? extends NetworkOffering> offerings = _configService.searchForNetworkOfferings(this);
ListResponse<NetworkOfferingResponse> response = new ListResponse<NetworkOfferingResponse>();
List<NetworkOfferingResponse> offeringResponses = new ArrayList<NetworkOfferingResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
index afce092..80d7848 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
@@ -32,7 +32,7 @@ import org.apache.log4j.Logger;
import com.cloud.network.Network;
-@APICommand(name = "listNetworks", description="Lists all available networks.", responseObject=NetworkResponse.class)
+@APICommand(name = "listNetworks", description = "Lists all available networks.", responseObject = NetworkResponse.class)
public class ListNetworksCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListNetworksCmd.class.getName());
private static final String _name = "listnetworksresponse";
@@ -40,48 +40,43 @@ public class ListNetworksCmd extends BaseListTaggedResourcesCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="list networks by id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "list networks by id")
private Long id;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="the Zone ID of the network")
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "the Zone ID of the network")
private Long zoneId;
- @Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the type of the network. Supported values are: Isolated and Shared")
+ @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "the type of the network. Supported values are: Isolated and Shared")
private String guestIpType;
- @Parameter(name=ApiConstants.IS_SYSTEM, type=CommandType.BOOLEAN, description="true if network is system, false otherwise")
+ @Parameter(name = ApiConstants.IS_SYSTEM, type = CommandType.BOOLEAN, description = "true if network is system, false otherwise")
private Boolean isSystem;
- @Parameter(name=ApiConstants.ACL_TYPE, type=CommandType.STRING, description="list networks by ACL (access control list) type. Supported values are Account and Domain")
+ @Parameter(name = ApiConstants.ACL_TYPE, type = CommandType.STRING, description = "list networks by ACL (access control list) type. Supported values are Account and Domain")
private String aclType;
- @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="type of the traffic")
+ @Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "type of the traffic")
private String trafficType;
- @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
- description="list networks by physical network id")
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType = PhysicalNetworkResponse.class, description = "list networks by physical network id")
private Long physicalNetworkId;
- @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, collectionType=CommandType.STRING, description="list networks supporting certain services")
+ @Parameter(name = ApiConstants.SUPPORTED_SERVICES, type = CommandType.LIST, collectionType = CommandType.STRING, description = "list networks supporting certain services")
private List<String> supportedServices;
- @Parameter(name=ApiConstants.RESTART_REQUIRED, type=CommandType.BOOLEAN, description="list networks by restartRequired")
-
+ @Parameter(name = ApiConstants.RESTART_REQUIRED, type = CommandType.BOOLEAN, description = "list networks by restartRequired")
private Boolean restartRequired;
- @Parameter(name=ApiConstants.SPECIFY_IP_RANGES, type=CommandType.BOOLEAN, description="true if need to list only networks which support specifying ip ranges")
+ @Parameter(name = ApiConstants.SPECIFY_IP_RANGES, type = CommandType.BOOLEAN, description = "true if need to list only networks which support specifying ip ranges")
private Boolean specifyIpRanges;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- description="List networks by VPC")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "List networks by VPC")
private Long vpcId;
- @Parameter(name=ApiConstants.CAN_USE_FOR_DEPLOY, type=CommandType.BOOLEAN, description="list networks available for vm deployment")
+ @Parameter(name = ApiConstants.CAN_USE_FOR_DEPLOY, type = CommandType.BOOLEAN, description = "list networks available for vm deployment")
private Boolean canUseForDeploy;
- @Parameter(name=ApiConstants.FOR_VPC, type=CommandType.BOOLEAN, description="the network belongs to vpc")
+ @Parameter(name = ApiConstants.FOR_VPC, type = CommandType.BOOLEAN, description = "the network belongs to vpc")
private Boolean forVpc;
/////////////////////////////////////////////////////
@@ -149,7 +144,7 @@ public class ListNetworksCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
List<? extends Network> networks = _networkService.searchForNetworks(this);
ListResponse<NetworkResponse> response = new ListResponse<NetworkResponse>();
List<NetworkResponse> networkResponses = new ArrayList<NetworkResponse>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
index c92992c..dc4cf64 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ReplaceNetworkACLListCmd.java
@@ -32,7 +32,7 @@ import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger;
-@APICommand(name = "replaceNetworkACLList", description="Replaces ACL associated with a Network or private gateway", responseObject=SuccessResponse.class)
+@APICommand(name = "replaceNetworkACLList", description = "Replaces ACL associated with a Network or private gateway", responseObject = SuccessResponse.class)
public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ReplaceNetworkACLListCmd.class.getName());
private static final String s_name = "replacenetworkacllistresponse";
@@ -41,16 +41,13 @@ public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ACL_ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- required=true, description="the ID of the network ACL")
+ @Parameter(name = ApiConstants.ACL_ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, required = true, description = "the ID of the network ACL")
private long aclId;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="the ID of the network")
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "the ID of the network")
private Long networkId;
- @Parameter(name=ApiConstants.GATEWAY_ID, type=CommandType.UUID, entityType = PrivateGatewayResponse.class,
- description="the ID of the private gateway")
+ @Parameter(name = ApiConstants.GATEWAY_ID, type = CommandType.UUID, entityType = PrivateGatewayResponse.class, description = "the ID of the private gateway")
private Long privateGatewayId;
/////////////////////////////////////////////////////
@@ -61,7 +58,7 @@ public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
return aclId;
}
- public Long getNetworkId(){
+ public Long getNetworkId() {
return networkId;
}
@@ -84,7 +81,7 @@ public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Associating Network ACL id=" + aclId+ " with Network id="+ networkId);
+ return ("Associating Network ACL id=" + aclId + " with Network id=" + networkId);
}
@Override
@@ -119,4 +116,3 @@ public class ReplaceNetworkACLListCmd extends BaseAsyncCmd {
}
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
index b054781..8caf076 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
@@ -35,7 +35,9 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
-@APICommand(name = "restartNetwork", description="Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules", responseObject=IPAddressResponse.class)
+@APICommand(name = "restartNetwork",
+ description = "Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules",
+ responseObject = IPAddressResponse.class)
public class RestartNetworkCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(RestartNetworkCmd.class.getName());
private static final String s_name = "restartnetworkresponse";
@@ -44,14 +46,12 @@ public class RestartNetworkCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- required=true, description="The id of the network to restart.")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkResponse.class, required = true, description = "The id of the network to restart.")
private Long id;
- @Parameter(name=ApiConstants.CLEANUP, type=CommandType.BOOLEAN, required=false, description="If cleanup old network elements")
+ @Parameter(name = ApiConstants.CLEANUP, type = CommandType.BOOLEAN, required = false, description = "If cleanup old network elements")
private Boolean cleanup;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -72,12 +72,10 @@ public class RestartNetworkCmd extends BaseAsyncCmd {
return true;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
@Override
public String getCommandName() {
return s_name;
@@ -109,7 +107,7 @@ public class RestartNetworkCmd extends BaseAsyncCmd {
}
public String getEventDescription() {
- return "Restarting network: " + getNetworkId();
+ return "Restarting network: " + getNetworkId();
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
index d7862a1..2e38e49 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java
@@ -34,8 +34,7 @@ import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
-@APICommand(name = "updateNetworkACLItem", description = "Updates ACL Item with specified Id",
-responseObject = NetworkACLItemResponse.class)
+@APICommand(name = "updateNetworkACLItem", description = "Updates ACL Item with specified Id", responseObject = NetworkACLItemResponse.class)
public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(UpdateNetworkACLItemCmd.class.getName());
@@ -45,12 +44,10 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkACLItemResponse.class,
- required=true, description="the ID of the network ACL Item")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkACLItemResponse.class, required = true, description = "the ID of the network ACL Item")
private Long id;
- @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description =
- "the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number")
+ @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number")
private String protocol;
@Parameter(name = ApiConstants.START_PORT, type = CommandType.INTEGER, description = "the starting port of ACL")
@@ -59,8 +56,7 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "the ending port of ACL")
private Integer publicEndPort;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING,
- description = "the cidr list to allow traffic from/to")
+ @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to allow traffic from/to")
private List<String> cidrlist;
@Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the icmp message being sent")
@@ -69,14 +65,14 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.ICMP_CODE, type = CommandType.INTEGER, description = "error code for this icmp message")
private Integer icmpCode;
- @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, description="the traffic type for the ACL," +
- "can be Ingress or Egress, defaulted to Ingress if not specified")
+ @Parameter(name = ApiConstants.TRAFFIC_TYPE, type = CommandType.STRING, description = "the traffic type for the ACL,"
+ + "can be Ingress or Egress, defaulted to Ingress if not specified")
private String trafficType;
- @Parameter(name=ApiConstants.NUMBER, type=CommandType.INTEGER, description="The network of the vm the ACL will be created for")
+ @Parameter(name = ApiConstants.NUMBER, type = CommandType.INTEGER, description = "The network of the vm the ACL will be created for")
private Integer number;
- @Parameter(name=ApiConstants.ACTION, type=CommandType.STRING, description="scl entry action, allow or deny")
+ @Parameter(name = ApiConstants.ACTION, type = CommandType.STRING, description = "scl entry action, allow or deny")
private String action;
// ///////////////////////////////////////////////////
@@ -88,7 +84,7 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
}
public String getProtocol() {
- if(protocol != null){
+ if (protocol != null) {
return protocol.trim();
} else
return null;
@@ -161,8 +157,8 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
@Override
public void execute() throws ResourceUnavailableException {
CallContext.current().setEventDetails("Rule Id: " + getId());
- NetworkACLItem aclItem = _networkACLService.updateNetworkACLItem(getId(), getProtocol(), getSourceCidrList(), getTrafficType(),
- getAction(), getNumber(), getSourcePortStart(), getSourcePortEnd(), getIcmpCode(), getIcmpType());
+ NetworkACLItem aclItem = _networkACLService.updateNetworkACLItem(getId(), getProtocol(), getSourceCidrList(), getTrafficType(), getAction(), getNumber(),
+ getSourcePortStart(), getSourcePortEnd(), getIcmpCode(), getIcmpType());
if (aclItem == null) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network ACL Item");
}
@@ -172,4 +168,3 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCmd {
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index a44b768..33e8a3c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -37,7 +37,7 @@ import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
import com.cloud.user.User;
-@APICommand(name = "updateNetwork", description="Updates a network", responseObject=NetworkResponse.class)
+@APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class)
public class UpdateNetworkCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(UpdateNetworkCmd.class.getName());
@@ -46,30 +46,28 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- required=true, description="the ID of the network")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = NetworkResponse.class, required = true, description = "the ID of the network")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the new name for the network")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the new name for the network")
private String name;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the new display text for the network")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the new display text for the network")
private String displayText;
- @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="network domain")
+ @Parameter(name = ApiConstants.NETWORK_DOMAIN, type = CommandType.STRING, description = "network domain")
private String networkDomain;
- @Parameter(name=ApiConstants.CHANGE_CIDR, type=CommandType.BOOLEAN, description="Force update even if cidr type is different")
+ @Parameter(name = ApiConstants.CHANGE_CIDR, type = CommandType.BOOLEAN, description = "Force update even if cidr type is different")
private Boolean changeCidr;
- @Parameter(name=ApiConstants.NETWORK_OFFERING_ID, type=CommandType.UUID, entityType = NetworkOfferingResponse.class,
- description="network offering ID")
+ @Parameter(name = ApiConstants.NETWORK_OFFERING_ID, type = CommandType.UUID, entityType = NetworkOfferingResponse.class, description = "network offering ID")
private Long networkOfferingId;
- @Parameter(name=ApiConstants.GUEST_VM_CIDR, type=CommandType.STRING, description="CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR")
+ @Parameter(name = ApiConstants.GUEST_VM_CIDR, type = CommandType.STRING, description = "CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR")
private String guestVmCidr;
- @Parameter(name=ApiConstants.DISPLAY_NETWORK, type=CommandType.BOOLEAN, description="an optional field, whether to the display the network to the end user or not.")
+ @Parameter(name = ApiConstants.DISPLAY_NETWORK, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the network to the end user or not.")
private Boolean displayNetwork;
/////////////////////////////////////////////////////
@@ -110,6 +108,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
public Boolean getDisplayNetwork() {
return displayNetwork;
}
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -130,7 +129,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
}
@Override
- public void execute() throws InsufficientCapacityException, ConcurrentOperationException{
+ public void execute() throws InsufficientCapacityException, ConcurrentOperationException {
User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId());
Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId());
Network network = _networkService.getNetwork(id);
@@ -138,9 +137,8 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
throw new InvalidParameterValueException("Couldn't find network by id");
}
- Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount,
- callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(), getGuestVmCidr(), getDisplayNetwork());
-
+ Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount, callerUser, getNetworkDomain(), getNetworkOfferingId(),
+ getChangeCidr(), getGuestVmCidr(), getDisplayNetwork());
if (result != null) {
NetworkResponse response = _responseGenerator.createNetworkResponse(result);
@@ -169,7 +167,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
eventMsg.append(". Original network offering id: " + oldOff.getUuid() + ", new network offering id: " + newOff.getUuid());
}
}
-
+
return eventMsg.toString();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
index eb48d81..6b9a5e2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
@@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import com.cloud.offering.DiskOffering;
-@APICommand(name = "listDiskOfferings", description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
+@APICommand(name = "listDiskOfferings", description = "Lists all available disk offerings.", responseObject = DiskOfferingResponse.class)
public class ListDiskOfferingsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListDiskOfferingsCmd.class.getName());
@@ -41,15 +41,13 @@ public class ListDiskOfferingsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
- description="the ID of the domain of the disk offering.")
+ @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the ID of the domain of the disk offering.")
private Long domainId;
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = DiskOfferingResponse.class,
- description="ID of the disk offering")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "ID of the disk offering")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the disk offering")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "name of the disk offering")
private String diskOfferingName;
/////////////////////////////////////////////////////
@@ -78,7 +76,7 @@ public class ListDiskOfferingsCmd extends BaseListCmd {
}
@Override
- public void execute(){
+ public void execute() {
ListResponse<DiskOfferingResponse> response = _queryService.searchForDiskOfferings(this);
response.setResponseName(getCommandName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
index 60eb438..4c1f5e6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
@@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
-@APICommand(name = "listServiceOfferings", description="Lists all available service offerings.", responseObject=ServiceOfferingResponse.class)
+@APICommand(name = "listServiceOfferings", description = "Lists all available service offerings.", responseObject = ServiceOfferingResponse.class)
public class ListServiceOfferingsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
@@ -43,28 +43,29 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = ServiceOfferingResponse.class,
- description="ID of the service offering")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, description = "ID of the service offering")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the service offering")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "name of the service offering")
private String serviceOfferingName;
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
- description="the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.")
+ @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
+ type = CommandType.UUID,
+ entityType = UserVmResponse.class,
+ description = "the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.")
private Long virtualMachineId;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
- description="the ID of the domain associated with the service offering")
+ @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the ID of the domain associated with the service offering")
private Long domainId;
- @Parameter(name=ApiConstants.IS_SYSTEM_OFFERING, type=CommandType.BOOLEAN, description="is this a system vm offering")
+ @Parameter(name = ApiConstants.IS_SYSTEM_OFFERING, type = CommandType.BOOLEAN, description = "is this a system vm offering")
private Boolean isSystem;
- @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\", \"secondarystoragevm\" or \"domainrouter\".")
+ @Parameter(name = ApiConstants.SYSTEM_VM_TYPE,
+ type = CommandType.STRING,
+ description = "the system VM type. Possible types are \"consoleproxy\", \"secondarystoragevm\" or \"domainrouter\".")
private String systemVmType;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -81,7 +82,7 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
return virtualMachineId;
}
- public Long getDomainId(){
+ public Long getDomainId() {
return domainId;
}
@@ -89,7 +90,7 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
return isSystem == null ? false : isSystem;
}
- public String getSystemVmType(){
+ public String getSystemVmType() {
return systemVmType;
}
@@ -103,7 +104,7 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
}
@Override
- public void execute(){
+ public void execute() {
ListResponse<ServiceOfferingResponse> response = _queryService.searchForServiceOfferings(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/project/ActivateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
index 1f49d8c..75e469d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
@@ -31,7 +31,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.projects.Project;
-@APICommand(name = "activateProject", description="Activates a project", responseObject=ProjectResponse.class, since="3.0.0")
+@APICommand(name = "activateProject", description = "Activates a project", responseObject = ProjectResponse.class, since = "3.0.0")
public class ActivateProjectCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ActivateProjectCmd.class.getName());
@@ -41,8 +41,7 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
- required=true, description="id of the project to be modified")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ProjectResponse.class, required = true, description = "id of the project to be modified")
private Long id;
/////////////////////////////////////////////////////
@@ -58,10 +57,9 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
return s_name;
}
-
@Override
public long getEntityOwnerId() {
- Project project= _projectService.getProject(getId());
+ Project project = _projectService.getProject(getId());
//verify input parameters
if (project == null) {
throw new InvalidParameterValueException("Unable to find project by id " + getId());
@@ -70,14 +68,13 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
return _projectService.getProjectOwner(getId()).getId();
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
- public void execute(){
- CallContext.current().setEventDetails("Project id: "+ getId());
+ public void execute() {
+ CallContext.current().setEventDetails("Project id: " + getId());
Project project = _projectService.activateProject(getId());
if (project != null) {
ProjectResponse response = _responseGenerator.createProjectResponse(project);
@@ -95,6 +92,6 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "Activating project: " + id;
+ return "Activating project: " + id;
}
}