Tabnine Logo
JobInfo.getStarted
Code IndexAdd Tabnine to your IDE (free)

How to use
getStarted
method
in
de.otto.edison.jobs.domain.JobInfo

Best Java code snippets using de.otto.edison.jobs.domain.JobInfo.getStarted (Showing top 7 results out of 315)

origin: otto-de/edison-microservice

public String getStarted() {
  OffsetDateTime started = job.getStarted();
  return formatDateTime(started);
}
origin: otto-de/edison-microservice

/**
 * Returns additional information like job uri, running state, started and stopped timestamps.
 *
 * @param jobInfo the job information of the last job
 * @return map containing uri, starting, and running or stopped entries.
 */
protected Map<String, String> runningDetailsFor(final JobInfo jobInfo) {
  final Map<String, String> details = new HashMap<>();
  details.put("Started", ISO_DATE_TIME.format(jobInfo.getStarted()));
  if (jobInfo.getStopped().isPresent()) {
    details.put("Stopped", ISO_DATE_TIME.format(jobInfo.getStopped().get()));
  }
  return details;
}
origin: otto-de/edison-microservice

public String getRuntime() {
  return job.isStopped()
      ? formatRuntime(job.getStarted(), job.getStopped().get())
      : formatRuntime(job.getStarted(), OffsetDateTime.now());
}
origin: otto-de/edison-microservice

private JobInfo someStoppedJob(final JobInfo.JobStatus jobStatus, int startedSecondsAgo) {
  OffsetDateTime now = now();
  JobInfo someJob = mock(JobInfo.class);
  when(someJob.getJobType()).thenReturn("someJobType");
  when(someJob.getJobId()).thenReturn("someId");
  when(someJob.getStarted()).thenReturn(now.minusSeconds(startedSecondsAgo));
  when(someJob.getStopped()).thenReturn(of(now.minusSeconds(startedSecondsAgo-1)));
  when(someJob.getStatus()).thenReturn(jobStatus);
  return someJob;
}
origin: otto-de/edison-microservice

  private JobInfo someRunningJob(final JobInfo.JobStatus jobStatus, int startedSecondsAgo) {
    OffsetDateTime now = now();
    JobInfo someJob = mock(JobInfo.class);
    when(someJob.getJobType()).thenReturn("someJobType");
    when(someJob.getJobId()).thenReturn("someJobId");
    when(someJob.getStarted()).thenReturn(now.minusSeconds(startedSecondsAgo));
    when(someJob.getStopped()).thenReturn(empty());
    when(someJob.getStatus()).thenReturn(jobStatus);
    return someJob;
  }
}
origin: otto-de/edison-microservice

@Override
protected final Document encode(final JobInfo job) {
  final Document document = new Document()
      .append(JobStructure.ID.key(), job.getJobId())
      .append(JobStructure.JOB_TYPE.key(), job.getJobType())
      .append(JobStructure.STARTED.key(), Date.from(job.getStarted().toInstant()))
      .append(JobStructure.LAST_UPDATED.key(), Date.from(job.getLastUpdated().toInstant()))
      .append(JobStructure.MESSAGES.key(), job.getMessages().stream()
          .map(MongoJobRepository::encodeJobMessage)
          .collect(toList()))
      .append(JobStructure.STATUS.key(), job.getStatus().name())
      .append(JobStructure.HOSTNAME.key(), job.getHostname());
  if (job.isStopped()) {
    document.append(JobStructure.STOPPED.key(), Date.from(job.getStopped().get().toInstant()));
  }
  return document;
}
origin: de.otto.edison/edison-mongo

@Override
protected final Document encode(final JobInfo job) {
  final Document document = new Document()
      .append(JobStructure.ID.key(), job.getJobId())
      .append(JobStructure.JOB_TYPE.key(), job.getJobType())
      .append(JobStructure.STARTED.key(), DateTimeConverters.toDate(job.getStarted()))
      .append(JobStructure.LAST_UPDATED.key(), DateTimeConverters.toDate(job.getLastUpdated()))
      .append(JobStructure.MESSAGES.key(), job.getMessages().stream()
          .map(MongoJobRepository::encodeJobMessage)
          .collect(toList()))
      .append(JobStructure.STATUS.key(), job.getStatus().name())
      .append(JobStructure.HOSTNAME.key(), job.getHostname());
  if (job.isStopped()) {
    document.append(JobStructure.STOPPED.key(), DateTimeConverters.toDate(job.getStopped().get()));
  }
  return document;
}
de.otto.edison.jobs.domainJobInfogetStarted

Popular methods of JobInfo

  • getJobId
  • getJobType
  • getLastUpdated
  • getMessages
  • getStatus
  • getStopped
  • isStopped
  • newJobInfo
  • copy
  • getHostname
  • <init>
  • builder
  • <init>,
  • builder,
  • equals,
  • getClock,
  • hashCode

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now