aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db-repositories
diff options
context:
space:
mode:
authorSindhuri.A <arcot.sindhuri@huawei.com>2019-04-21 16:03:08 +0530
committerSindhu A <arcot.sindhuri@huawei.com>2019-04-21 10:59:54 +0000
commita401cbcaf2f9a47c9f749ce5bca7b6a041f44c82 (patch)
tree9b8704966ee7be98baaef41efd479edf38e9ec74 /mso-api-handlers/mso-requests-db-repositories
parent0a355f91e1da586f70450329d8620b823d59b9e5 (diff)
Define String Literal,use in place constant
Define String Literal,use in place constant InfraActiveRequestsRepositoryImpl Issue-ID: SO-1490 Change-Id: I5310726dee33fda3e79ddcfdc8c077c0ef648e4b Signed-off-by: Sindhuri.A <arcot.sindhuri@huawei.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db-repositories')
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
index b3d57b0137..3c4b1fa66b 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
@@ -89,6 +89,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
protected static final String REQUEST_ID = "requestId";
protected static final String REQUESTOR_ID = "requestorId";
protected static final String ACTION = "action";
+ protected static final String OPENV = "operationalEnvironment";
private static final List<String> VALID_COLUMNS =
Arrays.asList(REQUEST_ID, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, ACTION, REQUEST_STATUS);
@@ -173,13 +174,13 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
predicates.add(cb.equal(tableRoot.get(NETWORK_INSTANCE_NAME), instanceName));
} else if (requestScope.equals("configuration")) {
predicates.add(cb.equal(tableRoot.get(CONFIGURATION_INSTANCE_NAME), instanceName));
- } else if (requestScope.equals("operationalEnvironment")) {
+ } else if (requestScope.equals(OPENV)) {
predicates.add(cb.equal(tableRoot.get(OPERATIONAL_ENV_NAME), instanceName));
}
} else {
if (instanceIdMap != null) {
- if ("service".equals(requestScope) && instanceIdMap.get("serviceInstanceId") != null) {
+ if ("service".equals(requestScope) && instanceIdMap.get(SERVICE_INSTANCE_ID) != null) {
predicates
.add(cb.equal(tableRoot.get(SERVICE_INSTANCE_ID), instanceIdMap.get("serviceInstanceId")));
}
@@ -208,8 +209,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
instanceIdMap.get("configurationInstanceId")));
}
- if (requestScope.equals("operationalEnvironment")
- && instanceIdMap.get("operationalEnvironmentId") != null) {
+ if (requestScope.equals(OPENV) && instanceIdMap.get("operationalEnvironmentId") != null) {
predicates.add(
cb.equal(tableRoot.get(OPERATIONAL_ENV_ID), instanceIdMap.get("operationalEnvironmentId")));
}
@@ -336,7 +336,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
// as the same requestorId can also match on different API methods
final String resourceType = orchestrationMap.get("resourceType");
if (resourceType == null) {
- predicates.add(cb.equal(tableRoot.get("requestScope"), "operationalEnvironment"));
+ predicates.add(cb.equal(tableRoot.get("requestScope"), OPENV));
}
for (final Map.Entry<String, String> entry : orchestrationMap.entrySet()) {