Package com.netflix.genie.common.model

Examples of com.netflix.genie.common.model.Job


    @Override
    @Transactional(readOnly = true)
    public Set<String> getTagsForJob(final String id) throws GenieException {
        this.testId(id);

        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            return job.getTags();
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists.");
        }
    }
View Full Code Here


    @Transactional(rollbackFor = GenieException.class)
    public Set<String> updateTagsForJob(
            final String id,
            final Set<String> tags) throws GenieException {
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.setTags(tags);
            return job.getTags();
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists.");
        }
    }
View Full Code Here

    @Override
    @Transactional(rollbackFor = GenieException.class)
    public Set<String> removeAllTagsForJob(
            final String id) throws GenieException {
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.getTags().clear();
            return job.getTags();
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists.");
        }
    }
View Full Code Here

        if (id.equals(tag)) {
            throw new GeniePreconditionException(
                    "Cannot delete job id from the tags list.");
        }

        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            if (StringUtils.isNotBlank(tag)) {
                job.getTags().remove(tag);
            }
            return job.getTags();
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists.");
        }
    }
View Full Code Here

    @Override
    @Transactional(rollbackFor = GenieException.class)
    public long setUpdateTime(final String id) throws GenieException {
        LOG.debug("Updating db for job: " + id);
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job == null) {
            throw new GenieNotFoundException(
                    "No job with id " + id + " exists"
            );
        }

        final long lastUpdatedTimeMS = System.currentTimeMillis();
        job.setJobStatus(JobStatus.RUNNING, "Job is running");
        job.setUpdated(new Date(lastUpdatedTimeMS));
        return lastUpdatedTimeMS;
    }
View Full Code Here

        LOG.debug("Setting job with id " + id + " to status " + status + " for reason " + msg);
        this.testId(id);
        if (status == null) {
            throw new GeniePreconditionException("No status entered.");
        }
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.setJobStatus(status, msg);
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists");
        }
    }
View Full Code Here

    @Override
    @Transactional(rollbackFor = GenieException.class)
    public void setProcessIdForJob(final String id, final int pid) throws GenieException {
        LOG.debug("Setting the id of process for job with id " + id + " to " + pid);
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.setProcessHandle(pid);
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists");
        }
    }
View Full Code Here

            final String id,
            final String commandId,
            final String commandName) throws GenieException {
        LOG.debug("Setting the command info for job with id " + id);
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            //TODO: Should we check if this is valid
            job.setCommandId(commandId);
            job.setCommandName(commandName);
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists");
        }
    }
View Full Code Here

            final String id,
            final String appId,
            final String appName) throws GenieException {
        LOG.debug("Setting the application info for job with id " + id);
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.setApplicationId(appId);
            job.setApplicationName(appName);
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists");
        }
    }
View Full Code Here

            final String id,
            final String clusterId,
            final String clusterName) throws GenieException {
        LOG.debug("Setting the application info for job with id " + id);
        this.testId(id);
        final Job job = this.jobRepo.findOne(id);
        if (job != null) {
            job.setExecutionClusterId(clusterId);
            job.setExecutionClusterName(clusterName);
        } else {
            throw new GenieNotFoundException("No job with id " + id + " exists");
        }
    }
View Full Code Here

TOP

Related Classes of com.netflix.genie.common.model.Job

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.