Package org.sonatype.configuration.validation

Examples of org.sonatype.configuration.validation.InvalidConfigurationException


      throws InvalidConfigurationException
  {
    final ValidationResponse vr = configurationValidator
        .validateLdapServerConfiguration(ldapServerConfiguration, false);
    if (vr.getValidationErrors().size() > 0) {
      throw new InvalidConfigurationException(vr);
    }
    final boolean wasUnconfigured = getConfiguration().getServers().isEmpty();
    getConfiguration().addServer(ldapServerConfiguration);
    save();
    if (wasUnconfigured) {
View Full Code Here


             LdapServerNotFoundException
  {
    final ValidationResponse vr = configurationValidator
        .validateLdapServerConfiguration(ldapServerConfiguration, true);
    if (vr.getValidationErrors().size() > 0) {
      throw new InvalidConfigurationException(vr);
    }

    // this list is ordered so we need to replace the old one
    final CLdapConfiguration ldapConfiguration = getConfiguration();
    for (int ii = 0; ii < ldapConfiguration.getServers().size(); ii++) {
View Full Code Here

      try {
        final CLdapConfiguration config = configurationSource.load();
        final ValidationResponse vr = configurationValidator
            .validateModel(new ValidationRequest<CLdapConfiguration>(config));
        if (vr.getValidationErrors().size() > 0) {
          throw new InvalidConfigurationException(vr);
        }
        ldapConfiguration = config;
      }
      catch (ConfigurationException e) {
        log.error("Invalid LDAP Configuration", e);
View Full Code Here

    ValidationResponse validationResponse = this.configurationValidator.validateConnectionInfo(
        null,
        connectionInfo);
    // if the info is not valid throw
    if (!validationResponse.isValid()) {
      throw new InvalidConfigurationException(validationResponse);
    }

    try {
      LdapContextFactory ldapContextFactory = this.buildDefaultLdapContextFactory(ldapServerId, connectionInfo);
      this.ldapConnectionTester.testConnection(ldapContextFactory);
View Full Code Here

              ldap201To280Upgrader);
      decryptPasswords(configuration);
      return configuration;
    }
    catch (CorruptModelException e) {
      throw new InvalidConfigurationException("LDAP configuration is corrupted", e);
    }
    catch (FileNotFoundException e) {
      // This is ok, may not exist first time around
      return defaultConfiguration();
    }
View Full Code Here

    ValidationResponse validationResponse = this.configurationValidator.validateLdapServerConfiguration(
        ldapServer,
        false);
    // if the info is not valid throw
    if (!validationResponse.isValid()) {
      throw new InvalidConfigurationException(validationResponse);
    }

    // its valid, now we need to deal with getting the users
    LdapUserListResponse result = new LdapUserListResponse();
    try {
View Full Code Here

    if (vr.isValid()) {
      this.getConfiguration().setAnonymousPassword(anonymousPassword);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

    if (vr.isValid()) {
      this.getConfiguration().setAnonymousUsername(anonymousUsername);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

    if (vr.isValid()) {
      this.getConfiguration().setRealms(realms);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
View Full Code Here

    if (vr.isValid()) {
      getConfiguration().addPrivilege(privilege);
      logValidationWarnings(vr);
    }
    else {
      throw new InvalidConfigurationException(vr);
    }
  }
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.