refactoring

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
This commit is contained in:
Abhishek Kumar 2019-04-10 13:08:00 +05:30 committed by Abhishek Kumar
parent 977c5b7614
commit e2bb43a392
4 changed files with 27 additions and 27 deletions

View File

@ -181,7 +181,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
} }
public List<Long> getDomainIds() { public List<Long> getDomainIds() {
if(CollectionUtils.isNotEmpty(domainIds)) { if (CollectionUtils.isNotEmpty(domainIds)) {
Set<Long> set = new LinkedHashSet<>(domainIds); Set<Long> set = new LinkedHashSet<>(domainIds);
domainIds.clear(); domainIds.clear();
domainIds.addAll(set); domainIds.addAll(set);
@ -190,7 +190,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
} }
public List<Long> getZoneIds() { public List<Long> getZoneIds() {
if(CollectionUtils.isNotEmpty(zoneIds)) { if (CollectionUtils.isNotEmpty(zoneIds)) {
Set<Long> set = new LinkedHashSet<>(zoneIds); Set<Long> set = new LinkedHashSet<>(zoneIds);
zoneIds.clear(); zoneIds.clear();
zoneIds.addAll(set); zoneIds.addAll(set);
@ -250,7 +250,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
return storageType; return storageType;
} }
public String getProvisioningType(){ public String getProvisioningType() {
return provisioningType; return provisioningType;
} }

View File

@ -77,8 +77,8 @@ public class CreateServiceOfferingCmd extends BaseCmd {
private Boolean limitCpuUse; private Boolean limitCpuUse;
@Parameter(name = ApiConstants.IS_VOLATILE, @Parameter(name = ApiConstants.IS_VOLATILE,
type = CommandType.BOOLEAN, type = CommandType.BOOLEAN,
description = "true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM") description = "true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM")
private Boolean isVolatile; private Boolean isVolatile;
@Parameter(name = ApiConstants.STORAGE_TYPE, type = CommandType.STRING, description = "the storage type of the service offering. Values are local and shared.") @Parameter(name = ApiConstants.STORAGE_TYPE, type = CommandType.STRING, description = "the storage type of the service offering. Values are local and shared.")
@ -109,18 +109,18 @@ public class CreateServiceOfferingCmd extends BaseCmd {
private Boolean isSystem; private Boolean isSystem;
@Parameter(name = ApiConstants.SYSTEM_VM_TYPE, @Parameter(name = ApiConstants.SYSTEM_VM_TYPE,
type = CommandType.STRING, type = CommandType.STRING,
description = "the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".") description = "the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".")
private String systemVmType; private String systemVmType;
@Parameter(name = ApiConstants.NETWORKRATE, @Parameter(name = ApiConstants.NETWORKRATE,
type = CommandType.INTEGER, type = CommandType.INTEGER,
description = "data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype") description = "data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype")
private Integer networkRate; private Integer networkRate;
@Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER,
type = CommandType.STRING, type = CommandType.STRING,
description = "The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used") description = "The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used")
private String deploymentPlanner; private String deploymentPlanner;
@Parameter(name = ApiConstants.SERVICE_OFFERING_DETAILS, type = CommandType.MAP, description = "details for planner, used to store specific parameters") @Parameter(name = ApiConstants.SERVICE_OFFERING_DETAILS, type = CommandType.MAP, description = "details for planner, used to store specific parameters")
@ -228,7 +228,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
return displayText; return displayText;
} }
public String getProvisioningType(){ public String getProvisioningType() {
return provisioningType; return provisioningType;
} }
@ -264,7 +264,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
} }
public List<Long> getDomainIds() { public List<Long> getDomainIds() {
if(CollectionUtils.isNotEmpty(domainIds)) { if (CollectionUtils.isNotEmpty(domainIds)) {
Set<Long> set = new LinkedHashSet<>(domainIds); Set<Long> set = new LinkedHashSet<>(domainIds);
domainIds.clear(); domainIds.clear();
domainIds.addAll(set); domainIds.addAll(set);
@ -273,7 +273,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
} }
public List<Long> getZoneIds() { public List<Long> getZoneIds() {
if(CollectionUtils.isNotEmpty(zoneIds)) { if (CollectionUtils.isNotEmpty(zoneIds)) {
Set<Long> set = new LinkedHashSet<>(zoneIds); Set<Long> set = new LinkedHashSet<>(zoneIds);
zoneIds.clear(); zoneIds.clear();
zoneIds.addAll(set); zoneIds.addAll(set);

View File

@ -46,9 +46,9 @@ public class UpdateDiskOfferingCmd extends BaseCmd {
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
@Parameter(name = ApiConstants.DISPLAY_TEXT, @Parameter(name = ApiConstants.DISPLAY_TEXT,
type = CommandType.STRING, type = CommandType.STRING,
description = "updates alternate display text of the disk offering with this value", description = "updates alternate display text of the disk offering with this value",
length = 4096) length = 4096)
private String displayText; private String displayText;
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, required = true, description = "ID of the disk offering") @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, required = true, description = "ID of the disk offering")
@ -61,8 +61,8 @@ public class UpdateDiskOfferingCmd extends BaseCmd {
private Integer sortKey; private Integer sortKey;
@Parameter(name = ApiConstants.DISPLAY_OFFERING, @Parameter(name = ApiConstants.DISPLAY_OFFERING,
type = CommandType.BOOLEAN, type = CommandType.BOOLEAN,
description = "an optional field, whether to display the offering to the end user or not.") description = "an optional field, whether to display the offering to the end user or not.")
private Boolean displayOffering; private Boolean displayOffering;
@Parameter(name = ApiConstants.DOMAIN_ID, @Parameter(name = ApiConstants.DOMAIN_ID,
@ -105,7 +105,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd {
} }
public List<Long> getDomainIds() { public List<Long> getDomainIds() {
if(CollectionUtils.isNotEmpty(domainIds)) { if (CollectionUtils.isNotEmpty(domainIds)) {
Set<Long> set = new LinkedHashSet<>(domainIds); Set<Long> set = new LinkedHashSet<>(domainIds);
domainIds.clear(); domainIds.clear();
domainIds.addAll(set); domainIds.addAll(set);
@ -114,7 +114,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd {
} }
public List<Long> getZoneIds() { public List<Long> getZoneIds() {
if(CollectionUtils.isNotEmpty(zoneIds)) { if (CollectionUtils.isNotEmpty(zoneIds)) {
Set<Long> set = new LinkedHashSet<>(zoneIds); Set<Long> set = new LinkedHashSet<>(zoneIds);
zoneIds.clear(); zoneIds.clear();
zoneIds.addAll(set); zoneIds.addAll(set);

View File

@ -45,10 +45,10 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
//////////////// API parameters ///////////////////// //////////////// API parameters /////////////////////
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
@Parameter(name = ApiConstants.ID, @Parameter(name = ApiConstants.ID,
type = CommandType.UUID, type = CommandType.UUID,
entityType = ServiceOfferingResponse.class, entityType = ServiceOfferingResponse.class,
required = true, required = true,
description = "the ID of the service offering to be updated") description = "the ID of the service offering to be updated")
private Long id; private Long id;
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the display text of the service offering to be updated") @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description = "the display text of the service offering to be updated")
@ -96,7 +96,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
} }
public List<Long> getDomainIds() { public List<Long> getDomainIds() {
if(CollectionUtils.isNotEmpty(domainIds)) { if (CollectionUtils.isNotEmpty(domainIds)) {
Set<Long> set = new LinkedHashSet<>(domainIds); Set<Long> set = new LinkedHashSet<>(domainIds);
domainIds.clear(); domainIds.clear();
domainIds.addAll(set); domainIds.addAll(set);
@ -105,7 +105,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
} }
public List<Long> getZoneIds() { public List<Long> getZoneIds() {
if(CollectionUtils.isNotEmpty(zoneIds)) { if (CollectionUtils.isNotEmpty(zoneIds)) {
Set<Long> set = new LinkedHashSet<>(zoneIds); Set<Long> set = new LinkedHashSet<>(zoneIds);
zoneIds.clear(); zoneIds.clear();
zoneIds.addAll(set); zoneIds.addAll(set);