Package com.netflix.genie.common.exceptions

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


    public Set<String> getTagsForApplication(
            final String id)
            throws GenieException {

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

        final Application application = this.applicationRepo.findOne(id);
        if (application != null) {
            return application.getTags();
View Full Code Here


    @Override
    public Set<String> updateTagsForApplication(
            final String id,
            final Set<String> tags) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No application id entered. Unable to update tags.");
        }
        final Application application = this.applicationRepo.findOne(id);
        if (application != null) {
            application.setTags(tags);
            return application.getTags();
View Full Code Here

     */
    @Override
    public Set<String> removeAllTagsForApplication(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No application id entered. Unable to remove tags.");
        }
        final Application application = this.applicationRepo.findOne(id);
        if (application != null) {
            application.getTags().clear();
            return application.getTags();
View Full Code Here

     */
    @Override
    public Set<String> removeTagForApplication(final String id, final String tag)
            throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No application id entered. Unable to remove tag.");
        }

        final Application application = this.applicationRepo.findOne(id);
        if (application != null) {
            if (StringUtils.isNotBlank(tag)) {
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public Set<Command> getCommandsForApplication(
            final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("No application id entered. Unable to get commands.");
        }
        final Application app = this.applicationRepo.findOne(id);
        if (app != null) {
            return app.getCommands();
        } else {
View Full Code Here

     * @throws GenieException For any other error.
     */
    public Application createApplication(final Application application)
            throws GenieException {
        if (application == null) {
            throw new GeniePreconditionException("No application passed in. Unable to validate.");
        }

        application.validate();
        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.POST,
View Full Code Here

    public Application updateApplication(
            final String id,
            final Application application)
            throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("Required parameter id is missing. Unable to update.");
        }

        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.PUT,
                StringUtils.join(
View Full Code Here

     * @return the application for this id
     * @throws GenieException For any other error.
     */
    public Application getApplication(final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("Required parameter id is missing. Unable to get.");
        }

        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.GET,
                StringUtils.join(
View Full Code Here

     * @return the deleted application
     * @throws GenieException For any other error.
     */
    public Application deleteApplication(final String id) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("Missing required parameter: id");
        }

        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.DELETE,
                StringUtils.join(
View Full Code Here

     */
    public Set<String> addConfigsToApplication(
            final String id,
            final Set<String> configs) throws GenieException {
        if (StringUtils.isBlank(id)) {
            throw new GeniePreconditionException("Missing required parameter: id");
        }
        if (configs == null || configs.isEmpty()) {
            throw new GeniePreconditionException("Missing required parameter: configs");
        }

        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.POST,
                StringUtils.join(
View Full Code Here

TOP

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

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.