CreateServerConfigXML.java revision e70418658b6daa84fc8a1f13677d2cb616a66725
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/**
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The contents of this file are subject to the terms
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * of the Common Development and Distribution License
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * (the License). You may not use this file except in
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * compliance with the License.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * You can obtain a copy of the License at
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * https://opensso.dev.java.net/public/CDDLv1.0.html or
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * opensso/legal/CDDLv1.0.txt
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * See the License for the specific language governing
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * permission and limitations under the License.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * When distributing Covered Code, include this CDDL
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Header Notice in each file and include the License file
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * at opensso/legal/CDDLv1.0.txt.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * If applicable, add the following below the CDDL Header,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * with the fields enclosed by brackets [] replaced by
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * your own identifying information:
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * "Portions Copyrighted [year] [name of copyright owner]"
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * $Id: CreateServerConfigXML.java,v 1.7 2009/11/20 23:52:53 ww203982 Exp $
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/*
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Portions Copyrighted [2011] [ForgeRock AS]
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpackage com.sun.identity.cli.schema;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.iplanet.dpro.session.service.AMSessionRepository;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.iplanet.sso.SSOToken;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.AccessManagerConstants;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.AuthenticatedCommand;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.CLIException;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.CLIUtil;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.ExitCodes;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.IArgument;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.LogWriter;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.cli.RequestContext;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.common.DNUtils;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.log.Level;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.security.EncodeAction;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.io.FileOutputStream;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.io.IOException;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.io.InputStreamReader;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.security.AccessController;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.util.Iterator;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.util.List;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.shared.Constants;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.shared.configuration.SystemPropertiesManager;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.shared.ldap.LDAPDN;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.shared.ldap.util.DN;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.identity.shared.ldap.util.RDN;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpublic class CreateServerConfigXML extends AuthenticatedCommand implements Constants {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk static final String DS_HOST = "dshost";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk static final String DS_PORT = "dsport";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk static final String DS_ADMIN = "dsadmin";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk static final String DS_BASEDN = "basedn";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private static final String DS_PWD_FILE = "dspassword-file";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String dsHost;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String dsPort;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String dsAdmin;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String dsPassword;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String basedn;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /**
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Handles request.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @param rc Request Context.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * @throws CLIException if request cannot be processed.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk public void handleRequest(RequestContext rc)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk throws CLIException {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk super.handleRequest(rc);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ldapLogin();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk SSOToken adminSSOToken = getAdminSSOToken();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String outputFile = getStringOptionValue(IArgument.OUTPUT_FILE);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk FileOutputStream fout = null;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String[] param = {"tty"};
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String[] paramException = {"tty", ""};
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsHost = getStringOptionValue(DS_HOST);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPort = getStringOptionValue(DS_PORT);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsAdmin = getStringOptionValue(DS_ADMIN);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String dsPasswordFile = getStringOptionValue(DS_PWD_FILE);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk basedn = getStringOptionValue(DS_BASEDN);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((dsHost == null) || (dsHost.length() == 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsHost = "ds.opensso.java.net";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((dsPort == null) || (dsPort.length() == 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPort = "389";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((dsAdmin == null) || (dsAdmin.length() == 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsAdmin = "cn=Directory Manager";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((dsPasswordFile == null) || (dsPasswordFile.length() == 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPassword = "11111111";
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } else {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPassword = CLIUtil.getFileContent(getCommandManager(),
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPasswordFile);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((basedn == null) || (basedn.length() == 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk basedn = DEFAULT_ROOT_SUFFIX;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk dsPassword = (String)AccessController.doPrivileged(
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk new EncodeAction(dsPassword));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk try {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if ((outputFile != null) && (outputFile.length() > 0)) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk fout = new FileOutputStream(outputFile);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk param[0] = outputFile;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk paramException[0] = outputFile;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk writeLog(LogWriter.LOG_ACCESS, Level.INFO,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk "ATTEMPT_CREATE_SERVERCONFIG_XML", param);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String template = getResource("serverconfig.xml");
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String modified = modifyXML(template);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (fout != null) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk fout.write(modified.getBytes());
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } else {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk getOutputWriter().printlnMessage(modified);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk writeLog(LogWriter.LOG_ACCESS, Level.INFO,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk "SUCCEEDED_CREATE_SERVERCONFIG_XML", param);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } catch (IOException e) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk paramException[1] = e.getMessage();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk writeLog(LogWriter.LOG_ACCESS, Level.INFO,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk "FAILED_CREATE_SERVERCONFIG_XML", paramException);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } finally {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (fout != null) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk try {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk fout.close();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } catch (IOException ioe) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk //ignored
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private static String getResource(String file)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk throws IOException
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk InputStreamReader fin = null;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk StringBuffer sbuf = new StringBuffer();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk try {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk fin = new InputStreamReader(
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ClassLoader.getSystemResourceAsStream(file));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk char[] cbuf = new char[1024];
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk int len;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk while ((len = fin.read(cbuf)) > 0) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk sbuf.append(cbuf, 0, len);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } finally {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (fin != null) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk try {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk fin.close();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk } catch (Exception ex) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk //No handling requried
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk return sbuf.toString();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String modifyXML(String xml)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk throws CLIException {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String amadminPwds = CLIUtil.getFileContent(getCommandManager(),
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk getStringOptionValue(AccessManagerConstants.ARGUMENT_PASSWORD_FILE),
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk true);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk amadminPwds = (String)AccessController.doPrivileged(
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk new EncodeAction(amadminPwds));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String canRootSuffix = canonicalize(basedn);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@DIRECTORY_SERVER@", dsHost);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@DIRECTORY_PORT@", dsPort);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@NORMALIZED_ORGBASE@",
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk DNUtils.normalizeDN(basedn));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@DS_DIRMGRDN@", dsAdmin);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@ENCADMINPASSWD@", dsPassword);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@ENCADADMINPASSWD@", amadminPwds);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@SM_CONFIG_BASEDN@", canRootSuffix);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@ORG_BASE@", canRootSuffix);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk // Set up our Session SFHA Container.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@AMSESSIONDB_BASEDN@",
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk SystemPropertiesManager.get(AMSessionRepository.SYS_PROPERTY_SESSION_HA_REPOSITORY_ROOT_DN,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk Constants.DEFAULT_SESSION_HA_ROOT_DN));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk String rdn = SystemPropertiesManager.get(AMSessionRepository.SYS_PROPERTY_SESSION_HA_REPOSITORY_ROOT_DN,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk Constants.DEFAULT_SESSION_HA_ROOT_DN);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk int x = rdn.indexOf(Constants.EQUALS);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (x>0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk int y = rdn.indexOf(Constants.COMMA);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (y>0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk rdn = rdn.substring(x+1,y);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk xml = xml.replaceAll("@AMSESSIONDB_RDN@", rdn);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk return xml;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private String canonicalize(String nSuffix) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk StringBuffer buff = new StringBuffer(1024);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk DN dn = new DN(nSuffix);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk List rdns = dn.getRDNs();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk for (Iterator iter = rdns.iterator(); iter.hasNext();) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk RDN rdn = (RDN) iter.next();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk buff.append(LDAPDN.escapeRDN(rdn.toString()));
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if (iter.hasNext()) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk buff.append(",");
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk return buff.toString();
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk }
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk}
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk