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:26 UTC
[39/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/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
index ab0dcd5..3d9848c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
@@ -44,7 +44,7 @@ import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
import com.cloud.vm.VirtualMachine;
-@APICommand(name = "migrateVirtualMachineWithVolume", description="Attempts Migration of a VM with its volumes to a different host", responseObject=UserVmResponse.class)
+@APICommand(name = "migrateVirtualMachineWithVolume", description = "Attempts Migration of a VM with its volumes to a different host", responseObject = UserVmResponse.class)
public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(MigrateVMCmd.class.getName());
@@ -54,16 +54,13 @@ public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.HOST_ID, type=CommandType.UUID, entityType=HostResponse.class,
- required=true, description="Destination Host ID to migrate VM to.")
+ @Parameter(name = ApiConstants.HOST_ID, type = CommandType.UUID, entityType = HostResponse.class, required = true, description = "Destination Host ID to migrate VM to.")
private Long hostId;
- @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;
- @Parameter(name = ApiConstants.MIGRATE_TO, type = CommandType.MAP, required=false,
- description = "Map of pool to which each volume should be migrated (volume/pool pair)")
+ @Parameter(name = ApiConstants.MIGRATE_TO, type = CommandType.MAP, required = false, description = "Map of pool to which each volume should be migrated (volume/pool pair)")
private Map migrateVolumeTo;
/////////////////////////////////////////////////////
@@ -84,7 +81,7 @@ public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
Collection<?> allValues = migrateVolumeTo.values();
Iterator<?> iter = allValues.iterator();
while (iter.hasNext()) {
- HashMap<String, String> volumeToPool = (HashMap<String, String>) iter.next();
+ HashMap<String, String> volumeToPool = (HashMap<String, String>)iter.next();
String volume = volumeToPool.get("volume");
String pool = volumeToPool.get("pool");
volumeToPoolMap.put(volume, pool);
@@ -119,11 +116,11 @@ public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: "+ getHostId();
+ return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId();
}
@Override
- public void execute(){
+ public void execute() {
UserVm userVm = _userVmService.getUserVm(getVirtualMachineId());
if (userVm == null) {
throw new InvalidParameterValueException("Unable to find the VM by id=" + getVirtualMachineId());
@@ -134,9 +131,8 @@ public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
throw new InvalidParameterValueException("Unable to find the host to migrate the VM, host id =" + getHostId());
}
- try{
- VirtualMachine migratedVm = _userVmService.migrateVirtualMachineWithVolume(getVirtualMachineId(),
- destinationHost, getVolumeToPool());
+ try {
+ VirtualMachine migratedVm = _userVmService.migrateVirtualMachineWithVolume(getVirtualMachineId(), destinationHost, getVolumeToPool());
if (migratedVm != null) {
UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", (UserVm)migratedVm).get(0);
response.setResponseName(getCommandName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
index 13e755c..52f34f8 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
@@ -29,7 +29,7 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
-@APICommand(name = "recoverVirtualMachine", description="Recovers a virtual machine.", responseObject=UserVmResponse.class)
+@APICommand(name = "recoverVirtualMachine", description = "Recovers a virtual machine.", responseObject = UserVmResponse.class)
public class RecoverVMCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(RecoverVMCmd.class.getName());
@@ -39,8 +39,7 @@ public class RecoverVMCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=UserVmResponse.class,
- required=true, description="The ID of the virtual machine")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "The ID of the virtual machine")
private Long id;
/////////////////////////////////////////////////////
@@ -71,9 +70,9 @@ public class RecoverVMCmd extends BaseCmd {
}
@Override
- public void execute() throws ResourceAllocationException{
+ public void execute() throws ResourceAllocationException {
UserVm result = _userVmService.recoverVirtualMachine(this);
- if (result != null){
+ if (result != null) {
UserVmResponse recoverVmResponse = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
recoverVmResponse.setResponseName(getCommandName());
this.setResponseObject(recoverVmResponse);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
index 5047cd9..f92511e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
@@ -42,7 +42,7 @@ import com.cloud.network.vpc.PrivateGateway;
import com.cloud.network.vpc.Vpc;
import com.cloud.user.Account;
-@APICommand(name = "createPrivateGateway", description="Creates a private gateway", responseObject=PrivateGatewayResponse.class)
+@APICommand(name = "createPrivateGateway", description = "Creates a private gateway", responseObject = PrivateGatewayResponse.class)
public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreatePrivateGatewayCmd.class.getName());
@@ -52,40 +52,43 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @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, required=true, description="the gateway of the Private gateway")
+ @Parameter(name = ApiConstants.GATEWAY, type = CommandType.STRING, required = true, description = "the gateway of the Private gateway")
private String gateway;
- @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask of the Private gateway")
+ @Parameter(name = ApiConstants.NETMASK, type = CommandType.STRING, required = true, description = "the netmask of the Private gateway")
private String netmask;
- @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the IP address of the Private gateaway")
+ @Parameter(name = ApiConstants.IP_ADDRESS, type = CommandType.STRING, required = true, description = "the IP address of the Private gateaway")
private String ipAddress;
@Parameter(name = ApiConstants.VLAN, type = CommandType.STRING, required = true, description = "the network implementation uri for the private gateway")
private String broadcastUri;
- @Parameter(name = ApiConstants.NETWORK_OFFERING_ID, type = CommandType.UUID, required = false, entityType = NetworkOfferingResponse.class,
- description = "the uuid of the network offering to use for the private gateways network connection")
+ @Parameter(name = ApiConstants.NETWORK_OFFERING_ID,
+ type = CommandType.UUID,
+ required = false,
+ entityType = NetworkOfferingResponse.class,
+ description = "the uuid of the network offering to use for the private gateways network connection")
private Long networkOfferingId;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- required=true, description="the VPC network belongs to")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, required = true, description = "the VPC network belongs to")
private Long vpcId;
- @Parameter(name=ApiConstants.SOURCE_NAT_SUPPORTED, type=CommandType.BOOLEAN, required=false,
- description="source NAT supported value. Default value false. If 'true' source NAT is enabled on the private gateway" +
- " 'false': sourcenat is not supported")
+ @Parameter(name = ApiConstants.SOURCE_NAT_SUPPORTED,
+ type = CommandType.BOOLEAN,
+ required = false,
+ description = "source NAT supported value. Default value false. If 'true' source NAT is enabled on the private gateway" + " 'false': sourcenat is not supported")
private Boolean isSourceNat;
- @Parameter(name=ApiConstants.ACL_ID, type=CommandType.UUID, entityType = NetworkACLResponse.class,
- required=false, description="the ID of the network ACL")
+ @Parameter(name = ApiConstants.ACL_ID, type = CommandType.UUID, entityType = NetworkACLResponse.class, required = false, description = "the ID of the network ACL")
private Long aclId;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -118,7 +121,7 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
return vpcId;
}
- public Boolean getIsSourceNat () {
+ public Boolean getIsSourceNat() {
if (isSourceNat == null) {
return false;
}
@@ -129,7 +132,6 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
return aclId;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -138,14 +140,13 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
return s_name;
}
-
@Override
public void create() throws ResourceAllocationException {
PrivateGateway result = null;
try {
- result = _vpcService.createVpcPrivateGateway(getVpcId(), getPhysicalNetworkId(),
- getBroadcastUri(), getStartIp(), getGateway(), getNetmask(), getEntityOwnerId(), getNetworkOfferingId(), getIsSourceNat(), getAclId());
- } catch (InsufficientCapacityException ex){
+ result = _vpcService.createVpcPrivateGateway(getVpcId(), getPhysicalNetworkId(), getBroadcastUri(), getStartIp(), getGateway(), getNetmask(), getEntityOwnerId(),
+ getNetworkOfferingId(), getIsSourceNat(), getAclId());
+ } catch (InsufficientCapacityException ex) {
s_logger.info(ex);
s_logger.trace(ex);
throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
@@ -163,8 +164,7 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
}
@Override
- public void execute() throws InsufficientCapacityException, ConcurrentOperationException,
- ResourceAllocationException, ResourceUnavailableException {
+ public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException, ResourceUnavailableException {
PrivateGateway result = _vpcService.applyVpcPrivateGateway(getEntityId(), true);
if (result != null) {
PrivateGatewayResponse response = _responseGenerator.createPrivateGatewayResponse(result);
@@ -187,11 +187,9 @@ public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd {
@Override
public String getEventDescription() {
- return "creating private gateway";
+ return "creating private gateway";
}
-
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.vpcSyncObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
index 7a8deba..6aec403 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
@@ -39,8 +39,8 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.vpc.VpcOffering;
import com.cloud.user.Account;
-@APICommand(name = "createVPCOffering", description="Creates VPC offering", responseObject=VpcOfferingResponse.class)
-public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
+@APICommand(name = "createVPCOffering", description = "Creates VPC offering", responseObject = VpcOfferingResponse.class)
+public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreateVPCOfferingCmd.class.getName());
private static final String _name = "createvpcofferingresponse";
@@ -48,22 +48,28 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the vpc offering")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the vpc offering")
private String vpcOfferingName;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of " +
- "the vpc offering")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "the display text of " + "the vpc offering")
private String displayText;
- @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, required=true, collectionType=CommandType.STRING,
- description="services supported by the vpc offering")
+ @Parameter(name = ApiConstants.SUPPORTED_SERVICES,
+ type = CommandType.LIST,
+ required = true,
+ collectionType = CommandType.STRING,
+ description = "services supported by the vpc offering")
private List<String> supportedServices;
- @Parameter(name = ApiConstants.SERVICE_PROVIDER_LIST, type = CommandType.MAP, description = "provider to service mapping. " +
- "If not specified, the provider for the service will be mapped to the default provider on the physical network")
+ @Parameter(name = ApiConstants.SERVICE_PROVIDER_LIST,
+ type = CommandType.MAP,
+ description = "provider to service mapping. " + "If not specified, the provider for the service will be mapped to the default provider on the physical network")
private Map<String, String> serviceProviderList;
- @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, description = "the ID of the service offering for the VPC router appliance")
+ @Parameter(name = ApiConstants.SERVICE_OFFERING_ID,
+ type = CommandType.UUID,
+ entityType = ServiceOfferingResponse.class,
+ description = "the ID of the service offering for the VPC router appliance")
private Long serviceOfferingId;
/////////////////////////////////////////////////////
@@ -89,7 +95,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
Collection servicesCollection = serviceProviderList.values();
Iterator iter = servicesCollection.iterator();
while (iter.hasNext()) {
- HashMap<String, String> services = (HashMap<String, String>) iter.next();
+ HashMap<String, String> services = (HashMap<String, String>)iter.next();
String service = services.get("service");
String provider = services.get("provider");
List<String> providerList = null;
@@ -112,8 +118,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
@Override
public void create() throws ResourceAllocationException {
- VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices(),
- getServiceProviders(), getServiceOfferingId());
+ VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices(), getServiceProviders(), getServiceOfferingId());
if (vpcOff != null) {
setEntityId(vpcOff.getId());
setEntityUuid(vpcOff.getUuid());
@@ -134,7 +139,6 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
}
}
-
@Override
public String getEventType() {
return EventTypes.EVENT_VPC_OFFERING_CREATE;
@@ -142,7 +146,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
@Override
public String getEventDescription() {
- return "creating VPC offering. Id: " + getEntityId();
+ return "creating VPC offering. Id: " + getEntityId();
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
index 0a06146..c3798ed 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
@@ -36,7 +36,7 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.vpc.VpcGateway;
import com.cloud.user.Account;
-@APICommand(name = "deletePrivateGateway", description="Deletes a Private gateway", responseObject=SuccessResponse.class)
+@APICommand(name = "deletePrivateGateway", description = "Deletes a Private gateway", responseObject = SuccessResponse.class)
public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeletePrivateGatewayCmd.class.getName());
private static final String s_name = "deleteprivategatewayresponse";
@@ -45,8 +45,7 @@ public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = PrivateGatewayResponse.class,
- required=true, description="the ID of the private gateway")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = PrivateGatewayResponse.class, required = true, description = "the ID of the private gateway")
private Long id;
/////////////////////////////////////////////////////
@@ -72,7 +71,7 @@ public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting private gateway id=" + id);
+ return ("Deleting private gateway id=" + id);
}
@Override
@@ -92,7 +91,6 @@ public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
}
}
-
@Override
public String getSyncObjType() {
return BaseAsyncCmd.vpcSyncObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
index 4b16fa5..70bff16 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
@@ -29,8 +29,8 @@ import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
-@APICommand(name = "deleteVPCOffering", description="Deletes VPC offering", responseObject=SuccessResponse.class)
-public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
+@APICommand(name = "deleteVPCOffering", description = "Deletes VPC offering", responseObject = SuccessResponse.class)
+public class DeleteVPCOfferingCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteVPCOfferingCmd.class.getName());
private static final String s_name = "deletevpcofferingresponse";
@@ -38,8 +38,7 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VpcOfferingResponse.class,
- required=true, description="the ID of the VPC offering")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VpcOfferingResponse.class, required = true, description = "the ID of the VPC offering")
private Long id;
/////////////////////////////////////////////////////
@@ -65,7 +64,7 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
}
@Override
- public void execute(){
+ public void execute() {
boolean result = _vpcProvSvc.deleteVpcOffering(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@@ -76,15 +75,13 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
}
@Override
- public String getEventType(){
+ public String getEventType() {
return EventTypes.EVENT_VPC_OFFERING_DELETE;
}
-
@Override
public String getEventDescription() {
return "Deleting VPC offering id=" + getId();
}
-
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
index 6eaac38..4b77dc5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
@@ -29,8 +29,8 @@ import com.cloud.event.EventTypes;
import com.cloud.network.vpc.VpcOffering;
import com.cloud.user.Account;
-@APICommand(name = "updateVPCOffering", description="Updates VPC offering", responseObject=VpcOfferingResponse.class)
-public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
+@APICommand(name = "updateVPCOffering", description = "Updates VPC offering", responseObject = VpcOfferingResponse.class)
+public class UpdateVPCOfferingCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(UpdateVPCOfferingCmd.class.getName());
private static final String _name = "updatevpcofferingresponse";
@@ -38,18 +38,16 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VpcOfferingResponse.class, required=true,
- description="the id of the VPC offering")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VpcOfferingResponse.class, required = true, description = "the id of the VPC offering")
private Long id;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the VPC offering")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the VPC offering")
private String vpcOffName;
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the VPC offering")
+ @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the display text of the VPC offering")
private String displayText;
- @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="update state for the VPC offering; " +
- "supported states - Enabled/Disabled")
+ @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "update state for the VPC offering; " + "supported states - Enabled/Disabled")
private String state;
/////////////////////////////////////////////////////
@@ -72,7 +70,6 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
return state;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -87,7 +84,7 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
}
@Override
- public void execute(){
+ public void execute() {
VpcOffering result = _vpcProvSvc.updateVpcOffering(getId(), getVpcOfferingName(), getDisplayText(), getState());
if (result != null) {
VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(result);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
index 5799da1..9cce26a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
@@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import com.cloud.dc.DataCenter;
import com.cloud.user.Account;
-@APICommand(name = "createZone", description="Creates a Zone.", responseObject=ZoneResponse.class)
+@APICommand(name = "createZone", description = "Creates a Zone.", responseObject = ZoneResponse.class)
public class CreateZoneCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(CreateZoneCmd.class.getName());
@@ -41,47 +41,46 @@ public class CreateZoneCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, required=true, description="the first DNS for the Zone")
+ @Parameter(name = ApiConstants.DNS1, type = CommandType.STRING, required = true, description = "the first DNS for the Zone")
private String dns1;
- @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
+ @Parameter(name = ApiConstants.DNS2, type = CommandType.STRING, description = "the second DNS for the Zone")
private String dns2;
- @Parameter(name=ApiConstants.IP6_DNS1, type=CommandType.STRING, description="the first DNS for IPv6 network in the Zone")
+ @Parameter(name = ApiConstants.IP6_DNS1, type = CommandType.STRING, description = "the first DNS for IPv6 network in the Zone")
private String ip6Dns1;
- @Parameter(name=ApiConstants.IP6_DNS2, type=CommandType.STRING, description="the second DNS for IPv6 network in the Zone")
+ @Parameter(name = ApiConstants.IP6_DNS2, type = CommandType.STRING, description = "the second DNS for IPv6 network in the Zone")
private String ip6Dns2;
- @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
+ @Parameter(name = ApiConstants.GUEST_CIDR_ADDRESS, type = CommandType.STRING, description = "the guest CIDR address for the Zone")
private String guestCidrAddress;
- @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, required=true, description="the first internal DNS for the Zone")
+ @Parameter(name = ApiConstants.INTERNAL_DNS1, type = CommandType.STRING, required = true, description = "the first internal DNS for the Zone")
private String internalDns1;
- @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
+ @Parameter(name = ApiConstants.INTERNAL_DNS2, type = CommandType.STRING, description = "the second internal DNS for the Zone")
private String internalDns2;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the Zone")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the Zone")
private String zoneName;
- @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone")
+ @Parameter(name = ApiConstants.DOMAIN, type = CommandType.STRING, description = "Network domain name for the networks in the zone")
private String domain;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
- description="the ID of the containing domain, null for public zones")
+ @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the ID of the containing domain, null for public zones")
private Long domainId;
- @Parameter(name=ApiConstants.NETWORK_TYPE, type=CommandType.STRING, required=true, description="network type of the zone, can be Basic or Advanced")
+ @Parameter(name = ApiConstants.NETWORK_TYPE, type = CommandType.STRING, required = true, description = "network type of the zone, can be Basic or Advanced")
private String networkType;
- @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this Zone for allocation of new resources")
+ @Parameter(name = ApiConstants.ALLOCATION_STATE, type = CommandType.STRING, description = "Allocation state of this Zone for allocation of new resources")
private String allocationState;
- @Parameter(name=ApiConstants.SECURITY_GROUP_EANBLED, type=CommandType.BOOLEAN, description="true if network is security group enabled, false otherwise")
+ @Parameter(name = ApiConstants.SECURITY_GROUP_EANBLED, type = CommandType.BOOLEAN, description = "true if network is security group enabled, false otherwise")
private Boolean securitygroupenabled;
- @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
+ @Parameter(name = ApiConstants.LOCAL_STORAGE_ENABLED, type = CommandType.BOOLEAN, description = "true if local storage offering enabled, false otherwise")
private Boolean localStorageEnabled;
/////////////////////////////////////////////////////
@@ -124,11 +123,11 @@ public class CreateZoneCmd extends BaseCmd {
return domain;
}
- public Long getDomainId(){
+ public Long getDomainId() {
return domainId;
}
- public String getNetworkType(){
+ public String getNetworkType() {
return networkType;
}
@@ -163,11 +162,11 @@ public class CreateZoneCmd extends BaseCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Zone Name: "+getZoneName());
+ public void execute() {
+ CallContext.current().setEventDetails("Zone Name: " + getZoneName());
DataCenter result = _configService.createZone(this);
- if (result != null){
- ZoneResponse response = _responseGenerator.createZoneResponse(result,false);
+ if (result != null) {
+ ZoneResponse response = _responseGenerator.createZoneResponse(result, false);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
index 98c8b4a..a107062 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
import com.cloud.user.Account;
-@APICommand(name = "deleteZone", description="Deletes a Zone.", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteZone", description = "Deletes a Zone.", responseObject = SuccessResponse.class)
public class DeleteZoneCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(DeleteZoneCmd.class.getName());
@@ -40,11 +40,9 @@ public class DeleteZoneCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ZoneResponse.class,
- required=true, description="the ID of the Zone")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "the ID of the Zone")
private Long id;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -53,7 +51,6 @@ public class DeleteZoneCmd extends BaseCmd {
return id;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -69,8 +66,8 @@ public class DeleteZoneCmd extends BaseCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Zone Id: "+getId());
+ public void execute() {
+ CallContext.current().setEventDetails("Zone Id: " + getId());
boolean result = _configService.deleteZone(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/admin/zone/MarkDefaultZoneForAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
index 5696bfd..26d93e7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
@@ -32,7 +32,7 @@ import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
-@APICommand(name = "markDefaultZoneForAccount", description="Marks a default zone for this account", responseObject=AccountResponse.class, since="4.0")
+@APICommand(name = "markDefaultZoneForAccount", description = "Marks a default zone for this account", responseObject = AccountResponse.class, since = "4.0")
public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(MarkDefaultZoneForAccountCmd.class.getName());
@@ -42,16 +42,25 @@ public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
////////////////API parameters //////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, entityType=AccountResponse.class,
- required=true, description="Name of the account that is to be marked.")
+ @Parameter(name = ApiConstants.ACCOUNT,
+ type = CommandType.STRING,
+ entityType = AccountResponse.class,
+ required = true,
+ description = "Name of the account that is to be marked.")
private String accountName;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
- required=true, description="Marks the account that belongs to the specified domain.")
+ @Parameter(name = ApiConstants.DOMAIN_ID,
+ type = CommandType.UUID,
+ entityType = DomainResponse.class,
+ required = true,
+ description = "Marks the account that belongs to the specified domain.")
private Long domainId;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
- required=true, description="The Zone ID with which the account is to be marked.")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ required = true,
+ description = "The Zone ID with which the account is to be marked.")
private Long defaultZoneId;
/////////////////////////////////////////////////////
@@ -91,7 +100,7 @@ public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "Marking account with the default zone: " + getDefaultZoneId();
+ return "Marking account with the default zone: " + getDefaultZoneId();
}
@Override
@@ -100,16 +109,14 @@ public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
- Account result = _configService.markDefaultZone(getAccountName(),getDomainId(), getDefaultZoneId());
+ public void execute() {
+ Account result = _configService.markDefaultZone(getAccountName(), getDomainId(), getDefaultZoneId());
if (result != null) {
AccountResponse response = _responseGenerator.createAccountResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
- }
- else {
+ } else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to mark the account with the default zone");
}
}
}
-
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
index c888995..25e13e2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
@@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
import com.cloud.dc.DataCenter;
import com.cloud.user.Account;
-@APICommand(name = "updateZone", description="Updates a Zone.", responseObject=ZoneResponse.class)
+@APICommand(name = "updateZone", description = "Updates a Zone.", responseObject = ZoneResponse.class)
public class UpdateZoneCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateZoneCmd.class.getName());
@@ -43,53 +43,54 @@ public class UpdateZoneCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, description="the first DNS for the Zone")
+ @Parameter(name = ApiConstants.DNS1, type = CommandType.STRING, description = "the first DNS for the Zone")
private String dns1;
- @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
+ @Parameter(name = ApiConstants.DNS2, type = CommandType.STRING, description = "the second DNS for the Zone")
private String dns2;
- @Parameter(name=ApiConstants.IP6_DNS1, type=CommandType.STRING, description="the first DNS for IPv6 network in the Zone")
+ @Parameter(name = ApiConstants.IP6_DNS1, type = CommandType.STRING, description = "the first DNS for IPv6 network in the Zone")
private String ip6Dns1;
- @Parameter(name=ApiConstants.IP6_DNS2, type=CommandType.STRING, description="the second DNS for IPv6 network in the Zone")
+ @Parameter(name = ApiConstants.IP6_DNS2, type = CommandType.STRING, description = "the second DNS for IPv6 network in the Zone")
private String ip6Dns2;
- @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
+ @Parameter(name = ApiConstants.GUEST_CIDR_ADDRESS, type = CommandType.STRING, description = "the guest CIDR address for the Zone")
private String guestCidrAddress;
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ZoneResponse.class,
- required=true, description="the ID of the Zone")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "the ID of the Zone")
private Long id;
- @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, description="the first internal DNS for the Zone")
+ @Parameter(name = ApiConstants.INTERNAL_DNS1, type = CommandType.STRING, description = "the first internal DNS for the Zone")
private String internalDns1;
- @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
+ @Parameter(name = ApiConstants.INTERNAL_DNS2, type = CommandType.STRING, description = "the second internal DNS for the Zone")
private String internalDns2;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the Zone")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the Zone")
private String zoneName;
- @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="updates a private zone to public if set, but not vice-versa")
+ @Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "updates a private zone to public if set, but not vice-versa")
private Boolean isPublic;
- @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
+ @Parameter(name = ApiConstants.ALLOCATION_STATE, type = CommandType.STRING, description = "Allocation state of this cluster for allocation of new resources")
private String allocationState;
- @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the Zone")
+ @Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "the details for the Zone")
private Map details;
- @Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
+ @Parameter(name = ApiConstants.DHCP_PROVIDER, type = CommandType.STRING, description = "the dhcp Provider for the Zone")
private String dhcpProvider;
- @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone; empty string will update domain with NULL value")
+ @Parameter(name = ApiConstants.DOMAIN,
+ type = CommandType.STRING,
+ description = "Network domain name for the networks in the zone; empty string will update domain with NULL value")
private String domain;
- @Parameter(name=ApiConstants.DNS_SEARCH_ORDER, type=CommandType.LIST, collectionType = CommandType.STRING, description="the dns search order list")
+ @Parameter(name = ApiConstants.DNS_SEARCH_ORDER, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the dns search order list")
private List<String> dnsSearchOrder;
- @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
+ @Parameter(name = ApiConstants.LOCAL_STORAGE_ENABLED, type = CommandType.BOOLEAN, description = "true if local storage offering enabled, false otherwise")
private Boolean localStorageEnabled;
/////////////////////////////////////////////////////
@@ -175,8 +176,8 @@ public class UpdateZoneCmd extends BaseCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Zone Id: "+getId());
+ public void execute() {
+ CallContext.current().setEventDetails("Zone Id: " + getId());
DataCenter result = _configService.editZone(this);
if (result != null) {
ZoneResponse response = _responseGenerator.createZoneResponse(result, false);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
index 6a86254..adc4009 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
@@ -32,8 +32,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.projects.Project;
-
-@APICommand(name = "addAccountToProject", description="Adds acoount to a project", responseObject=SuccessResponse.class, since="3.0.0")
+@APICommand(name = "addAccountToProject", description = "Adds acoount to a project", responseObject = SuccessResponse.class, since = "3.0.0")
public class AddAccountToProjectCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AddAccountToProjectCmd.class.getName());
@@ -43,21 +42,23 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- required=true, description="id of the project to add the account to")
+ @Parameter(name = ApiConstants.PROJECT_ID,
+ type = CommandType.UUID,
+ entityType = ProjectResponse.class,
+ required = true,
+ description = "id of the project to add the account to")
private Long projectId;
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="name of the account to be added to the project")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "name of the account to be added to the project")
private String accountName;
- @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, description="email to which invitation to the project is going to be sent")
+ @Parameter(name = ApiConstants.EMAIL, type = CommandType.STRING, description = "email to which invitation to the project is going to be sent")
private String email;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
public String getAccountName() {
return accountName;
}
@@ -66,7 +67,6 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
return projectId;
}
-
public String getEmail() {
return email;
}
@@ -81,12 +81,12 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
@Override
- public void execute(){
+ public void execute() {
if (accountName == null && email == null) {
throw new InvalidParameterValueException("Either accountName or email is required");
}
- CallContext.current().setEventDetails("Project id: "+ projectId + "; accountName " + accountName);
+ CallContext.current().setEventDetails("Project id: " + projectId + "; accountName " + accountName);
boolean result = _projectService.addAccountToProject(getProjectId(), getAccountName(), getEmail());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@@ -98,7 +98,7 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
@Override
public long getEntityOwnerId() {
- Project project= _projectService.getProject(getProjectId());
+ Project project = _projectService.getProject(getProjectId());
//verify input parameters
if (project == null) {
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id");
@@ -117,9 +117,9 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
if (accountName != null) {
- return "Adding account " + getAccountName() + " to project: " + getProjectId();
+ return "Adding account " + getAccountName() + " to project: " + getProjectId();
} else {
- return "Sending invitation to email " + email + " to join project: " + getProjectId();
+ return "Sending invitation to email " + email + " to join project: " + getProjectId();
}
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
index fcb0574..64c20ec 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
@@ -33,7 +33,7 @@ import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.projects.Project;
-@APICommand(name = "deleteAccountFromProject", description="Deletes account from the project", responseObject=SuccessResponse.class, since="3.0.0")
+@APICommand(name = "deleteAccountFromProject", description = "Deletes account from the project", responseObject = SuccessResponse.class, since = "3.0.0")
public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteProjectCmd.class.getName());
@@ -42,20 +42,20 @@ public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- required=true, description="id of the project to remove the account from")
+ @Parameter(name = ApiConstants.PROJECT_ID,
+ type = CommandType.UUID,
+ entityType = ProjectResponse.class,
+ required = true,
+ description = "id of the project to remove the account from")
private Long projectId;
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="name of the account to be removed from the project")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = true, description = "name of the account to be removed from the project")
private String accountName;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
-
-
@Override
public String getCommandName() {
return s_name;
@@ -74,8 +74,8 @@ public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
}
@Override
- public void execute(){
- CallContext.current().setEventDetails("Project id: "+ projectId + "; accountName " + accountName);
+ public void execute() {
+ CallContext.current().setEventDetails("Project id: " + projectId + "; accountName " + accountName);
boolean result = _projectService.deleteAccountFromProject(projectId, accountName);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@@ -85,10 +85,9 @@ public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
}
}
-
@Override
public long getEntityOwnerId() {
- Project project= _projectService.getProject(projectId);
+ Project project = _projectService.getProject(projectId);
//verify input parameters
if (project == null) {
throw new InvalidParameterValueException("Unable to find project by id " + projectId);
@@ -104,6 +103,6 @@ public class DeleteAccountFromProjectCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return "Removing account " + accountName + " from project: " + projectId;
+ return "Removing account " + accountName + " from project: " + projectId;
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
index ebf2e4b..9faae8c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
@@ -24,7 +24,7 @@ import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.log4j.Logger;
-@APICommand(name = "listAccounts", description="Lists accounts and provides detailed account information for listed accounts", responseObject=AccountResponse.class)
+@APICommand(name = "listAccounts", description = "Lists accounts and provides detailed account information for listed accounts", responseObject = AccountResponse.class)
public class ListAccountsCmd extends BaseListDomainResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListAccountsCmd.class.getName());
private static final String s_name = "listaccountsresponse";
@@ -33,20 +33,21 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ACCOUNT_TYPE, type=CommandType.LONG, description="list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).")
+ @Parameter(name = ApiConstants.ACCOUNT_TYPE,
+ type = CommandType.LONG,
+ description = "list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).")
private Long accountType;
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = AccountResponse.class,
- description="list account by account ID")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AccountResponse.class, description = "list account by account ID")
private Long id;
- @Parameter(name=ApiConstants.IS_CLEANUP_REQUIRED, type=CommandType.BOOLEAN, description="list accounts by cleanuprequred attribute (values are true or false)")
+ @Parameter(name = ApiConstants.IS_CLEANUP_REQUIRED, type = CommandType.BOOLEAN, description = "list accounts by cleanuprequred attribute (values are true or false)")
private Boolean cleanupRequired;
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list account by account name")
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "list account by account name")
private String searchName;
- @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="list accounts by state. Valid states are enabled, disabled, and locked.")
+ @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "list accounts by state. Valid states are enabled, disabled, and locked.")
private String state;
/////////////////////////////////////////////////////
@@ -73,7 +74,6 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
return state;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -84,7 +84,7 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
ListResponse<AccountResponse> response = _queryService.searchForAccounts(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/account/ListProjectAccountsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
index c91e2f2..1df341a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
@@ -27,7 +27,7 @@ import org.apache.log4j.Logger;
import com.cloud.user.Account;
-@APICommand(name = "listProjectAccounts", description="Lists project's accounts", responseObject=ProjectResponse.class, since="3.0.0")
+@APICommand(name = "listProjectAccounts", description = "Lists project's accounts", responseObject = ProjectResponse.class, since = "3.0.0")
public class ListProjectAccountsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListProjectAccountsCmd.class.getName());
@@ -37,15 +37,15 @@ public class ListProjectAccountsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- required=true, description="id of the project")
+ @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, required = true, description = "id of the project")
private Long projectId;
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="list accounts of the project by account name")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list accounts of the project by account name")
private String accountName;
- @Parameter(name=ApiConstants.ROLE, type=CommandType.STRING, description="list accounts of the project by role")
+ @Parameter(name = ApiConstants.ROLE, type = CommandType.STRING, description = "list accounts of the project by role")
private String role;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -54,17 +54,14 @@ public class ListProjectAccountsCmd extends BaseListCmd {
return accountName;
}
-
public Long getProjectId() {
return projectId;
}
-
public String getRole() {
return role;
}
-
@Override
public String getCommandName() {
return s_name;
@@ -72,18 +69,17 @@ public class ListProjectAccountsCmd extends BaseListCmd {
@Override
public long getEntityOwnerId() {
- //TODO - return project entity ownerId
+ //TODO - return project entity ownerId
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
- public void execute(){
+ public void execute() {
ListResponse<ProjectAccountResponse> response = _queryService.listProjectAccounts(this);
response.setResponseName(getCommandName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index 48ffd12..e06ba25 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@ -55,7 +55,7 @@ import com.cloud.offering.NetworkOffering;
import com.cloud.projects.Project;
import com.cloud.user.Account;
-@APICommand(name = "associateIpAddress", description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
+@APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account.", responseObject = IPAddressResponse.class)
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName());
private static final String s_name = "associateipaddressresponse";
@@ -64,44 +64,43 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING,
- description="the account to associate with this IP address")
+ @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account to associate with this IP address")
private String accountName;
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
- description="the ID of the domain to associate with this IP address")
+ @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the ID of the domain to associate with this IP address")
private Long domainId;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="the ID of the availability zone you want to acquire an public IP address from")
+ @Parameter(name = ApiConstants.ZONE_ID,
+ type = CommandType.UUID,
+ entityType = ZoneResponse.class,
+ description = "the ID of the availability zone you want to acquire an public IP address from")
private Long zoneId;
- @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="The network this ip address should be associated to.")
+ @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "The network this ip address should be associated to.")
private Long networkId;
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
- description="Deploy vm for the project")
+ @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Deploy vm for the project")
private Long projectId;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- description="the VPC you want the ip address to " +
- "be associated with")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC you want the ip address to " + "be associated with")
private Long vpcId;
- @Parameter(name=ApiConstants.IS_PORTABLE, type = BaseCmd.CommandType.BOOLEAN, description = "should be set to true " +
- "if public IP is required to be transferable across zones, if not specified defaults to false")
+ @Parameter(name = ApiConstants.IS_PORTABLE,
+ type = BaseCmd.CommandType.BOOLEAN,
+ description = "should be set to true " + "if public IP is required to be transferable across zones, if not specified defaults to false")
private Boolean isPortable;
- @Parameter(name=ApiConstants.REGION_ID, type=CommandType.INTEGER, entityType = RegionResponse.class,
- required=false, description="region ID from where portable ip is to be associated.")
+ @Parameter(name = ApiConstants.REGION_ID,
+ type = CommandType.INTEGER,
+ entityType = RegionResponse.class,
+ required = false,
+ description = "region ID from where portable ip is to be associated.")
private Integer regionId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
public String getAccountName() {
if (accountName != null) {
return accountName;
@@ -166,12 +165,10 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId);
if (zone.getNetworkType() == NetworkType.Advanced) {
- List<? extends Network> networks = _networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(),
- _accountService.getAccount(getEntityOwnerId()));
+ List<? extends Network> networks = _networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(), _accountService.getAccount(getEntityOwnerId()));
if (networks.size() == 0) {
String domain = _domainService.getDomain(getDomainId()).getName();
- throw new InvalidParameterValueException("Account name=" + getAccountName() + " domain=" + domain +
- " doesn't have virtual networks in zone=" + zone.getName());
+ throw new InvalidParameterValueException("Account name=" + getAccountName() + " domain=" + domain + " doesn't have virtual networks in zone=" + zone.getName());
}
if (networks.size() < 1) {
@@ -184,8 +181,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
} else {
Network defaultGuestNetwork = _networkService.getExclusiveGuestNetwork(zoneId);
if (defaultGuestNetwork == null) {
- throw new InvalidParameterValueException("Unable to find a default Guest network for account " +
- getAccountName() + " in domain id=" + getDomainId());
+ throw new InvalidParameterValueException("Unable to find a default Guest network for account " + getAccountName() + " in domain id=" + getDomainId());
} else {
return defaultGuestNetwork.getId();
}
@@ -204,13 +200,12 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
if (project.getState() == Project.State.Active) {
return project.getProjectAccountId();
} else {
- throw new PermissionDeniedException("Can't add resources to the project with specified projectId in state="
- + project.getState() + " as it's no longer active");
+ throw new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + " as it's no longer active");
}
} else {
throw new InvalidParameterValueException("Unable to find project by id");
}
- } else if (networkId != null){
+ } else if (networkId != null) {
Network network = _networkService.getNetwork(networkId);
if (network == null) {
throw new InvalidParameterValueException("Unable to find network by network id specified");
@@ -249,14 +244,13 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
@Override
public String getEventDescription() {
- return "associating ip to network id: " + getNetworkId() + " in zone " + getZoneId();
+ return "associating ip to network id: " + getNetworkId() + " in zone " + getZoneId();
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
@Override
public String getCommandName() {
return s_name;
@@ -267,12 +261,12 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
}
@Override
- public void create() throws ResourceAllocationException{
+ public void create() throws ResourceAllocationException {
try {
IpAddress ip = null;
if (!isPortable()) {
- ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNetworkId());
+ ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNetworkId());
} else {
ip = _networkService.allocatePortableIP(_accountService.getAccount(getEntityOwnerId()), 1, getZoneId(), getNetworkId(), getVpcId());
}
@@ -294,8 +288,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
}
@Override
- public void execute() throws ResourceUnavailableException, ResourceAllocationException,
- ConcurrentOperationException, InsufficientCapacityException {
+ public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
CallContext.current().setEventDetails("Ip Id: " + getEntityId());
IpAddress result = null;
@@ -315,7 +308,6 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
}
}
-
@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/address/DisassociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
index 4798823..6d581a9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
@@ -36,7 +36,7 @@ import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.IpAddress;
import com.cloud.user.Account;
-@APICommand(name = "disassociateIpAddress", description="Disassociates an ip address from the account.", responseObject=SuccessResponse.class)
+@APICommand(name = "disassociateIpAddress", description = "Disassociates an ip address from the account.", responseObject = SuccessResponse.class)
public class DisassociateIPAddrCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DisassociateIPAddrCmd.class.getName());
@@ -46,15 +46,14 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID,entityType = IPAddressResponse.class,
- required=true, description="the id of the public ip address" +
- " to disassociate")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the id of the public ip address"
+ + " to disassociate")
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 ///////////////////////
/////////////////////////////////////////////////////
@@ -73,7 +72,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
}
@Override
- public void execute() throws InsufficientAddressCapacityException{
+ public void execute() throws InsufficientAddressCapacityException {
CallContext.current().setEventDetails("Ip Id: " + getIpAddressId());
boolean result = false;
if (!isPortable(id)) {
@@ -100,7 +99,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Disassociating ip address with id=" + id);
+ return ("Disassociating ip address with id=" + id);
}
@Override
@@ -152,6 +151,6 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd {
private boolean isPortable(long id) {
IpAddress ip = getIpAddress(id);
- return ip.isPortable();
+ return ip.isPortable();
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
index bc179b2..7b7a3a7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
@@ -36,7 +36,7 @@ import org.apache.log4j.Logger;
import com.cloud.network.IpAddress;
import com.cloud.utils.Pair;
-@APICommand(name = "listPublicIpAddresses", description="Lists all public ip addresses", responseObject=IPAddressResponse.class)
+@APICommand(name = "listPublicIpAddresses", description = "Lists all public ip addresses", responseObject = IPAddressResponse.class)
public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmd.class.getName());
@@ -46,46 +46,46 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @Parameter(name=ApiConstants.ALLOCATED_ONLY, type=CommandType.BOOLEAN, description="limits search results to allocated public IP addresses")
+ @Parameter(name = ApiConstants.ALLOCATED_ONLY, type = CommandType.BOOLEAN, description = "limits search results to allocated public IP addresses")
private Boolean allocatedOnly;
- @Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="the virtual network for the IP address")
+ @Parameter(name = ApiConstants.FOR_VIRTUAL_NETWORK, type = CommandType.BOOLEAN, description = "the virtual network for the IP address")
private Boolean forVirtualNetwork;
- @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = IPAddressResponse.class,
- description="lists ip address by id")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, description = "lists ip address by id")
private Long id;
- @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="lists the specified IP address")
+ @Parameter(name = ApiConstants.IP_ADDRESS, type = CommandType.STRING, description = "lists the specified IP address")
private String ipAddress;
- @Parameter(name=ApiConstants.VLAN_ID, type=CommandType.UUID, entityType = VlanIpRangeResponse.class,
- description="lists all public IP addresses by VLAN ID")
+ @Parameter(name = ApiConstants.VLAN_ID, type = CommandType.UUID, entityType = VlanIpRangeResponse.class, description = "lists all public IP addresses by VLAN ID")
private Long vlanId;
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
- description="lists all public IP addresses by Zone ID")
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "lists all public IP addresses by Zone ID")
private Long zoneId;
- @Parameter(name=ApiConstants.FOR_LOAD_BALANCING, type=CommandType.BOOLEAN, description="list only ips used for load balancing")
+ @Parameter(name = ApiConstants.FOR_LOAD_BALANCING, type = CommandType.BOOLEAN, description = "list only ips used for load balancing")
private Boolean forLoadBalancing;
- @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
- description="lists all public IP addresses by physical network id")
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = PhysicalNetworkResponse.class,
+ description = "lists all public IP addresses by physical network id")
private Long physicalNetworkId;
- @Parameter(name=ApiConstants.ASSOCIATED_NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
- description="lists all public IP addresses associated to the network specified")
+ @Parameter(name = ApiConstants.ASSOCIATED_NETWORK_ID,
+ type = CommandType.UUID,
+ entityType = NetworkResponse.class,
+ description = "lists all public IP addresses associated to the network specified")
private Long associatedNetworkId;
- @Parameter(name=ApiConstants.IS_SOURCE_NAT, type=CommandType.BOOLEAN, description="list only source nat ip addresses")
+ @Parameter(name = ApiConstants.IS_SOURCE_NAT, type = CommandType.BOOLEAN, description = "list only source nat ip addresses")
private Boolean isSourceNat;
- @Parameter(name=ApiConstants.IS_STATIC_NAT, type=CommandType.BOOLEAN, description="list only static nat ip addresses")
+ @Parameter(name = ApiConstants.IS_STATIC_NAT, type = CommandType.BOOLEAN, description = "list only static nat ip addresses")
private Boolean isStaticNat;
- @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = VpcResponse.class,
- description="List ips belonging to the VPC")
+ @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "List ips belonging to the VPC")
private Long vpcId;
/////////////////////////////////////////////////////
@@ -144,7 +144,7 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
}
@Override
- public void execute(){
+ public void execute() {
Pair<List<? extends IpAddress>, Integer> result = _mgr.searchForIPAddresses(this);
ListResponse<IPAddressResponse> response = new ListResponse<IPAddressResponse>();
List<IPAddressResponse> ipAddrResponses = new ArrayList<IPAddressResponse>();
@@ -163,7 +163,6 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd {
return ApiCommandJobType.IpAddress;
}
-
public Boolean isForLoadBalancing() {
return forLoadBalancing;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
index 59b9f17..2dbe8d9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java
@@ -56,10 +56,12 @@ public class CreateAffinityGroupCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "name of the affinity group")
private String affinityGroupName;
- @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, required = true, description = "Type of the affinity group from the available affinity/anti-affinity group types")
+ @Parameter(name = ApiConstants.TYPE,
+ type = CommandType.STRING,
+ required = true,
+ description = "Type of the affinity group from the available affinity/anti-affinity group types")
private String affinityGroupType;
-
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@@ -122,15 +124,13 @@ public class CreateAffinityGroupCmd extends BaseAsyncCreateCmd {
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create affinity group:"
- + affinityGroupName);
+ throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create affinity group:" + affinityGroupName);
}
}
@Override
public void create() throws ResourceAllocationException {
- AffinityGroup result = _affinityGroupService.createAffinityGroup(accountName, domainId, affinityGroupName,
- affinityGroupType, description);
+ AffinityGroup result = _affinityGroupService.createAffinityGroup(accountName, domainId, affinityGroupName, affinityGroupType, description);
if (result != null) {
setEntityId(result.getId());
setEntityUuid(result.getUuid());