Package com.sonatype.security.ldap.realms.persist.model.io.xpp3

Examples of com.sonatype.security.ldap.realms.persist.model.io.xpp3.LdapConfigurationXpp3Reader


    }

    @Override
    public void doUpgrade(final Reader reader, final Writer writer) throws IOException, XmlPullParserException {
      // no model structure change, merely the version
      final CLdapConfiguration configuration = new LdapConfigurationXpp3Reader().read(reader);
      configuration.setVersion(toVersion());
      new LdapConfigurationXpp3Writer().write(writer, configuration);
    }
View Full Code Here


  protected CLdapConfiguration getConfigFromFile()
      throws IOException, XmlPullParserException
  {
    try (FileReader fr = new FileReader(new File(getConfHomeDir(), "ldap.xml"))) {
      LdapConfigurationXpp3Reader reader = new LdapConfigurationXpp3Reader();
      return reader.read(fr);
    }
  }
View Full Code Here

  }

  private String clearPasswords(String ldapConfigAsString)
      throws Exception
  {
    LdapConfigurationXpp3Reader reader = new LdapConfigurationXpp3Reader();
    CLdapConfiguration ldapConfiguration = reader.read(new StringReader(ldapConfigAsString));
    // loop through and set the passwords to clear text
    for (CLdapServerConfiguration ldapServer : ldapConfiguration.getServers()) {
      this.convertPasswordsToClearText(ldapServer);
    }
View Full Code Here

      }
      newServerConfig.setUserAndGroupConfig(convertUserAndGroupInfo(ossConfiguration.getUserAndGroupConfig()));
      final CLdapConfiguration newConfiguration = new CLdapConfiguration();
      newConfiguration.setVersion(toVersion());
      newConfiguration.addServer(newServerConfig);
      new LdapConfigurationXpp3Writer().write(writer, newConfiguration);
    }
View Full Code Here

    @Override
    public void doUpgrade(final Reader reader, final Writer writer) throws IOException, XmlPullParserException {
      // no model structure change, merely the version
      final CLdapConfiguration configuration = new LdapConfigurationXpp3Reader().read(reader);
      configuration.setVersion(toVersion());
      new LdapConfigurationXpp3Writer().write(writer, configuration);
    }
View Full Code Here

    // loop through and set the passwords to clear text
    for (CLdapServerConfiguration ldapServer : ldapConfiguration.getServers()) {
      this.convertPasswordsToClearText(ldapServer);
    }

    LdapConfigurationXpp3Writer writer = new LdapConfigurationXpp3Writer();
    StringWriter stringWriter = new StringWriter();
    writer.write(stringWriter, ldapConfiguration);

    return stringWriter.toString();
  }
View Full Code Here

TOP

Related Classes of com.sonatype.security.ldap.realms.persist.model.io.xpp3.LdapConfigurationXpp3Reader

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.