class GcpJobStatusService implements JobStatusService {

  @Override
  public IngestJobStatusDto getStatus(String jobId, MessageHeaders headers) {
    log.debug("Request for getting a injection job status. JobId: {}, headers: {}", jobId, headers);

    String authorizationToken = extractHeaderByName(headers, OsduHeader.AUTHORIZATION);
    String partition = extractHeaderByName(headers, OsduHeader.PARTITION);

    authenticationService
        .checkAuthentication(authorizationToken, partition);

    IngestJobStatusDto jobStatusDto = ingestJobRepository.findById(jobId)
        .map(ingestJobMapper::toStatusDto)
        .orElseThrow(() -> new IngestJobNotFoundException("Not ingest job found by id = " + jobId));

    log.debug("Found the injection job status: {}", jobStatusDto);
    return jobStatusDto;
  }

}