use of org.springframework.batch.core.JobExecutionException in project pinpoint by naver.
the class AgentCountWriter method write.
@Override
public void write(List<? extends AgentCountStatistics> items) throws Exception {
if (items.size() == 1) {
AgentCountStatistics agentCountStatistics = items.get(0);
if (agentCountStatistics == null || agentCountStatistics.getAgentCount() < 0) {
throw new JobExecutionException("Bad parameter");
}
boolean success = agentStatisticsDao.insertAgentCount(agentCountStatistics);
if (!success) {
throw new JobExecutionException("insert AgentCount failed.");
}
} else {
throw new JobExecutionException("Bad parameter");
}
}
Aggregations