Package org.sonatype.configuration.validation

Examples of org.sonatype.configuration.validation.InvalidConfigurationException


    if (vr.isValid()) {
      getConfiguration().addRole(role);
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here


      getConfiguration().addUser(user);
      createOrUpdateUserRoleMapping(buildUserRoleMapping(user.getId(), roles));
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

      deletePrivilege(privilege.getId(), false);
      getConfiguration().addPrivilege(privilege);
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

      deleteRole(role.getId(), false);
      getConfiguration().addRole(role);
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

      getConfiguration().addUser(user);
      this.createOrUpdateUserRoleMapping(this.buildUserRoleMapping(user.getId(), roles));
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

      ValidationResponse vr = new ValidationResponse();
      vr.addValidationError(new ValidationMessage("*", "User Role Mapping for user '"
          + userRoleMapping.getUserId() + "' already exists."));

      throw new InvalidConfigurationException(vr);
    }
    catch (NoSuchRoleMappingException e) {
      // expected
    }

    ValidationResponse vr = validator.validateUserRoleMapping(context, userRoleMapping, false);

    if (vr.getValidationErrors().size() > 0) {
      throw new InvalidConfigurationException(vr);
    }

    getConfiguration().addUserRoleMapping(userRoleMapping);
    logValidationWarnings(vr);
  }
View Full Code Here

    if (readUserRoleMapping(userRoleMapping.getUserId(), userRoleMapping.getSource()) == null) {
      ValidationResponse vr = new ValidationResponse();
      vr.addValidationError(new ValidationMessage("*", "No User Role Mapping found for user '"
          + userRoleMapping.getUserId() + "'."));

      throw new InvalidConfigurationException(vr);
    }

    ValidationResponse vr = validator.validateUserRoleMapping(context, userRoleMapping, true);

    if (vr.getValidationErrors().size() > 0) {
      throw new InvalidConfigurationException(vr);
    }

    deleteUserRoleMapping(userRoleMapping.getUserId(), userRoleMapping.getSource());
    getConfiguration().addUserRoleMapping(userRoleMapping);
  }
View Full Code Here

  protected void checkValidationResponse(ValidationResponse response)
      throws ConfigurationException
  {
    if (response != null && !response.isValid()) {
      throw new InvalidConfigurationException(response);
    }
  }
View Full Code Here

      ValidationResponse response = new ApplicationValidationResponse();

      response.addValidationError(message);

      throw new InvalidConfigurationException(response);
    }
    catch (NoSuchRepositoryException e) {
      ValidationMessage message =
          new ValidationMessage("shadowOf", e.getMessage(), "The source nexus repository is not existing.");

      ValidationResponse response = new ApplicationValidationResponse();

      response.addValidationError(message);

      throw new InvalidConfigurationException(response);
    }
  }
View Full Code Here

        ValidationMessage error = new ValidationMessage("remoteStorageUrl", e.getMessage(), e.getMessage());

        response.addValidationError(error);

        throw new InvalidConfigurationException(response);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.sonatype.configuration.validation.InvalidConfigurationException

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.