X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Frepository%2FEiJob.java;h=47ed53c1acc5d2bfdf8bcc32048e9cc31287f77b;hb=3ac4de0524650cea3d17f9ad5ff7e9cf5dffbe83;hp=bb880e7f802c02a8dcbc6f683d9293b59c4556dd;hpb=3a88e8f0f4ba125d7e0f802b0ada0303fe3e8c56;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJob.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJob.java index bb880e7f..47ed53c1 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJob.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJob.java @@ -20,23 +20,53 @@ package org.oransc.enrichment.repository; -import org.immutables.gson.Gson; -import org.immutables.value.Value; +import java.lang.invoke.MethodHandles; + +import lombok.Getter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** - * Represents the dynamic information about a EI Job + * Represents the dynamic information about a EI job */ -@Value.Immutable -@Gson.TypeAdapters -public interface EiJob { - String id(); +public class EiJob { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + @Getter + private final String id; + + @Getter + private final String typeId; + + @Getter + private final String owner; + + @Getter + private final Object jobData; + + @Getter + private final String targetUrl; + + @Getter + private final String jobStatusUrl; - EiType type(); + @Getter + private boolean isLastStatusReportedEnabled = true; - String owner(); + public EiJob(String id, String typeId, String owner, Object jobData, String targetUrl, String jobStatusUrl) { + this.id = id; + this.typeId = typeId; + this.owner = owner; + this.jobData = jobData; + this.targetUrl = targetUrl; + this.jobStatusUrl = jobStatusUrl; + } - Object jobData(); + public void setLastReportedStatus(boolean isEnabled) { + this.isLastStatusReportedEnabled = isEnabled; + logger.debug("Job status id: {}, enabled: {}", this.isLastStatusReportedEnabled, isEnabled); + } - String targetUri(); }