aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2019-09-11 14:59:19 +0530
committerTakamune Cho <takamune.cho@att.com>2019-09-17 14:58:12 +0000
commit0f6afc371e2e8d426866c6fba4a77c160f1102b9 (patch)
tree831d90c39a266de900a5723340cbd12440b14462 /appc-adapters
parent151924670b390b8811283802ae7e20c3d63505da (diff)
Sonar fix: APPC-1717
Fixed sonar issues across these files Issue-ID: APPC-1717 Change-Id: I25fc139344e88d389e24b91a7d6796fea6f251c2 Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'appc-adapters')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java4
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/LookupServer.java13
2 files changed, 10 insertions, 7 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
index 4715860de..cfd816e14 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
@@ -8,6 +8,8 @@
* ================================================================================
* Modifications Copyright (C) 2019 Ericsson
* =============================================================================
+ * Modification Copyright (C) 2019 IBM
+ * =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -359,7 +361,7 @@ public class EvacuateServer extends ProviderServerOperation {
}
private void setTimeForMetricsLogger() {
- String timestamp = LoggingUtils.generateTimestampStr(((Date) new Date()).toInstant());
+ String timestamp = LoggingUtils.generateTimestampStr((new Date()).toInstant());
MDC.put(LoggingConstants.MDCKeys.BEGIN_TIMESTAMP, timestamp);
MDC.put(LoggingConstants.MDCKeys.END_TIMESTAMP, timestamp);
MDC.put(LoggingConstants.MDCKeys.ELAPSED_TIME, "0");
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/LookupServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/LookupServer.java
index 3fdb76722..4ca036595 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/LookupServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/LookupServer.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modification Copyright (C) 2019 IBM
+ * =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -51,7 +53,7 @@ public class LookupServer extends ProviderServerOperation {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(EvacuateServer.class);
private static final Configuration configuration = ConfigurationFactory.getConfiguration();
-
+ private static final String serverFound = "serverFound";
public Server lookupServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
Server server = null;
@@ -76,14 +78,13 @@ public class LookupServer extends ProviderServerOperation {
String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, e, vmUrl);
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
- ctx.setAttribute("serverFound", "failure");
+ ctx.setAttribute(serverFound, "failure");
}
return server;
}
private Server lookupServerNested(Map<String, String> params, Server server, RequestContext rqstCtx, SvcLogicContext ctx,
- String appName, VMURL vm, String vmUrl)
- throws APPCException {
+ String appName, VMURL vm, String vmUrl) {
// use try with resource to ensure context is closed (returned to pool)
try (Context context = resolveContext(rqstCtx, params, appName, vmUrl)) {
@@ -92,7 +93,7 @@ public class LookupServer extends ProviderServerOperation {
rqstCtx.reset();
server = lookupServer(rqstCtx, context, vm.getServerId());
logger.debug(Msg.SERVER_FOUND, vmUrl, context.getTenantName(), server.getStatus().toString());
- ctx.setAttribute("serverFound", "success");
+ ctx.setAttribute(serverFound, "success");
String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "LookupServer", vmUrl);
ctx.setAttribute(org.onap.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
doSuccess(rqstCtx);
@@ -102,7 +103,7 @@ public class LookupServer extends ProviderServerOperation {
String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, e, vmUrl);
logger.error(msg);
doFailure(rqstCtx, HttpStatus.NOT_FOUND_404, msg);
- ctx.setAttribute("serverFound", "failure");
+ ctx.setAttribute(serverFound, "failure");
} catch (IOException e) {
// exception closing context
String msg = EELFResourceManager.format(Msg.CLOSE_CONTEXT_FAILED, e, vmUrl);