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

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

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

origin: otto-de/edison-microservice

public String getLastUpdated() {
  return formatTime(job.getLastUpdated());
}
origin: otto-de/edison-microservice

@Override
public List<JobInfo> findRunningWithoutUpdateSince(OffsetDateTime timeOffset) {
  return jobs.values().stream()
      .filter(jobInfo -> !jobInfo.isStopped() && jobInfo.getLastUpdated().isBefore(timeOffset))
      .collect(toList());
}
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: otto-de/edison-microservice

@Test
public void shouldAppendMessageToJobInfo() throws Exception {
  String someUri = "someUri";
  OffsetDateTime now = now();
  //Given
  JobInfo jobInfo = newJobInfo(someUri, "TEST", systemDefaultZone(), "localhost");
  repository.createOrUpdate(jobInfo);
  //When
  JobMessage igelMessage = JobMessage.jobMessage(Level.WARNING, "Der Igel ist froh.", now);
  repository.appendMessage(someUri, igelMessage);
  //Then
  JobInfo jobInfoFromRepo = repository.findOne(someUri).get();
  assertThat(jobInfoFromRepo.getMessages().size(), is(1));
  assertThat(jobInfoFromRepo.getMessages().get(0), is(igelMessage));
  assertThat(jobInfoFromRepo.getLastUpdated(), is(now.truncatedTo(ChronoUnit.MILLIS)));
}
origin: otto-de/edison-microservice

@Test
public void shouldUpdateJobLastUpdateTime() {
  //Given
  final JobInfo foo = jobInfo("http://localhost/foo", "T_FOO");
  repo.createOrUpdate(foo);
  final OffsetDateTime myTestTime = OffsetDateTime.of(1979, 2, 5, 1, 2, 3, 4, ZoneOffset.UTC);
  //When
  repo.setLastUpdate(foo.getJobId(), myTestTime);
  final Optional<JobInfo> jobInfo = repo.findOne(foo.getJobId());
  //Then
  assertThat(jobInfo, OptionalMatchers.isPresent());
  assertThat(Date.from(jobInfo.get().getLastUpdated().toInstant()), is(Date.from(myTestTime.toInstant())));
}
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.domainJobInfogetLastUpdated

Popular methods of JobInfo

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

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
  • Top PhpStorm plugins
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