summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorSubhosree Pan <subhosree.pan1@huawei.com>2019-04-25 11:56:52 +0000
committerSeshu Kumar M <seshu.kumar.m@huawei.com>2019-04-27 07:02:17 +0000
commitdb688957ef17ee577ef7dba10b9f7b9956085a41 (patch)
tree317fcc9f84a7cfc0ee9136cda261e87b922899a1 /mso-api-handlers
parent80462c509ef9ce3241b4cdf3e7f8fe5f6ab74974 (diff)
Sonar comments fixed
Removed commented lines/ Change static string litrals name according to the guidelines. Issue-ID: SO-1490 Change-Id: I4ffee97269f0f0bdcb23f5b297df8fddb0c133f1 Signed-off-by: Subhosree Pan <subhosree.pan1@huawei.com>
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/GetE2EServiceInstanceResponse.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolationbeans/Manifest.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java56
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) {