Package org.sonatype.configuration.validation

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()


    // LocalStatus
    try {
      LocalStatus.valueOf(cfg.getLocalStatus());
    }
    catch (Exception e) {
      response.addValidationError(new ValidationMessage("localStatus", "LocalStatus of repository with ID=\""
          + cfg.getId() + "\" has unacceptable value \"" + cfg.getLocalStatus() + "\"! (Allowed values are: \""
          + LocalStatus.IN_SERVICE + "\" and \"" + LocalStatus.OUT_OF_SERVICE + "\")", e));
    }

    // indexable
View Full Code Here


      response.setModified(true);
    }

    if (item.getRoutePatterns() == null || item.getRoutePatterns().isEmpty()) {
      response.addValidationError("The Route with ID='" + item.getId() + "' must contain at least one Route Pattern.");
    }

    for (String regexp : item.getRoutePatterns()) {
      if (!isValidRegexp(regexp)) {
        response.addValidationError("The regexp in Route with ID='" + item.getId() + "' is not valid: "
View Full Code Here

      response.addValidationError("The Route with ID='" + item.getId() + "' must contain at least one Route Pattern.");
    }

    for (String regexp : item.getRoutePatterns()) {
      if (!isValidRegexp(regexp)) {
        response.addValidationError("The regexp in Route with ID='" + item.getId() + "' is not valid: "
            + regexp);
      }
    }

    if (context.getExistingPathMappingIds() != null) {
View Full Code Here

    }

    if (!CPathMappingItem.INCLUSION_RULE_TYPE.equals(item.getRouteType())
        && !CPathMappingItem.EXCLUSION_RULE_TYPE.equals(item.getRouteType())
        && !CPathMappingItem.BLOCKING_RULE_TYPE.equals(item.getRouteType())) {
      response.addValidationError("The groupMapping pattern with ID=" + item.getId()
          + " have invalid routeType='" + item.getRouteType() + "'. Valid route types are '"
          + CPathMappingItem.INCLUSION_RULE_TYPE + "', '" + CPathMappingItem.EXCLUSION_RULE_TYPE + "' and '"
          + CPathMappingItem.BLOCKING_RULE_TYPE + "'.");
    }
View Full Code Here

      List<String> existingShadows = context.getExistingRepositoryShadowIds();

      for (String repoId : item.getRepositories()) {
        if (!existingReposes.contains(repoId) && !existingShadows.contains(repoId)) {
          response.addValidationError("The groupMapping pattern with ID=" + item.getId()
              + " refers to a nonexistent repository with repoID = " + repoId);
        }
      }
    }
View Full Code Here

      response.setModified(true);
    }

    if (!CHttpProxySettings.PROXY_POLICY_PASS_THRU.equals(settings.getProxyPolicy())
        && !CHttpProxySettings.PROXY_POLICY_STRICT.equals(settings.getProxyPolicy())) {
      response.addValidationError("The HTTP Proxy policy settings is invalid: '" + settings.getProxyPolicy()
          + "'. Valid policies are '" + CHttpProxySettings.PROXY_POLICY_STRICT + "' and '"
          + CHttpProxySettings.PROXY_POLICY_PASS_THRU + "'.");
    }

    return response;
View Full Code Here

    if (ctx != null) {
      response.setContext(ctx);
    }

    if (settings.getProxyPort() < 1 || settings.getProxyPort() > 65535) {
      response.addValidationError("The proxy port must be an integer between 1 and 65535!");
    }

    response.append(validateRemoteAuthentication(ctx, settings.getAuthentication()));

    return response;
View Full Code Here

        response.setModified(true);
      }

      if (StringUtils.isEmpty(mirror.getId())) {
        response.addValidationError("The Mirror may have no empty/null ID!");
      }

      if (StringUtils.isEmpty(mirror.getUrl())) {
        response.addValidationError("The Mirror may have no empty/null URL!");
      }
View Full Code Here

      if (StringUtils.isEmpty(mirror.getId())) {
        response.addValidationError("The Mirror may have no empty/null ID!");
      }

      if (StringUtils.isEmpty(mirror.getUrl())) {
        response.addValidationError("The Mirror may have no empty/null URL!");
      }
    }

    return response;
  }
View Full Code Here

    }

    ApplicationValidationContext context = (ApplicationValidationContext) response.getContext();

    if (StringUtils.isEmpty(settings.getId())) {
      response.addValidationError("The RepositoryTarget may have no empty/null ID!");
    }

    if (StringUtils.isEmpty(settings.getName())) {
      response.addValidationError("The RepositoryTarget may have no empty/null Name!");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.