Package org.sonatype.configuration.validation

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


      ValidationMessage error =
          new ValidationMessage("overrideLocalStorageUrl", "Repository has an invalid local storage URL '"
              + localUrl, "Invalid file location");

      response.addValidationError(error);

      throw new InvalidConfigurationException(response);
    }

    // clear the NotFoundCache
View Full Code Here


      ValidationMessage message =
          new ValidationMessage("shadowOf", "Master repository id=\"" + getMasterRepositoryId()
              + "\" not found for ShadowRepository with id=\"" + id + "\"!",
              "The source nexus repository is not existing.");

      response.addValidationError(message);
    }

    return response;
  }
}
View Full Code Here

    if (!allReposesIds.containsAll(memberRepositoryIds)) {
      ValidationMessage message =
          new ValidationMessage(MEMBER_REPOSITORIES, "Group repository points to nonexistent members!",
              "The source nexus repository is not existing.");

      response.addValidationError(message);
    }

    final Set<String> uniqueReposesIds = Sets.newHashSet(memberRepositoryIds);
    if (uniqueReposesIds.size() != memberRepositoryIds.size()) {
      response.addValidationError(new ValidationMessage(
View Full Code Here

      response.addValidationError(message);
    }

    final Set<String> uniqueReposesIds = Sets.newHashSet(memberRepositoryIds);
    if (uniqueReposesIds.size() != memberRepositoryIds.size()) {
      response.addValidationError(new ValidationMessage(
          MEMBER_REPOSITORIES,
          "Group repository has same member multiple times!",
          "Group repository has same member multiple times!"
      ));
    }
View Full Code Here

                proxyRepo.setRemoteUrl(model.getRemoteStorage().getRemoteStorageUrl());
              }
              catch (RemoteStorageException e) {
                ValidationResponse vr = new ApplicationValidationResponse();
                ValidationMessage error = new ValidationMessage("remoteStorageUrl", e.getMessage(), e.getMessage());
                vr.addValidationError(error);
                throw new InvalidConfigurationException(vr);
              }
              String oldPasswordForRemoteStorage = null;
              if (proxyRepo.getRemoteAuthenticationSettings() != null
                  && UsernamePasswordRemoteAuthenticationSettings.class.isInstance(proxyRepo
View Full Code Here

        getLogger().debug("Validation error for startDate: " + startDate.toString());
      }

      ValidationResponse vr = new ApplicationValidationResponse();
      ValidationMessage vm = new ValidationMessage("startDate", "Date cannot be in the past.");
      vr.addValidationError(vm);
      throw new InvalidConfigurationException(vr);
    }
  }

  public void validateTime(String key, Date date)
View Full Code Here

      throws InvalidConfigurationException
  {
    if (date.before(new Date())) {
      ValidationResponse vr = new ApplicationValidationResponse();
      ValidationMessage vm = new ValidationMessage(key, "Time cannot be in the past.");
      vr.addValidationError(vm);
      throw new InvalidConfigurationException(vr);
    }
  }

  public Schedule getModelSchedule(ScheduledServiceBaseResource model)
View Full Code Here

      }
    }

    if (!found) {
      ValidationResponse response = new ValidationResponse();
      response.addValidationError(new ValidationMessage("status", "Users status is not valid."));
      throw new InvalidConfigurationException(response);
    }
  }

  protected String getRequestAttribute(final Request request, final String key) {
View Full Code Here

  {
    ValidationResponse response = new ValidationResponse();

    if (ldapServerConfiguration == null) {
      ValidationMessage msg = new ValidationMessage("*", "Configuration is missing.");
      response.addValidationError(msg);
    }
    else {

      if (StringUtils.isEmpty(ldapServerConfiguration.getId()) && !update) {
        ValidationMessage msg = new ValidationMessage("id", "Id was generated.");
View Full Code Here

        response.addValidationWarning(msg);
      }

      if (StringUtils.isEmpty(ldapServerConfiguration.getName())) {
        ValidationMessage msg = new ValidationMessage("name", "Name cannot be empty.");
        response.addValidationError(msg);
      }

      if (ldapServerConfiguration.getConnectionInfo() != null) {
        ValidationResponse vr = this.validateConnectionInfo(null, ldapServerConfiguration.getConnectionInfo());
        response.append(vr);
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.