class DelfiInitialIngestService implements InitialIngestService {

  @Override
  public IngestResult ingestManifest(LoadManifest loadManifest,
      MessageHeaders headers) {
    log.debug("Request to ingest file with following parameters: {}, and headers : {}",
        loadManifest, headers);

    checkPreconditions(headers);

    IngestHeaders ingestHeaders = ingestHeadersMapper.toIngestHeaders(headers);
    log.debug("Parse ingest headers. Headers: {}", ingestHeaders);

    authenticationService
        .checkAuthentication(ingestHeaders.getAuthorizationToken(), ingestHeaders.getPartition());

    loadManifestValidationService.validateManifest(loadManifest);

    String jobId = jobStatusService.initInjectJob();

    IngestMessage ingestMessage = IngestMessage.builder()
        .ingestJobId(jobId)
        .loadManifest(loadManifest)
        .headers(ingestHeaders)
        .build();
    log.debug("Send ingest message for processing. Message: {}", ingestMessage);
    ingestGateway.sendIngestToPubSub(ingestMessage);

    log.debug("Request to ingest with parameters : {}, init the injection jobId: {}", loadManifest,
        jobId);
    return IngestResult.builder()
        .jobId(jobId)
        .build();
  }

}