aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/job/command
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/InProgressStatusService.java16
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt3
7 files changed, 17 insertions, 20 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/InProgressStatusService.java b/vid-app-common/src/main/java/org/onap/vid/job/command/InProgressStatusService.java
index 3d1d78f8b..91bf5de1e 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/InProgressStatusService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/InProgressStatusService.java
@@ -20,6 +20,11 @@
package org.onap.vid.job.command;
+import static org.onap.vid.utils.TimeUtils.parseZonedDateTime;
+
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeParseException;
+import java.util.UUID;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.vid.job.Job;
import org.onap.vid.job.impl.JobSharedData;
@@ -33,12 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.togglz.core.manager.FeatureManager;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeParseException;
-import java.util.UUID;
-
-import static org.onap.vid.utils.TimeUtils.parseZonedDateTime;
-
@Service
public class InProgressStatusService {
@@ -86,8 +85,7 @@ public class InProgressStatusService {
public void handleFailedMsoResponse(UUID jobUUID, String requestId, RestObject<AsyncRequestStatus> msoResponse) {
auditService.setFailedAuditStatusFromMso(jobUUID, requestId, msoResponse.getStatusCode(), msoResponse.getRaw());
- LOGGER.error(EELFLoggerDelegate.errorLogger,
- "Failed to get orchestration status for {}. Status code: {}, Body: {}",
+ LOGGER.error("Failed to get orchestration status for {}. Status code: {}, Body: {}",
requestId, msoResponse.getStatusCode(), msoResponse.getRaw());
}
@@ -108,7 +106,7 @@ public class InProgressStatusService {
try {
jobStartTime = parseZonedDateTime(asyncRequestStatusResponse.get().request.startTime);
} catch (DateTimeParseException | NullPointerException e) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to parse start time for {}, body: {}. Current time will be used", requestId, asyncRequestStatusResponse.getRaw(), e);
+ LOGGER.error("Failed to parse start time for {}, body: {}. Current time will be used", requestId, asyncRequestStatusResponse.getRaw(), e);
jobStartTime = ZonedDateTime.now();
}
return jobStartTime;
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt
index 2fdd19100..8ce73d713 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt
@@ -62,13 +62,13 @@ class MacroServiceCommand @Autowired constructor(
//Aai return bad response while checking names uniqueness
catch (exception : ExceptionWithRequestInfo) {
- Logger.error(EELFLoggerDelegate.errorLogger, "Failed to check name uniqueness in AAI. VID will try again later", exception)
+ Logger.error("Failed to check name uniqueness in AAI. VID will try again later", exception)
throw TryAgainException(exception);
}
//Vid reached to max retries while trying to find unique name in AAI
catch (exception : MaxRetriesException) {
- Logger.error(EELFLoggerDelegate.errorLogger, "Failed to find unused name in AAI", exception)
+ Logger.error("Failed to find unused name in AAI", exception)
throw AbortingException(exception);
}
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt
index 063ef6e53..c3fdcdaeb 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt
@@ -210,7 +210,7 @@ class MsoRequestBuilder
try {
asyncInstantiationBL.updateServiceInfo(jobId) { x -> x.serviceInstanceName = serviceInstanceName }
} catch (e: Exception) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed updating service name {} in serviceInfo", serviceInstanceName, e)
+ LOGGER.error("Failed updating service name {} in serviceInfo", serviceInstanceName, e)
}
return serviceInstanceName
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
index 4477a9f24..2b5ec0127 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
@@ -153,7 +153,7 @@ abstract class ResourceCommand(
JobStatus.IN_PROGRESS
}
catch (exception: AbortingException) {
- Logger.error(EELFLoggerDelegate.errorLogger, "caught AbortingException. Set job status to FAILED")
+ Logger.error("caught AbortingException. Set job status to FAILED")
JobStatus.FAILED;
}
}
@@ -330,13 +330,13 @@ abstract class ResourceCommand(
handleInProgressStatus(jobStatus)
} catch (e: javax.ws.rs.ProcessingException) {
// Retry when we can't connect MSO during getStatus
- Logger.error(EELFLoggerDelegate.errorLogger, "Cannot get orchestration status for {}, will retry: {}", requestId, e, e)
+ Logger.error("Cannot get orchestration status for {}, will retry: {}", requestId, e, e)
JobStatus.IN_PROGRESS;
} catch (e: InProgressStatusService.BadResponseFromMso) {
inProgressStatusService.handleFailedMsoResponse(sharedData.jobUuid, requestId, e.msoResponse)
JobStatus.IN_PROGRESS
} catch (e: RuntimeException) {
- Logger.error(EELFLoggerDelegate.errorLogger, "Cannot get orchestration status for {}, stopping: {}", requestId, e, e)
+ Logger.error("Cannot get orchestration status for {}, stopping: {}", requestId, e, e)
JobStatus.STOPPED
}
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt
index 875de66d6..c4680b2bd 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt
@@ -71,13 +71,13 @@ abstract class RootServiceCommand @Autowired constructor(
try {
val requests = auditService.retrieveRequestsFromMsoByServiceIdAndRequestTypeAndScope(serviceInstanceId, requestType, scope)
if (requests.isEmpty() || requests[0].requestId == null) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to retrieve requestId with type: $type, scope: $scope for service instanceId $serviceInstanceId ")
+ LOGGER.error("Failed to retrieve requestId with type: $type, scope: $scope for service instanceId $serviceInstanceId ")
return Job.JobStatus.FAILED
}
val createMyselfCommand = planResumeMyselfRestCall(requests[0].requestId, sharedData.userId)
return executeAndHandleMsoInstanceRequest(createMyselfCommand)
} catch (exception: Exception) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to resume instanceId $serviceInstanceId ", exception)
+ LOGGER.error("Failed to resume instanceId $serviceInstanceId ", exception)
return Job.JobStatus.FAILED
}
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
index 68c9f53e1..29d7001e2 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
@@ -193,7 +193,7 @@ class VfmoduleCommand @Autowired constructor(
val replaceMyselfCommand = planReplaceMyselfRestCall(commandParentData)
return executeAndHandleMsoInstanceRequest(replaceMyselfCommand)
} catch (exception: Exception) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to replace instanceId ${getRequest().instanceId} ", exception)
+ LOGGER.error("Failed to replace instanceId ${getRequest().instanceId} ", exception)
return Job.JobStatus.FAILED
}
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
index c947bc0d5..9023682f6 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
@@ -61,8 +61,7 @@ class VnfCommand @Autowired constructor(
try {
childJobs = pushChildrenJobsToBroker(vfModulesForChildrenJobs(vfModules), dataForChild, JobType.VolumeGroupInstantiation)
} catch (e: AsdcCatalogException) {
- LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to retrieve service definitions from SDC, for VfModule is BaseModule.. Error: " + e.message, e)
- //return Job.JobStatus.FAILED
+ LOGGER.error("Failed to retrieve service definitions from SDC, for VfModule is BaseModule.. Error: " + e.message, e)
throw e;
}
}