Package com.netflix.genie.common.model

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


            throw new GeniePreconditionException("No command id entered. Unable to add configurations.");
        }
        if (configs == null) {
            throw new GeniePreconditionException("No configuration files entered.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            command.getConfigs().addAll(configs);
            return command.getConfigs();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here


    public Set<String> getConfigsForCommand(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to get configs.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            return command.getConfigs();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

            final String id,
            final Set<String> configs) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to update configurations.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            command.setConfigs(configs);
            return command.getConfigs();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

    public Set<String> removeAllConfigsForCommand(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to remove configs.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            command.getConfigs().clear();
            return command.getConfigs();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

            final String id,
            final String config) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to remove configuration.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            if (StringUtils.isNotBlank(config)) {
                command.getConfigs().remove(config);
            }
            return command.getConfigs();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

            throw new GeniePreconditionException("No application entered. Unable to set application.");
        }
        if (StringUtils.isBlank(application.getId())) {
            throw new GeniePreconditionException("No application id entered. Unable to set application.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            final Application app = this.appRepo.findOne(application.getId());
            if (app != null) {
                command.setApplication(app);
            } else {
                throw new GenieNotFoundException("No application with id " + application.getId() + " exists.");
            }
            return command.getApplication();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

    public Application getApplicationForCommand(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to get applications.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            final Application app = command.getApplication();
            if (app != null) {
                return app;
            } else {
                throw new GenieNotFoundException("No application set for command with id '" + id + "'.");
            }
View Full Code Here

    public Application removeApplicationForCommand(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id entered. Unable to remove application.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            final Application app = command.getApplication();
            if (app != null) {
                command.setApplication(null);
                return app;
            } else {
                throw new GenieNotFoundException("No application set for command with id '" + id + "'.");
            }
        } else {
View Full Code Here

            throw new GeniePreconditionException("No command id entered. Unable to add tags.");
        }
        if (tags == null) {
            throw new GeniePreconditionException("No tags entered.");
        }
        final Command command = this.commandRepo.findOne(id);
        if (command != null) {
            command.getTags().addAll(tags);
            return command.getTags();
        } else {
            throw new GenieNotFoundException("No command with id " + id + " exists.");
        }
    }
View Full Code Here

        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No command id sent. Cannot retrieve tags.");
        }

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

TOP

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

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.