de.otto.edison.jobs.status.JobStatusDetailIndicator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-jobs Show documentation
Show all versions of edison-jobs Show documentation
Jobs library of the edison-microservice project.
package de.otto.edison.jobs.status;
import de.otto.edison.jobs.definition.JobDefinition;
import de.otto.edison.status.domain.StatusDetail;
import de.otto.edison.status.indicator.StatusDetailIndicator;
import java.util.List;
import static java.util.Collections.singletonList;
public class JobStatusDetailIndicator implements StatusDetailIndicator {
private final JobStatusCalculator jobStatusCalculator;
private final JobDefinition jobDefinition;
public JobStatusDetailIndicator(final JobDefinition jobDefinition,
final JobStatusCalculator jobStatusCalculator) {
this.jobDefinition = jobDefinition;
this.jobStatusCalculator = jobStatusCalculator;
}
/**
* Return the current StatusDetail state.
*
* @return StatusDetail
*/
@Override
public List statusDetails() {
return singletonList(jobStatusCalculator.statusDetail(jobDefinition));
}
}