Package org.qzerver.model.domain.entities.job

Examples of org.qzerver.model.domain.entities.job.ScheduleGroup


    @Resource
    private BusinessEntityDao businessEntityDao;

    @Test
    public void testScheduleGroupDao() throws Exception {
        ScheduleGroup scheduleGroup = new ScheduleGroup();
        scheduleGroup.setName("dgfsrgw");

        BusinessEntityJpaDaoChecker.checkBusinessEntityDao(entityManager, businessEntityDao,
            ScheduleGroup.class, scheduleGroup);
    }
View Full Code Here


                ScheduleAction.class, scheduleAction);
    }

    @Test
    public void testScheduleJobDao() throws Exception {
        ScheduleGroup scheduleGroup = new ScheduleGroup();
        scheduleGroup.setName("dgfsrgw");
        businessEntityDao.save(scheduleGroup);

        ScheduleAction scheduleAction = new ScheduleAction();
        scheduleAction.setArchived(true);
        scheduleAction.setCreated(new Date(300000000000L));
        scheduleAction.setIdentifier("none");
        scheduleAction.setDefinition("<xml></xml>".getBytes());
        scheduleAction.setUsedDate(new Date(300000000000L));
        scheduleAction.setUsedCount(2);
        businessEntityDao.save(scheduleAction);

        ScheduleJob scheduleJob = new ScheduleJob();
        scheduleJob.setCreated(new Date(300000000000L));
        scheduleJob.setModified(new Date(300000000000L));
        scheduleJob.setName("dgfsrgw");
        scheduleJob.setDescription("wgwrgwg");
        scheduleJob.setCron("0 * * * * ?");
        scheduleJob.setTimezone("UTC");
        scheduleJob.setEnabled(true);
        scheduleJob.setStandby(false);
        scheduleJob.setAllNodes(true);
        scheduleJob.setStrategy(ScheduleExecutionStrategy.CIRCULAR);
        scheduleJob.setTimeout(1000);
        scheduleJob.setNodesLimit(1);
        scheduleJob.setAction(scheduleAction);
        scheduleJob.setGroup(scheduleGroup);
        scheduleGroup.getJobs().add(scheduleJob);

        BusinessEntityJpaDaoChecker.checkBusinessEntityDao(entityManager, businessEntityDao,
                ScheduleGroup.class, scheduleGroup);
    }
View Full Code Here

                ScheduleGroup.class, scheduleGroup);
    }

    @Test
    public void testScheduleExecutionDao() throws Exception {
        ScheduleGroup scheduleGroup = new ScheduleGroup();
        scheduleGroup.setName("dgfsrgw");
        businessEntityDao.save(scheduleGroup);

        ScheduleAction scheduleAction = new ScheduleAction();
        scheduleAction.setArchived(true);
        scheduleAction.setCreated(ChronometerUtils.parseMoment("2011-01-01 12:00:00.000 UTC"));
        scheduleAction.setIdentifier("none");
        scheduleAction.setDefinition("<xml></xml>".getBytes());
        scheduleAction.setUsedDate(new Date(300000000000L));
        scheduleAction.setUsedCount(2);
        businessEntityDao.save(scheduleAction);

        ScheduleJob scheduleJob = new ScheduleJob();
        scheduleJob.setCreated(new Date(300000000000L));
        scheduleJob.setModified(new Date(300000000000L));
        scheduleJob.setName("dgfsrgw");
        scheduleJob.setDescription("wgwrgwg");
        scheduleJob.setCron("0 * * * * ?");
        scheduleJob.setTimezone("UTC");
        scheduleJob.setEnabled(true);
        scheduleJob.setStandby(false);
        scheduleJob.setAllNodes(true);
        scheduleJob.setStrategy(ScheduleExecutionStrategy.CIRCULAR);
        scheduleJob.setTimeout(1000);
        scheduleJob.setNodesLimit(1);
        scheduleJob.setAction(scheduleAction);
        scheduleJob.setGroup(scheduleGroup);
        scheduleGroup.getJobs().add(scheduleJob);
        businessEntityDao.save(scheduleJob);

        ScheduleExecution scheduleExecution = new ScheduleExecution();
        scheduleExecution.setStrategy(ScheduleExecutionStrategy.CIRCULAR);
        scheduleExecution.setName("rgwrgr");
View Full Code Here

            "10.2.0.2", "Node 2", true);
        Assert.assertNotNull(clusterNode2);

        // Create scheduled job

        ScheduleGroup scheduleGroup = scheduleJobManagementService.createGroup("Test group");
        Assert.assertNotNull(scheduleGroup);

        ScheduleJobCreateParameters jobParameters = new ScheduleJobCreateParameters();
        jobParameters.setName("Test Job");
        jobParameters.setDescription("Nothing to do");
        jobParameters.setTimezone("UTC");
        jobParameters.setCron("0 0 0 * * ?");
        jobParameters.setEnabled(true);
        jobParameters.setClusterGroupId(clusterGroup.getId());
        jobParameters.setScheduleGroupId(scheduleGroup.getId());
        jobParameters.setStrategy(ScheduleExecutionStrategy.CIRCULAR);
        jobParameters.setActionIdentifier("action.type");
        jobParameters.setActionDefinition("action.data".getBytes());

        ScheduleJob scheduleJob = scheduleJobManagementService.createJob(jobParameters);
