Examples of BatchSchedule


Examples of com.iisigroup.cap.batch.model.BatchSchedule

*/
public class BatchScheduleRowMapper implements RowMapper<BatchSchedule> {

  @Override
  public BatchSchedule mapRow(ResultSet rs, int rowNum) throws SQLException {
    BatchSchedule sch = new BatchSchedule();
    sch.setSchId(rs.getString("SCHID"));
    sch.setSchDesc(rs.getString("SCHDESC"));
    sch.setIsEnabled(rs.getString("ISENABLED"));
    sch.setJobId(rs.getString("JOBID"));
    sch.setSchType(rs.getString("SCHTYPE"));
    sch.setCronExpression(rs.getString("CRONEXPRESSION"));
    sch.setTimeZoneId(rs.getString("TIMEZONEID"));
    sch.setRepeatCount(rs.getInt("REPEATCOUNT"));
    sch.setRepeatInterval(rs.getInt("REPEATINTERVAL"));
    sch.setPriority(rs.getInt("PRIORITY"));
    sch.setExeHost(rs.getString("EXEHOST"));
    sch.setJobData(rs.getString("JOBDATA"));
    sch.setIsNotify(rs.getString("ISNOTIFY"));
    sch.setNotifyStatus(rs.getString("NOTIFYSTATUS"));
    sch.setNotifyTo(rs.getString("NOTIFYTO"));
    sch.setUpdater(rs.getString("UPDATER"));
    sch.setUpdateTime(rs.getTimestamp("UPDATETIME"));
    return sch;
  }
View Full Code Here

Examples of com.iisigroup.cap.batch.model.BatchSchedule

    return new GridResult(page.getContent(), page.getTotalRow(), fmt);
  }// ;

  public IResult schDetail(IRequest params) {
    AjaxFormResult result = new AjaxFormResult();
    BatchSchedule sch = batchSrv.findSchById(params.get("schId"));
    Map<String, Object> map = CapBeanUtil.bean2Map(sch,
        CapBeanUtil.getFieldName(BatchSchedule.class, false));
    map.put("notifyStatus", MapUtils.getString(map, "notifyStatus", "")
        .split(","));
    result.putAll(map);
View Full Code Here

Examples of com.iisigroup.cap.batch.model.BatchSchedule

   * @return IResult
   * @throws SchedulerException
   */
  public IResult schModify(IRequest request) throws SchedulerException {
    AjaxFormResult result = new AjaxFormResult();
    BatchSchedule oldSch = batchSrv.findSchById(request.get("schId"));
    BatchSchedule newSch = new BatchSchedule();
    boolean isnew = (oldSch == null);
    if (!isnew) {
      CapBeanUtil.copyBean(oldSch, newSch,
          CapBeanUtil.getFieldName(BatchSchedule.class, true));
    }
    CapBeanUtil.map2Bean(request, newSch, BatchSchedule.class);
    newSch.setNotifyStatus(CapString.array2String(request
        .getParamsAsStringArray("notifyStatus")));
    if (!"C".equals(newSch.getSchType())) {
      newSch.setCronExpression(null);
      newSch.setTimeZoneId(null);
    } else if (!"T".equals(newSch.getSchType())) {
      newSch.setRepeatCount(0);
      newSch.setRepeatInterval(0);
    }
    if (!newSch.isNotify()) {
      newSch.setNotifyStatus(null);
      newSch.setNotifyTo(null);
    }
    newSch.setUpdater(CapSecurityContext.getUserId());
    newSch.setUpdateTime(CapDate.getCurrentTimestamp());
    if (isnew) {
      batchSrv.insertSch(newSch);
    } else {
      batchSrv.updateSch(newSch);
    }
View Full Code Here

Examples of com.iisigroup.cap.batch.model.BatchSchedule

   */
  public IResult schDelete(IRequest request) throws SchedulerException {
    AjaxFormResult result = new AjaxFormResult();
    String[] ids = request.getParamsAsStringArray("schId");
    for (String id : ids) {
      BatchSchedule sch = batchSrv.findSchById(id);
      if (sch != null) {
        batchSrv.deleteSch(id);
        capScheduler.deleteSchedule(sch);
      }
    }
View Full Code Here

Examples of com.iisigroup.cap.batch.model.BatchSchedule

   */
  @Override
  public void jobWasExecuted(JobExecutionContext context,
      JobExecutionException jobException) {
    String jobName = context.getJobDetail().getKey().getName();
    final BatchSchedule sch = batchSerivce.findSchById(jobName);
    final JobExecution job = (JobExecution) context
        .get(CapBatchConstants.K_JobExecution);
    if (sch != null && job != null) {
      if (sch.isNotify() && !CapString.isEmpty(sch.getNotifyStatus())
          && !CapString.isEmpty(sch.getNotifyTo())) {
        for (String status : sch.getNotifyStatus().split(",")) {
          if (CapString.trimNull(status).equals(
              job.getExitStatus().getExitCode())) {
            // 主旨
            String subject = MessageFormat.format(mailSubject,
                new Object[] { sch.getSchId(),
                    sch.getSchDesc(),
                    job.getExitStatus().getExitCode() });
            mailSender.sendEmail(sch.getNotifyTo().split(","),
                subject, buildText(job));
            break;
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.