CI: Add SonarCloud scan GHA workflow
[nonrtric/plt/ranpm.git] / pmproducer / src / main / java / org / oran / pmproducer / repository / Jobs.java
index 5b257bf..6a5e261 100644 (file)
@@ -29,13 +29,12 @@ import java.util.Vector;
 
 import lombok.Getter;
 
-import org.oran.pmproducer.clients.AsyncRestClientFactory;
-import org.oran.pmproducer.clients.SecurityContext;
 import org.oran.pmproducer.configuration.ApplicationConfig;
 import org.oran.pmproducer.exceptions.ServiceException;
 import org.oran.pmproducer.filter.FilterFactory;
 import org.oran.pmproducer.filter.FilteredData;
 import org.oran.pmproducer.filter.PmReportFilter;
+import org.oran.pmproducer.oauth2.SecurityContext;
 import org.oran.pmproducer.repository.Job.Parameters;
 import org.oran.pmproducer.repository.Job.Parameters.KafkaDeliveryInfo;
 import org.oran.pmproducer.tasks.TopicListener.DataFromTopic;
@@ -117,13 +116,12 @@ public class Jobs {
     private Map<String, Job> allJobs = new HashMap<>();
     private MultiMap<Job> jobsByType = new MultiMap<>();
     private Map<String, JobGroup> jobGroups = new HashMap<>(); // Key is Topic
-    private final AsyncRestClientFactory restclientFactory;
     private final List<Observer> observers = new ArrayList<>();
     private final ApplicationConfig appConfig;
 
+    @SuppressWarnings("java:S1172")
     public Jobs(@Autowired ApplicationConfig applicationConfig, @Autowired SecurityContext securityContext,
             @Autowired ApplicationConfig appConfig) {
-        restclientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig(), securityContext);
         this.appConfig = appConfig;
     }
 
@@ -140,8 +138,7 @@ public class Jobs {
     }
 
     public void addJob(String id, InfoType type, String owner, String lastUpdated, Parameters parameters)
-            throws ServiceException {
-
+    {
         Job job = new Job(id, type, owner, lastUpdated, parameters, this.appConfig);
         this.put(job);
     }