Package org.candlepin.pinsetter.core.model

Examples of org.candlepin.pinsetter.core.model.JobStatus


        this.config = config;
    }

    public JobStatus cancel(String jobId) {
        this.cancelNoReturn(jobId);
        JobStatus result = this.find(jobId);
        if (result != null) {
            this.refresh(result);
        }
        return result;
    }
View Full Code Here


        scheduler.getListenerManager().addJobListenerMatcher(
            PinsetterJobListener.LISTENER_NAME,
            jobNameEquals(detail.getKey().getName()));

        JobStatus status = null;
        try {
            status = jobCurator.create(new JobStatus(detail, trigger == null));
        }
        catch (EntityExistsException e) {
            // status exists, let's update it
            // in theory this should be the rare case
            status = jobCurator.find(detail.getKey().getName());
View Full Code Here

        JobDetailImpl detailImpl = (JobDetailImpl) detail;
        detailImpl.setGroup(grpName);

        try {
            JobStatus status = (JobStatus) (detail.getJobClass()
                .getMethod("scheduleJob", JobCurator.class,
                    Scheduler.class, JobDetail.class, Trigger.class)
                .invoke(null, jobCurator, scheduler, detail, trigger));

            if (log.isDebugEnabled()) {
View Full Code Here

        updateJob(ctx, null);
    }

    @Transactional
    private void updateJob(JobExecutionContext ctx, JobExecutionException exc) {
        JobStatus status = curator.find(ctx.getJobDetail().getKey().getName());
        if (status != null) {
            if (exc != null) {
                log.error("Job [" + status.getId() + "] failed." , exc);
                status.setState(JobState.FAILED);
                status.setResult(exc.getMessage());
            }
            else {
                status.update(ctx);
            }
            curator.merge(status);
        }
        else {
            log.debug("No jobinfo found for job: " + ctx);
View Full Code Here

    @SuppressWarnings("unchecked")
    public static JobStatus scheduleJob(JobCurator jobCurator,
        Scheduler scheduler, JobDetail detail,
        Trigger trigger) throws SchedulerException {
        JobStatus result = jobCurator.getByClassAndOwner(
            detail.getJobDataMap().getString(JobStatus.TARGET_ID),
            (Class<? extends KingpinJob>) detail.getJobClass());
        if (result == null) {
            return KingpinJob.scheduleJob(jobCurator, scheduler, detail, trigger);
        }
        if (result.getState() == JobStatus.JobState.PENDING ||
            result.getState() == JobStatus.JobState.CREATED ||
            result.getState() == JobStatus.JobState.WAITING) {
            log.debug("Returning existing job id: " + result.getId());
            return result;
        }
        log.debug("Scheduling job without a trigger: " + detail.getKey().getName());
        JobStatus status = KingpinJob.scheduleJob(jobCurator, scheduler, detail, null);
        return status;
    }
View Full Code Here

TOP

Related Classes of org.candlepin.pinsetter.core.model.JobStatus

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.