View Full Code Here

    @Override
    public ScheduleGroup createGroup(String name) {
        Preconditions.checkNotNull(name, "Name is not specified");

        ScheduleGroup scheduleGroup = new ScheduleGroup();
        scheduleGroup.setName(name);

        businessEntityDao.save(scheduleGroup);

        return scheduleGroup;
    }
View Full Code Here

        businessEntityDao.deleteById(ScheduleGroup.class, scheduleGroupId);
    }

    @Override
    public ScheduleGroup findGroup(long scheduleGroupId) {
        ScheduleGroup scheduleGroup = businessEntityDao.findById(ScheduleGroup.class, scheduleGroupId);
        if (scheduleGroup != null) {
            Hibernate.initialize(scheduleGroup.getJobs());
        }
        return scheduleGroup;
    }
View Full Code Here

        return scheduleGroupDao.findAll(extraction);
    }

    @Override
    public ScheduleGroup modifyGroup(long scheduleGroupId, String name) {
        ScheduleGroup scheduleGroup = businessEntityDao.findById(ScheduleGroup.class, scheduleGroupId);
        if (scheduleGroup == null) {
            throw new MissingEntityException(ClusterGroup.class, scheduleGroupId);
        }

        scheduleGroup.setName(name);

        return scheduleGroup;
    }
View Full Code Here

            if (clusterGroup == null) {
                throw new MissingEntityException(ClusterGroup.class, parameters.getClusterGroupId());
            }
        }

        ScheduleGroup scheduleGroup = businessEntityDao.findById(ScheduleGroup.class, parameters.getScheduleGroupId());
        if (scheduleGroup == null) {
            throw new MissingEntityException(ScheduleGroup.class, parameters.getScheduleGroupId());
        }

        Date now = chronometer.getCurrentMoment();
View Full Code Here

        businessEntityDao.deleteById(ScheduleJob.class, scheduleJobId);

        quartzManagementService.deleteJob(scheduleJob.getId());

        ScheduleGroup scheduleGroup = scheduleJob.getGroup();
        scheduleGroup.getJobs().remove(scheduleJob);

        if (scheduleGroup.getJobs().size() == 0) {
            businessEntityDao.delete(scheduleGroup);
        }
    }
View Full Code Here

        ScheduleJob scheduleJob = businessEntityDao.lockById(ScheduleJob.class, scheduleJobId);
        if (scheduleJob == null) {
            throw new MissingEntityException(ScheduleJob.class, scheduleJobId);
        }

        ScheduleGroup newScheduleGroup = businessEntityDao.lockById(ScheduleGroup.class, scheduleGroupId);
        if (newScheduleGroup == null) {
            throw new MissingEntityException(ScheduleGroup.class, scheduleGroupId);
        }

        Date now = chronometer.getCurrentMoment();

        ScheduleGroup oldScheduleGroup = scheduleJob.getGroup();

        oldScheduleGroup.getJobs().remove(scheduleJob);
        scheduleJob.setGroup(null);

        newScheduleGroup.getJobs().add(scheduleJob);
        scheduleJob.setGroup(newScheduleGroup);
View Full Code Here

TOP

Related Classes of org.qzerver.model.domain.entities.job.ScheduleGroup

Copyright © 2018 www.massapicom. 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.