X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vid-app-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fvid%2Fjob%2Fimpl%2FJobWorker.java;h=0b277b4d2fc02941840b8ef3632fedb46a2578f1;hb=e601bbdc43bae9a08e2e10c5139a6f76b47860d7;hp=5b5d1e13d7cfd5c41277259e5acc81749e8c1f8b;hpb=76c6ee4a697617ec4cdee2f3b48bc83136c858c5;p=vid.git diff --git a/vid-app-common/src/main/java/org/onap/vid/job/impl/JobWorker.java b/vid-app-common/src/main/java/org/onap/vid/job/impl/JobWorker.java index 5b5d1e13d..0b277b4d2 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/impl/JobWorker.java +++ b/vid-app-common/src/main/java/org/onap/vid/job/impl/JobWorker.java @@ -7,9 +7,9 @@ * 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 - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,17 +25,17 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.vid.job.*; import org.onap.vid.job.command.JobCommandFactory; -import org.onap.vid.properties.Features; import org.quartz.JobExecutionContext; import org.springframework.scheduling.quartz.QuartzJobBean; import org.springframework.stereotype.Component; -import org.togglz.core.manager.FeatureManager; import java.util.Optional; import java.util.UUID; import static org.onap.vid.job.Job.JobStatus.FAILED; import static org.onap.vid.job.Job.JobStatus.STOPPED; +import static org.onap.vid.job.command.ResourceCommandKt.ACTION_PHASE; +import static org.onap.vid.job.command.ResourceCommandKt.INTERNAL_STATE; @Component public class JobWorker extends QuartzJobBean { @@ -43,7 +43,6 @@ public class JobWorker extends QuartzJobBean { private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(JobWorker.class); private JobsBrokerService jobsBrokerService; - private FeatureManager featureManager; private JobCommandFactory jobCommandFactory; private Job.JobStatus topic; @@ -51,10 +50,6 @@ public class JobWorker extends QuartzJobBean { protected void executeInternal(JobExecutionContext context) { Optional job; - if (!isMsoNewApiActive()) { - return; - } - job = pullJob(); while (job.isPresent()) { @@ -85,10 +80,16 @@ public class JobWorker extends QuartzJobBean { } protected Job executeJobAndGetNext(Job job) { - LOGGER.debug(EELFLoggerDelegate.debugLogger, "going to execute job {} of {}: {}/{}", + Object internalState = job.getData().get(INTERNAL_STATE); + Object actionPhase = job.getData().get(ACTION_PHASE); + LOGGER.debug(EELFLoggerDelegate.debugLogger, "going to execute job {} of {}: {}/{} {}/{}", StringUtils.substring(String.valueOf(job.getUuid()), 0, 8), StringUtils.substring(String.valueOf(job.getTemplateId()), 0, 8), - job.getStatus(), job.getType()); + job.getStatus(), + job.getType(), + actionPhase, + internalState + ); NextCommand nextCommand = executeCommandAndGetNext(job); @@ -128,10 +129,6 @@ public class JobWorker extends QuartzJobBean { return job; } - private boolean isMsoNewApiActive() { - return featureManager.isActive(Features.FLAG_ASYNC_INSTANTIATION); - } - private void tryMutingJobFromException(Exception e) { // If there's JobException in the stack, read job uuid from // the exception, and mute it in DB. @@ -158,10 +155,6 @@ public class JobWorker extends QuartzJobBean { this.jobsBrokerService = jobsBrokerService; } - public void setFeatureManager(FeatureManager featureManager) { - this.featureManager = featureManager; - } - public void setJobCommandFactory(JobCommandFactory jobCommandFactory) { this.jobCommandFactory = jobCommandFactory; }