diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-28 13:35:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-28 13:35:55 +0000 |
commit | 57b9a52289ab4c4590a9cb7c5a537c3484bfe28a (patch) | |
tree | 84b3379b22cca13388f63c46b5f0413b70c2d595 /mso-api-handlers | |
parent | 947249a450e6c849710b750867a9b92300ff384f (diff) | |
parent | db688957ef17ee577ef7dba10b9f7b9956085a41 (diff) |
Merge "Sonar comments fixed Removed commented lines/ Change static string litrals name according to the guidelines. Issue-ID: SO-1490"
Diffstat (limited to 'mso-api-handlers')
3 files changed, 34 insertions, 32 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/GetE2EServiceInstanceResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/GetE2EServiceInstanceResponse.java index f7fa01aeb0..4fc6181bf8 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/GetE2EServiceInstanceResponse.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/GetE2EServiceInstanceResponse.java @@ -29,13 +29,7 @@ public class GetE2EServiceInstanceResponse { protected OperationStatus operation; - // public OperationStatus getOperationStatus() { - // return operation; - // } - // - // public void setOperationStatus(OperationStatus requestDB) { - // this.operation = requestDB; - // } + public OperationStatus getOperation() { return operation; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolationbeans/Manifest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolationbeans/Manifest.java index 4c66a3118e..c50f18c594 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolationbeans/Manifest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolationbeans/Manifest.java @@ -34,7 +34,7 @@ public class Manifest implements Serializable { private static final long serialVersionUID = -3460949513229380541L; @JsonProperty("serviceModelList") - private List<ServiceModelList> serviceModelList = new ArrayList<ServiceModelList>(); + private List<ServiceModelList> serviceModelList = new ArrayList<>(); public List<ServiceModelList> getServiceModelList() { return serviceModelList; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java index 907bc942eb..2cf01f9390 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java @@ -29,51 +29,59 @@ import org.onap.so.utils.UUIDChecker; public class InstanceIdMapValidation implements ValidationRule { + private static final String Service_InstanceId = "serviceInstanceId"; + private static final String Vnf_InstanceId = "vnfInstanceId"; + private static final String vfModule_InstanceId = "vfModuleInstanceId"; + + private static final String volume_Group_InstanceId = "volumeGroupInstanceId"; + private static final String Network_Instance_Id = "networkInstanceId"; + private static final String Configuration_Instance_Id = "configurationInstanceId"; + @Override public ValidationInformation validate(ValidationInformation info) throws ValidationException { HashMap<String, String> instanceIdMap = info.getInstanceIdMap(); ServiceInstancesRequest sir = info.getSir(); if (instanceIdMap != null) { - if (instanceIdMap.get("serviceInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("serviceInstanceId"))) { - throw new ValidationException("serviceInstanceId"); + if (instanceIdMap.get(Service_InstanceId) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(Service_InstanceId))) { + throw new ValidationException(Service_InstanceId); } - sir.setServiceInstanceId(instanceIdMap.get("serviceInstanceId")); + sir.setServiceInstanceId(instanceIdMap.get(Service_InstanceId)); } - if (instanceIdMap.get("vnfInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("vnfInstanceId"))) { - throw new ValidationException("vnfInstanceId"); + if (instanceIdMap.get(Vnf_InstanceId) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(Vnf_InstanceId))) { + throw new ValidationException(Vnf_InstanceId); } - sir.setVnfInstanceId(instanceIdMap.get("vnfInstanceId")); + sir.setVnfInstanceId(instanceIdMap.get(Vnf_InstanceId)); } - if (instanceIdMap.get("vfModuleInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("vfModuleInstanceId"))) { - throw new ValidationException("vfModuleInstanceId"); + if (instanceIdMap.get(vfModule_InstanceId) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(vfModule_InstanceId))) { + throw new ValidationException(vfModule_InstanceId); } - sir.setVfModuleInstanceId(instanceIdMap.get("vfModuleInstanceId")); + sir.setVfModuleInstanceId(instanceIdMap.get(vfModule_InstanceId)); } - if (instanceIdMap.get("volumeGroupInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("volumeGroupInstanceId"))) { - throw new ValidationException("volumeGroupInstanceId"); + if (instanceIdMap.get(volume_Group_InstanceId) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(volume_Group_InstanceId))) { + throw new ValidationException(volume_Group_InstanceId); } - sir.setVolumeGroupInstanceId(instanceIdMap.get("volumeGroupInstanceId")); + sir.setVolumeGroupInstanceId(instanceIdMap.get(volume_Group_InstanceId)); } - if (instanceIdMap.get("networkInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("networkInstanceId"))) { - throw new ValidationException("networkInstanceId"); + if (instanceIdMap.get(Network_Instance_Id) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(Network_Instance_Id))) { + throw new ValidationException(Network_Instance_Id); } - sir.setNetworkInstanceId(instanceIdMap.get("networkInstanceId")); + sir.setNetworkInstanceId(instanceIdMap.get(Network_Instance_Id)); } - if (instanceIdMap.get("configurationInstanceId") != null) { - if (!UUIDChecker.isValidUUID(instanceIdMap.get("configurationInstanceId"))) { - throw new ValidationException("configurationInstanceId"); + if (instanceIdMap.get(Configuration_Instance_Id) != null) { + if (!UUIDChecker.isValidUUID(instanceIdMap.get(Configuration_Instance_Id))) { + throw new ValidationException(Configuration_Instance_Id); } - sir.setConfigurationId(instanceIdMap.get("configurationInstanceId")); + sir.setConfigurationId(instanceIdMap.get(Configuration_Instance_Id)); } if (instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID) != null) { |