Package com.netflix.genie.common.exceptions

Examples of com.netflix.genie.common.exceptions.GenieConflictException


        LOG.debug("Called to create cluster " + cluster.toString());
        if (StringUtils.isEmpty(cluster.getId())) {
            cluster.setId(UUID.randomUUID().toString());
        }
        if (this.clusterRepo.exists(cluster.getId())) {
            throw new GenieConflictException("A cluster with id " + cluster.getId() + " already exists");
        }

        return this.clusterRepo.save(cluster);
    }
View Full Code Here


            throw new GeniePreconditionException("No job entered to run");
        }

        if (StringUtils.isNotBlank(job.getId())
                && this.jobRepo.exists(job.getId())) {
            throw new GenieConflictException("Job with ID specified already exists.");
        }

        // Check if the job is forwarded. If not this is the first node that got the request.
        // So we log it, to track all requests.
        if (!job.isForwarded()) {
View Full Code Here

    /**
     * Test 409.
     */
    @Test
    public void testGenieConflictException() {
        final GenieException ge = new GenieConflictException(ERROR_MESSAGE);
        final Response response = this.mapper.toResponse(ge);
        Assert.assertEquals(HttpURLConnection.HTTP_CONFLICT, response.getStatus());
        Assert.assertNotNull(response.getEntity());
        Assert.assertEquals(ERROR_MESSAGE, response.getEntity());
    }
View Full Code Here

    @Override
    @Transactional
    public Job createJob(final Job job) throws GenieException {
        if (StringUtils.isNotEmpty(job.getId())
                && this.jobRepo.exists(job.getId())) {
            throw new GenieConflictException(
                    "A job with id " + job.getId() + " already exists. Unable to save."
            );
        }
        // validate parameters
        job.validate();
View Full Code Here

        }
        app.validate();

        LOG.debug("Called with application: " + app.toString());
        if (app.getId() != null && this.applicationRepo.exists(app.getId())) {
            throw new GenieConflictException("An application with id " + app.getId() + " already exists");
        }
        return this.applicationRepo.save(app);
    }
View Full Code Here

        LOG.debug("Called to create command " + command.toString());
        if (StringUtils.isEmpty(command.getId())) {
            command.setId(UUID.randomUUID().toString());
        }
        if (this.commandRepo.exists(command.getId())) {
            throw new GenieConflictException("A command with id " + command.getId() + " already exists");
        }

        return this.commandRepo.save(command);
    }
View Full Code Here

TOP

Related Classes of com.netflix.genie.common.exceptions.GenieConflictException

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.