Examples of addValidationError()


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

      if (!valid) {
        ValidationMessage message =
            new ValidationMessage("method", "Privilege ID '" + privilege.getId()
                + "' Method is wrong! (Allowed methods are: create, delete, read and update)",
                "Invalid method selected.");
        response.addValidationError(message);
      }
    }

    return response;
  }
View Full Code Here

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

    }

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

    if (StringUtils.isEmpty(repo.getId())) {
      response.addValidationError(new ValidationMessage("id", "Repository ID's may not be empty!"));
    }
    else if (!repo.getId().matches(REPOSITORY_ID_PATTERN)) {
      response.addValidationError(
          new ValidationMessage("id",
              "Only letters, digits, underscores(_), hyphens(-), and dots(.) are allowed in Repository ID"));
View Full Code Here

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

    if (StringUtils.isEmpty(repo.getId())) {
      response.addValidationError(new ValidationMessage("id", "Repository ID's may not be empty!"));
    }
    else if (!repo.getId().matches(REPOSITORY_ID_PATTERN)) {
      response.addValidationError(
          new ValidationMessage("id",
              "Only letters, digits, underscores(_), hyphens(-), and dots(.) are allowed in Repository ID"));
    }
    // if repo id isn't valid, nothing below here will validate properly
    else {
View Full Code Here

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

          new ValidationMessage("shadowOf", e.getMessage(),
              "The source nexus repository is of an invalid Format.");

      ValidationResponse response = new ApplicationValidationResponse();

      response.addValidationError(message);

      throw new InvalidConfigurationException(response);
    }
    catch (NoSuchRepositoryException e) {
      ValidationMessage message =
View Full Code Here

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

      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

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

      catch (RemoteStorageException e) {
        ValidationResponse response = new ApplicationValidationResponse();

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

        response.addValidationError(error);

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

Examples of org.sonatype.nexus.configuration.validator.ApplicationValidationResponse.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

Examples of org.sonatype.nexus.configuration.validator.ApplicationValidationResponse.addValidationError()

                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

Examples of org.sonatype.nexus.configuration.validator.ApplicationValidationResponse.addValidationError()

        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

Examples of org.sonatype.nexus.configuration.validator.ApplicationValidationResponse.addValidationError()

      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
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.