Examples of addValidationError()


Examples of com.sequenceiq.cloudbreak.controller.json.ValidationResult.addValidationError()

    public ResponseEntity<ValidationResult> validationFailed(MethodArgumentNotValidException e) {
        MDCBuilder.buildMdcContext();
        LOGGER.error(e.getMessage(), e);
        ValidationResult result = new ValidationResult();
        for (FieldError err : e.getBindingResult().getFieldErrors()) {
            result.addValidationError(err.getField(), err.getDefaultMessage());
        }
        return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
    }

    @ExceptionHandler({ HttpRequestMethodNotSupportedException.class })
View Full Code Here

Examples of org.broadleafcommerce.openadmin.dto.Entity.addValidationError()

        try {
            Map<String, FieldMetadata> ceilingMergedProperties = getSimpleMergedProperties(entity.getType()[0],
                    persistencePerspective);
            String mapKey = entity.findProperty(mapStructure.getKeyPropertyName()).getValue();
            if (StringUtils.isEmpty(mapKey)) {
                entity.addValidationError(mapStructure.getKeyPropertyName(), RequiredPropertyValidator.ERROR_MESSAGE);
                LOG.debug("No key property passed in for map, failing validation");
            }
           
            if (ceilingMergedProperties.containsKey(mapStructure.getMapProperty() + FieldManager.MAPFIELDSEPARATOR + mapKey)) {
                throw new ServiceException("\"" + mapKey + "\" is a reserved property name.");
View Full Code Here

Examples of org.elasticsearch.action.ActionRequestValidationException.addValidationError()

    @Override
    public ActionRequestValidationException validate() {
        if (stmt == null) {
            ActionRequestValidationException e =  new ActionRequestValidationException();
            e.addValidationError("Attribute 'stmt' must not be null");
            return e;
        }
        return null;
    }
View Full Code Here

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

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

      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

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

    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

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

      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

Examples of org.sonatype.configuration.validation.ValidationResponse.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.configuration.validation.ValidationResponse.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.configuration.validation.ValidationResponse.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.