Search in sources :

Example 1 with JobExecutionException

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");
    }
}
Also used : JobExecutionException(org.springframework.batch.core.JobExecutionException) AgentCountStatistics(com.navercorp.pinpoint.web.vo.AgentCountStatistics)

Aggregations

AgentCountStatistics (com.navercorp.pinpoint.web.vo.AgentCountStatistics)1 JobExecutionException (org.springframework.batch.core.JobExecutionException)1