@Override public List<IntervalJob> getAllJobs() throws IOException { ArrayList<IntervalJob> jobs = new ArrayList<IntervalJob>(); for (String fileName : userDataDao.listNames(jobType)) { String jobDataContent = userDataDao.readData(jobType, fileName); jobs.add(JsonUtil.decode(jobDataContent, CmdIntervalJobImpl.class)); } return jobs; }
@Override public IntervalJob getJobById(String jobId) throws IOException { String jobContent = userDataDao.readData(jobType, jobId); return (IntervalJob) JsonUtil.decode(jobContent, jobType.getDoKlass()); }
@Override public void save(IntervalJob job) throws IOException { userDataDao.saveData(jobType, job.getName(), JsonUtil.encode(job)); }