Skip to content

Commit 5eb1af7

Browse files
Feature/ab2 d 5128 remove eventlogger (#1128)
* Remove inicial code * revert change * More changes * Fix tests * Update AuthenticationTests.java * Update BulkDataAccessAPIUnusualDataTests.java * update api tests * Fix API Tests * Fix Audit Test * Modify tests in common and coverage * Fix Worker Tests * Clean unused. code * Clean unused code * First attempt remove log manager * Update HPMSMockedAuthTest.java * remove eventlogger module * remove eventlogger from jenkinsfile * Update application.properties * Update UtilMethods.java * Create HealthAPITest.java * Update HealthAPITest.java * Move util to api module * Create UtilMethodsTest.java * Update pom.xml
1 parent 4a062d3 commit 5eb1af7

File tree

119 files changed

+1342
-4498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1342
-4498
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ build/
9090

9191
common/jacoco/**
9292
coverage/jacoco/**
93+
properties/jacoco/**
9394

9495
### .DS_Store in "src/test" ###
9596
### This is needed due to this .gitignore entry: "!**/src/test/**" ###

Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pipeline {
8787
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
8888
sh '''
8989
export AB2D_EFS_MOUNT="${AB2D_HOME}"
90-
mvn --settings settings.xml -Dartifactory.username=${ARTIFACTORY_USER} -Dartifactory.password=${ARTIFACTORY_PASSWORD} test -pl eventlogger,common,job,coverage,api,worker,audit,hpms,properties
90+
mvn --settings settings.xml -Dartifactory.username=${ARTIFACTORY_USER} -Dartifactory.password=${ARTIFACTORY_PASSWORD} test -pl common,job,coverage,api,worker,audit,hpms,properties
9191
'''
9292
}
9393
}

api/pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
<artifactId>hpms</artifactId>
3434
<version>0.0.1-SNAPSHOT</version>
3535
</dependency>
36-
<dependency>
37-
<groupId>gov.cms.ab2d</groupId>
38-
<artifactId>eventlogger</artifactId>
39-
<version>0.0.1-SNAPSHOT</version>
40-
</dependency>
4136
<dependency>
4237
<groupId>gov.cms.ab2d</groupId>
4338
<artifactId>properties</artifactId>

api/src/main/java/gov/cms/ab2d/api/SpringBootApp.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
1111

1212
@SpringBootApplication(scanBasePackages = {"gov.cms.ab2d.common", "gov.cms.ab2d.job", "gov.cms.ab2d.api",
13-
"gov.cms.ab2d.hpms", "gov.cms.ab2d.eventlogger", "gov.cms.ab2d.properties", "gov.cms.ab2d.eventclient.clients"})
13+
"gov.cms.ab2d.hpms", "gov.cms.ab2d.properties", "gov.cms.ab2d.eventclient.clients"})
1414
@EntityScan(basePackages = {"gov.cms.ab2d.common.model", "gov.cms.ab2d.job.model", "gov.cms.ab2d.properties.model"})
1515
@EnableJpaRepositories({"gov.cms.ab2d.common.repository", "gov.cms.ab2d.job.repository", "gov.cms.ab2d.properties.repository"})
1616
@PropertySource("classpath:application.common.properties")

api/src/main/java/gov/cms/ab2d/api/controller/ErrorHandler.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
import gov.cms.ab2d.api.security.MissingTokenException;
1111
import gov.cms.ab2d.common.service.InvalidClientInputException;
1212
import gov.cms.ab2d.common.service.InvalidContractException;
13+
import gov.cms.ab2d.api.util.UtilMethods;
14+
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
1315
import gov.cms.ab2d.eventclient.config.Ab2dEnvironment;
1416
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
1517
import gov.cms.ab2d.eventclient.events.ErrorEvent;
18+
import gov.cms.ab2d.fhir.FhirVersion;
1619
import gov.cms.ab2d.job.service.InvalidJobAccessException;
1720
import gov.cms.ab2d.job.service.InvalidJobStateTransition;
18-
import gov.cms.ab2d.properties.service.InvalidPropertiesException;
1921
import gov.cms.ab2d.job.service.JobOutputMissingException;
22+
import gov.cms.ab2d.properties.service.InvalidPropertiesException;
2023
import gov.cms.ab2d.properties.service.ResourceNotFoundException;
21-
import gov.cms.ab2d.eventlogger.LogManager;
22-
import gov.cms.ab2d.eventlogger.utils.UtilMethods;
23-
import gov.cms.ab2d.fhir.FhirVersion;
2424
import java.io.IOException;
2525
import java.net.URISyntaxException;
2626
import java.util.HashMap;
@@ -60,7 +60,7 @@
6060
@Slf4j
6161
public class ErrorHandler extends ResponseEntityExceptionHandler {
6262

63-
private final LogManager eventLogger;
63+
private final SQSEventClient eventLogger;
6464
private final int retryAfterDelay;
6565
private final ApiCommon apiCommon;
6666

@@ -88,7 +88,7 @@ public class ErrorHandler extends ResponseEntityExceptionHandler {
8888
RESPONSE_MAP.put(DataIntegrityViolationException.class, HttpStatus.INTERNAL_SERVER_ERROR);
8989
}
9090

91-
public ErrorHandler(LogManager eventLogger, @Value("${api.retry-after.delay}") int retryAfterDelay, ApiCommon apiCommon) {
91+
public ErrorHandler(SQSEventClient eventLogger, @Value("${api.retry-after.delay}") int retryAfterDelay, ApiCommon apiCommon) {
9292
this.eventLogger = eventLogger;
9393
this.retryAfterDelay = retryAfterDelay;
9494
this.apiCommon = apiCommon;
@@ -121,7 +121,7 @@ public ResponseEntity<JsonNode> assertionException(final Exception e, HttpServle
121121

122122
@ExceptionHandler({JobOutputMissingException.class})
123123
public ResponseEntity<JsonNode> handleJobOutputMissing(Exception e, HttpServletRequest request) throws IOException {
124-
eventLogger.log(new ErrorEvent(MDC.get(ORGANIZATION), UtilMethods.parseJobId(request.getRequestURI()),
124+
eventLogger.sendLogs(new ErrorEvent(MDC.get(ORGANIZATION), UtilMethods.parseJobId(request.getRequestURI()),
125125
ErrorEvent.ErrorType.FILE_ALREADY_DELETED, getRootCause(e)));
126126
return generateFHIRError(e, request);
127127
}
@@ -131,7 +131,7 @@ public ResponseEntity<Void> handleInvalidContractErrors(Exception ex, HttpServle
131131
HttpStatus status = getErrorResponse(ex.getClass());
132132
String description = API_INVALID_CONTRACT + " " + getRootCause(ex);
133133

134-
eventLogger.log(new ErrorEvent(MDC.get(ORGANIZATION), null,
134+
eventLogger.sendLogs(new ErrorEvent(MDC.get(ORGANIZATION), null,
135135
ErrorEvent.ErrorType.UNAUTHORIZED_CONTRACT, description));
136136

137137
ApiResponseEvent responseEvent = new ApiResponseEvent(MDC.get(ORGANIZATION), null, status,
@@ -161,7 +161,7 @@ public ResponseEntity<Void> handleAuthorizationErrors(Exception ex, HttpServletR
161161
// Then log to other destinations
162162
ApiResponseEvent responseEvent = new ApiResponseEvent(MDC.get(ORGANIZATION), null, status,
163163
"API Error", description, (String) request.getAttribute(REQUEST_ID));
164-
eventLogger.log(responseEvent);
164+
eventLogger.sendLogs(responseEvent);
165165

166166
return new ResponseEntity<>(null, null, status);
167167
}
@@ -174,7 +174,7 @@ public ResponseEntity<Void> handleMaintenanceMode(Exception ex, HttpServletReque
174174
log.warn("Maintenance mode blocked API request " + request.getAttribute(REQUEST_ID));
175175

176176
// Then log to other destinations
177-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), null, status,
177+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), null, status,
178178
"API Error", ex.getClass().getSimpleName(), (String) request.getAttribute(REQUEST_ID)));
179179
eventLogger.trace("API_MAINT_BLOCKED Maintenance mode blocked API request " + request.getAttribute(REQUEST_ID), Ab2dEnvironment.PROD_LIST);
180180

@@ -188,7 +188,7 @@ public ResponseEntity<JsonNode> handleTooManyRequestsExceptions(final TooManyReq
188188
if (e.getJobIds() != null) {
189189
generateContentLocation(e, request, httpHeaders);
190190
}
191-
eventLogger.log(new ErrorEvent(MDC.get(ORGANIZATION), UtilMethods.parseJobId(request.getRequestURI()),
191+
eventLogger.sendLogs(new ErrorEvent(MDC.get(ORGANIZATION), UtilMethods.parseJobId(request.getRequestURI()),
192192
ErrorEvent.ErrorType.TOO_MANY_STATUS_REQUESTS, "Too many requests performed in too short a time"));
193193
return generateFHIRError(e, httpHeaders, request);
194194
}
@@ -224,7 +224,7 @@ private ResponseEntity<JsonNode> generateFHIRError(Exception e, HttpHeaders http
224224
// Log so that Splunk can pick this up and alert
225225
log.warn("{} {}", ExceptionUtils.getRootCause(e).getClass(), msg);
226226

227-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), null,
227+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), null,
228228
ErrorHandler.getErrorResponse(e.getClass()),
229229
"FHIR Error", msg, (String) request.getAttribute(REQUEST_ID)));
230230

api/src/main/java/gov/cms/ab2d/api/controller/HealthAPI.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package gov.cms.ab2d.api.controller;
22

33
import gov.cms.ab2d.api.util.HealthCheck;
4+
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
45
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
5-
import gov.cms.ab2d.eventlogger.LogManager;
6+
import javax.servlet.http.HttpServletRequest;
67
import lombok.AllArgsConstructor;
78
import org.slf4j.MDC;
89
import org.springframework.http.HttpStatus;
@@ -11,16 +12,17 @@
1112
import org.springframework.web.bind.annotation.GetMapping;
1213
import org.springframework.web.bind.annotation.RestController;
1314

14-
import javax.servlet.http.HttpServletRequest;
1515

16-
import static gov.cms.ab2d.common.util.Constants.*;
16+
import static gov.cms.ab2d.common.util.Constants.HEALTH_ENDPOINT;
17+
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
18+
import static gov.cms.ab2d.common.util.Constants.REQUEST_ID;
1719

1820
@AllArgsConstructor
1921
@RestController
2022
public class HealthAPI {
2123

2224
private final HealthCheck healthCheck;
23-
private final LogManager eventLogger;
25+
private final SQSEventClient eventLogger;
2426

2527
// Add exceptions for testing and prod site
2628
@CrossOrigin(origins = {"http://127.0.0.1:4000", "https://ab2d.cms.gov", "http://ab2d.cms.gov"})
@@ -29,7 +31,7 @@ public ResponseEntity<Void> getHealth(HttpServletRequest request) {
2931
if (healthCheck.healthy()) {
3032
return new ResponseEntity<>(HttpStatus.OK);
3133
} else {
32-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), null, HttpStatus.INTERNAL_SERVER_ERROR, "API Health NOT Ok",
34+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), null, HttpStatus.INTERNAL_SERVER_ERROR, "API Health NOT Ok",
3335
null, (String) request.getAttribute(REQUEST_ID)));
3436
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
3537
}

api/src/main/java/gov/cms/ab2d/api/controller/common/ApiCommon.java

+14-15
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
import gov.cms.ab2d.api.controller.InMaintenanceModeException;
44
import gov.cms.ab2d.api.controller.TooManyRequestsException;
55
import gov.cms.ab2d.api.remote.JobClient;
6-
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
7-
import gov.cms.ab2d.common.util.PropertyConstants;
8-
import gov.cms.ab2d.job.dto.StartJobDTO;
96
import gov.cms.ab2d.common.model.Contract;
107
import gov.cms.ab2d.common.model.PdpClient;
118
import gov.cms.ab2d.common.service.InvalidClientInputException;
129
import gov.cms.ab2d.common.service.InvalidContractException;
1310
import gov.cms.ab2d.common.service.PdpClientService;
14-
import gov.cms.ab2d.properties.service.PropertiesAPIService;
15-
import gov.cms.ab2d.eventlogger.LogManager;
11+
import gov.cms.ab2d.common.util.PropertyConstants;
12+
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
13+
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
1614
import gov.cms.ab2d.fhir.FhirVersion;
15+
import gov.cms.ab2d.job.dto.StartJobDTO;
16+
import gov.cms.ab2d.properties.service.PropertiesAPIService;
17+
import java.time.OffsetDateTime;
18+
import java.util.Set;
19+
import javax.servlet.http.HttpServletRequest;
1720
import lombok.extern.slf4j.Slf4j;
1821
import org.slf4j.MDC;
1922
import org.springframework.http.HttpHeaders;
@@ -22,17 +25,13 @@
2225
import org.springframework.stereotype.Service;
2326
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
2427

25-
import javax.servlet.http.HttpServletRequest;
2628

27-
import java.time.OffsetDateTime;
28-
import java.util.Set;
29-
30-
import static gov.cms.ab2d.common.util.Constants.ZIPFORMAT;
31-
import static gov.cms.ab2d.common.util.Constants.SINCE_EARLIEST_DATE;
3229
import static gov.cms.ab2d.common.util.Constants.FHIR_PREFIX;
30+
import static gov.cms.ab2d.common.util.Constants.JOB_LOG;
3331
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
32+
import static gov.cms.ab2d.common.util.Constants.SINCE_EARLIEST_DATE;
33+
import static gov.cms.ab2d.common.util.Constants.ZIPFORMAT;
3434
import static gov.cms.ab2d.common.util.Constants.ZIP_SUPPORT_ON;
35-
import static gov.cms.ab2d.common.util.Constants.JOB_LOG;
3635
import static gov.cms.ab2d.fhir.BundleUtils.EOB;
3736
import static java.time.format.DateTimeFormatter.ISO_DATE_TIME;
3837
import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
@@ -41,7 +40,7 @@
4140
@Service
4241
@Slf4j
4342
public class ApiCommon {
44-
private final LogManager eventLogger;
43+
private final SQSEventClient eventLogger;
4544
private final JobClient jobClient;
4645
private final PropertiesAPIService propertiesApiService;
4746
private final PdpClientService pdpClientService;
@@ -52,7 +51,7 @@ public class ApiCommon {
5251
public static final Set<String> ALLOWABLE_OUTPUT_FORMAT_SET = Set.of(ALLOWABLE_OUTPUT_FORMATS.split(","));
5352
public static final String JOB_CANCELLED_MSG = "Job canceled";
5453

55-
public ApiCommon(LogManager eventLogger, JobClient jobClient, PropertiesAPIService propertiesApiService,
54+
public ApiCommon(SQSEventClient eventLogger, JobClient jobClient, PropertiesAPIService propertiesApiService,
5655
PdpClientService pdpClientService) {
5756
this.eventLogger = eventLogger;
5857
this.jobClient = jobClient;
@@ -114,7 +113,7 @@ public ResponseEntity<Void> returnStatusForJobCreation(String jobGuid, String ap
114113
String statusURL = getUrl(apiPrefix + FHIR_PREFIX + "/Job/" + jobGuid + "/$status", request);
115114
HttpHeaders responseHeaders = new HttpHeaders();
116115
responseHeaders.add(CONTENT_LOCATION, statusURL);
117-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), jobGuid, HttpStatus.ACCEPTED, "Job Created",
116+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), jobGuid, HttpStatus.ACCEPTED, "Job Created",
118117
"Job " + jobGuid + " was created", requestId));
119118
return new ResponseEntity<>(null, responseHeaders,
120119
HttpStatus.ACCEPTED);

api/src/main/java/gov/cms/ab2d/api/controller/common/FileDownloadCommon.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
import gov.cms.ab2d.api.remote.JobClient;
44
import gov.cms.ab2d.common.service.PdpClientService;
5+
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
56
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
6-
import gov.cms.ab2d.eventlogger.LogManager;
7+
import java.io.FileInputStream;
8+
import java.io.IOException;
9+
import java.io.OutputStream;
10+
import javax.servlet.http.HttpServletRequest;
11+
import javax.servlet.http.HttpServletResponse;
712
import lombok.AllArgsConstructor;
813
import lombok.extern.slf4j.Slf4j;
914
import org.apache.commons.io.IOUtils;
@@ -14,24 +19,19 @@
1419
import org.springframework.http.ResponseEntity;
1520
import org.springframework.stereotype.Service;
1621

17-
import javax.servlet.http.HttpServletRequest;
18-
import javax.servlet.http.HttpServletResponse;
19-
import java.io.FileInputStream;
20-
import java.io.IOException;
21-
import java.io.OutputStream;
2222

23-
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
2423
import static gov.cms.ab2d.common.util.Constants.FILE_LOG;
2524
import static gov.cms.ab2d.common.util.Constants.JOB_LOG;
2625
import static gov.cms.ab2d.common.util.Constants.NDJSON_FIRE_CONTENT_TYPE;
26+
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
2727
import static gov.cms.ab2d.common.util.Constants.REQUEST_ID;
2828

2929
@Service
3030
@AllArgsConstructor
3131
@Slf4j
3232
public class FileDownloadCommon {
3333
private final JobClient jobClient;
34-
private final LogManager eventLogger;
34+
private final SQSEventClient eventLogger;
3535
private final PdpClientService pdpClientService;
3636

3737
public ResponseEntity<String> downloadFile(String jobUuid, String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {
@@ -52,7 +52,7 @@ public ResponseEntity<String> downloadFile(String jobUuid, String filename, Http
5252
try (OutputStream out = response.getOutputStream(); FileInputStream in = new FileInputStream(downloadResource.getFile())) {
5353
IOUtils.copy(in, out);
5454

55-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.OK, "File Download",
55+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.OK, "File Download",
5656
"File " + filename + " was downloaded", (String) request.getAttribute(REQUEST_ID)));
5757
jobClient.incrementDownload(downloadResource.getFile(), jobUuid);
5858
return new ResponseEntity<>(null, null, HttpStatus.OK);

api/src/main/java/gov/cms/ab2d/api/controller/common/StatusCommon.java

+15-16
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
import gov.cms.ab2d.api.controller.JobProcessingException;
55
import gov.cms.ab2d.api.controller.TooManyRequestsException;
66
import gov.cms.ab2d.api.remote.JobClient;
7-
import gov.cms.ab2d.job.dto.JobPollResult;
87
import gov.cms.ab2d.common.model.PdpClient;
98
import gov.cms.ab2d.common.model.TooFrequentInvocations;
109
import gov.cms.ab2d.common.service.PdpClientService;
11-
import gov.cms.ab2d.eventlogger.LogManager;
10+
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
1211
import gov.cms.ab2d.eventclient.events.ApiResponseEvent;
12+
import gov.cms.ab2d.job.dto.JobPollResult;
1313
import gov.cms.ab2d.job.model.JobOutput;
14+
import java.time.ZoneId;
15+
import java.time.ZonedDateTime;
16+
import java.time.format.DateTimeFormatter;
17+
import java.util.ArrayList;
18+
import java.util.List;
19+
import javax.servlet.http.HttpServletRequest;
1420
import lombok.extern.slf4j.Slf4j;
1521
import org.slf4j.MDC;
1622
import org.springframework.beans.factory.annotation.Value;
@@ -19,19 +25,12 @@
1925
import org.springframework.http.ResponseEntity;
2026
import org.springframework.stereotype.Service;
2127

22-
import javax.servlet.http.HttpServletRequest;
23-
24-
import java.time.ZoneId;
25-
import java.time.ZonedDateTime;
26-
import java.time.format.DateTimeFormatter;
27-
import java.util.ArrayList;
28-
import java.util.List;
2928

3029
import static gov.cms.ab2d.api.controller.common.ApiText.X_PROG;
31-
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
30+
import static gov.cms.ab2d.common.util.Constants.FHIR_PREFIX;
3231
import static gov.cms.ab2d.common.util.Constants.JOB_LOG;
32+
import static gov.cms.ab2d.common.util.Constants.ORGANIZATION;
3333
import static gov.cms.ab2d.common.util.Constants.REQUEST_ID;
34-
import static gov.cms.ab2d.common.util.Constants.FHIR_PREFIX;
3534
import static org.springframework.http.HttpHeaders.EXPIRES;
3635
import static org.springframework.http.HttpHeaders.RETRY_AFTER;
3736

@@ -40,11 +39,11 @@
4039
public class StatusCommon {
4140
private final PdpClientService pdpClientService;
4241
private final JobClient jobClient;
43-
private final LogManager eventLogger;
42+
private final SQSEventClient eventLogger;
4443
private final int retryAfterDelay;
4544

4645
StatusCommon(PdpClientService pdpClientService, JobClient jobClient,
47-
LogManager eventLogger, @Value("${api.retry-after.delay}") int retryAfterDelay) {
46+
SQSEventClient eventLogger, @Value("${api.retry-after.delay}") int retryAfterDelay) {
4847
this.pdpClientService = pdpClientService;
4948
this.jobClient = jobClient;
5049
this.eventLogger = eventLogger;
@@ -77,7 +76,7 @@ public ResponseEntity doStatus(String jobUuid, HttpServletRequest request, Strin
7776
case IN_PROGRESS:
7877
responseHeaders.add(X_PROG, jobPollResult.getProgress() + "% complete");
7978
responseHeaders.add(RETRY_AFTER, Integer.toString(retryAfterDelay));
80-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.ACCEPTED,
79+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.ACCEPTED,
8180
"Job in progress", jobPollResult.getProgress() + "% complete",
8281
(String) request.getAttribute(REQUEST_ID)));
8382
return new ResponseEntity<>(null, responseHeaders, HttpStatus.ACCEPTED);
@@ -137,7 +136,7 @@ private ResponseEntity getSuccessResponse(JobPollResult jobPollResult, String jo
137136
responseHeaders.add(EXPIRES, DateTimeFormatter.RFC_1123_DATE_TIME.format(jobExpiresUTC));
138137
final JobCompletedResponse resp = getJobCompletedResponse(jobPollResult, jobUuid, request, apiPrefix);
139138
log.info("Job status completed successfully");
140-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.OK,
139+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.OK,
141140
"Job completed", null, (String) request.getAttribute(REQUEST_ID)));
142141
return new ResponseEntity<>(resp, responseHeaders, HttpStatus.OK);
143142
}
@@ -150,7 +149,7 @@ public ResponseEntity cancelJob(String jobUuid, HttpServletRequest request) {
150149

151150
log.info("Job successfully cancelled");
152151

153-
eventLogger.log(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.ACCEPTED,
152+
eventLogger.sendLogs(new ApiResponseEvent(MDC.get(ORGANIZATION), jobUuid, HttpStatus.ACCEPTED,
154153
"Job cancelled", null, (String) request.getAttribute(REQUEST_ID)));
155154

156155
return new ResponseEntity<>(null, null,

0 commit comments

Comments
 (0)