use of io.cdap.cdap.internal.app.runtime.schedule.ProgramScheduleRecord in project cdap by caskdata.
the class ProgramLifecycleHttpHandler method doGetSchedule.
private void doGetSchedule(HttpResponder responder, String namespace, String app, String version, String scheduleName) throws Exception {
ScheduleId scheduleId = new ApplicationId(namespace, app, version).schedule(scheduleName);
ProgramScheduleRecord record = programScheduleService.getRecord(scheduleId);
ScheduleDetail detail = record.toScheduleDetail();
responder.sendJson(HttpResponseStatus.OK, GSON.toJson(detail, ScheduleDetail.class));
}
use of io.cdap.cdap.internal.app.runtime.schedule.ProgramScheduleRecord in project cdap by caskdata.
the class LocalScheduleFetcher method list.
@Override
public List<ScheduleDetail> list(ProgramId programId) throws IOException, ProgramNotFoundException {
Predicate<ProgramScheduleRecord> predicate = (record) -> true;
Collection<ProgramScheduleRecord> schedules = null;
try {
schedules = programScheduleService.list(programId, predicate);
} catch (Exception e) {
Throwables.propagateIfPossible(e.getCause(), IOException.class, ProgramNotFoundException.class);
throw new IOException(e);
}
return schedules.stream().map(ProgramScheduleRecord::toScheduleDetail).collect(Collectors.toList());
}
Aggregations