X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Fcontrollers%2Fa1e%2FA1eCallbacks.java;h=59ac89251446de23bc931f0d9db15eebe93bd9a4;hb=c99358bd71569ac9ff6736ddcd3107f04f870dda;hp=fc17ee2e1d750b7339530ab3bda2bf5ad5f65a55;hpb=edea18a8fda2e2201cb3ede7f7af13f610bf4acc;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/a1e/A1eCallbacks.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/a1e/A1eCallbacks.java index fc17ee2e..59ac8925 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/a1e/A1eCallbacks.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/a1e/A1eCallbacks.java @@ -29,10 +29,10 @@ import java.util.Collection; import org.oransc.enrichment.clients.AsyncRestClient; import org.oransc.enrichment.clients.AsyncRestClientFactory; import org.oransc.enrichment.configuration.ApplicationConfig; -import org.oransc.enrichment.repository.EiJob; -import org.oransc.enrichment.repository.EiJobs; -import org.oransc.enrichment.repository.EiProducers; -import org.oransc.enrichment.repository.EiType; +import org.oransc.enrichment.repository.InfoJob; +import org.oransc.enrichment.repository.InfoJobs; +import org.oransc.enrichment.repository.InfoProducers; +import org.oransc.enrichment.repository.InfoType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -52,18 +52,18 @@ public class A1eCallbacks { private static Gson gson = new GsonBuilder().create(); private final AsyncRestClient restClient; - private final EiJobs eiJobs; - private final EiProducers eiProducers; + private final InfoJobs eiJobs; + private final InfoProducers eiProducers; @Autowired - public A1eCallbacks(ApplicationConfig config, EiJobs eiJobs, EiProducers eiProducers) { + public A1eCallbacks(ApplicationConfig config, InfoJobs eiJobs, InfoProducers eiProducers) { AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config.getWebClientConfig()); this.restClient = restClientFactory.createRestClientUseHttpProxy(""); this.eiJobs = eiJobs; this.eiProducers = eiProducers; } - public Flux notifyJobStatus(Collection eiTypes) { + public Flux notifyJobStatus(Collection eiTypes) { return Flux.fromIterable(eiTypes) // .flatMap(eiType -> Flux.fromIterable(this.eiJobs.getJobsForType(eiType))) // .filter(eiJob -> !eiJob.getJobStatusUrl().isEmpty()) // @@ -71,7 +71,7 @@ public class A1eCallbacks { .flatMap(this::noifyStatusToJobOwner); } - private Mono noifyStatusToJobOwner(EiJob job) { + private Mono noifyStatusToJobOwner(InfoJob job) { boolean isJobEnabled = this.eiProducers.isJobEnabled(job); A1eEiJobStatus status = isJobEnabled ? new A1eEiJobStatus(A1eEiJobStatus.EiJobStatusValues.ENABLED) : new A1eEiJobStatus(A1eEiJobStatus.EiJobStatusValues.DISABLED); @@ -83,7 +83,5 @@ public class A1eCallbacks { logger.warn("Consumer notify failed {} {}", job.getJobStatusUrl(), throwable.toString()); return Mono.empty(); }); - } - }