private void pollUntilJobIsReady() {
    monitor.debug(() -> "pollUntilJobIsReady");
    UUID jobId = JobMetadata.getJobId();
    PortabilityJob job = store.findJob(jobId);
    if (job == null) {
      monitor.severe(
          () -> format("Could not poll job %s, it was not present in the key-value store", jobId),
          EventCode.WORKER_JOB_ERRORED);
      this.stopAsync();
    } else if (job.state() == PortabilityJob.State.CANCELED) {
      monitor.info(
          () -> format("Could not poll job %s, it was cancelled", jobId),
          EventCode.WORKER_JOB_CANCELED);
      this.stopAsync();
    } else if (job.jobAuthorization().state() == JobAuthorization.State.CREDS_STORED) {
      monitor.debug(() -> format("Polled job %s in state CREDS_STORED", jobId));
      JobAuthorization jobAuthorization = job.jobAuthorization();
      if (!Strings.isNullOrEmpty(jobAuthorization.encryptedAuthData())) {
        monitor.debug(
            () -> format("Polled job %s has auth data as expected. Done polling.", jobId),
            EventCode.WORKER_CREDS_STORED);

      } else {
        monitor.severe(
            () ->
                format(
                    "Polled job %s does not have auth data as expected. "
                        + "Done polling this job since it's in a bad state! Starting over.",
                    jobId), EventCode.WORKER_JOB_ERRORED);
      }
      this.stopAsync();
    } else {
      monitor.debug(
          () ->
              format(
                  "Polling job %s until it's in state CREDS_STORED. "
                      + "It's currently in state: %s",
                  jobId, job.jobAuthorization().state()));
    }
  }
Polls for job with populated auth data and stops this service when found.
portability-transfer/src/main/java/org/datatransferproject/transfer/JobPollingService.java