Prep work for OPENDJ-1342: align APIs for DNs and RDNs
(R)DN.toString(StringBuilder) => StringBuilder.append(Object)
| | |
| | | else |
| | | { |
| | | Iterator<DN> iterator = passwordValidators.keySet().iterator(); |
| | | iterator.next().toString(buffer); |
| | | buffer.append(iterator.next()); |
| | | buffer.append(EOL); |
| | | |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(" "); |
| | | iterator.next().toString(buffer); |
| | | buffer.append(iterator.next()); |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | configuration.getPasswordGeneratorDN().toString(buffer); |
| | | buffer.append(configuration.getPasswordGeneratorDN()); |
| | | } |
| | | buffer.append(EOL); |
| | | |
| | |
| | | else |
| | | { |
| | | Iterator<DN> iterator = notificationHandlers.keySet().iterator(); |
| | | iterator.next().toString(buffer); |
| | | buffer.append(iterator.next()); |
| | | buffer.append(EOL); |
| | | |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(" "); |
| | | iterator.next().toString(buffer); |
| | | buffer.append(iterator.next()); |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | |
| | | buffer.append(",opID="); |
| | | buffer.append(searchOperation.getOperationID()); |
| | | buffer.append(",baseDN=\""); |
| | | searchOperation.getBaseDN().toString(buffer); |
| | | buffer.append(searchOperation.getBaseDN()); |
| | | buffer.append("\",scope="); |
| | | buffer.append(searchOperation.getScope()); |
| | | buffer.append(",filter=\""); |
| | |
| | | * Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2013-2015 ForgeRock AS. |
| | | * Copyright 2013-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.http; |
| | | |
| | |
| | | DN authDN = getAuthenticationInfo().getAuthenticationDN(); |
| | | if (authDN != null) |
| | | { |
| | | authDN.toString(buffer); |
| | | buffer.append(authDN); |
| | | } |
| | | return buffer.toString(); |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | |
| | |
| | | DN authDN = getAuthenticationInfo().getAuthenticationDN(); |
| | | if (authDN != null) |
| | | { |
| | | authDN.toString(buffer); |
| | | buffer.append(authDN); |
| | | } |
| | | buffer.append("\""); |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2010-2015 ForgeRock AS. |
| | | * Portions Copyright 2010-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | DN authDN = getAuthenticationInfo().getAuthenticationDN(); |
| | | if (authDN != null) |
| | | { |
| | | authDN.toString(buffer); |
| | | buffer.append(authDN); |
| | | } |
| | | |
| | | buffer.append("\" security=\""); |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | buffer.append(indentBuf); |
| | | buffer.append(" Matched DN: "); |
| | | matchedDN.toString(buffer); |
| | | buffer.append(matchedDN); |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append("SearchResultEntry(dn="); |
| | | dn.toString(buffer); |
| | | buffer.append(dn); |
| | | buffer.append(", attrs={"); |
| | | |
| | | LinkedList<LDAPAttribute> tmp = getAttributes(); |
| | |
| | | |
| | | buffer.append(indentBuf); |
| | | buffer.append(" DN: "); |
| | | dn.toString(buffer); |
| | | buffer.append(dn); |
| | | buffer.append(EOL); |
| | | |
| | | buffer.append(" Attributes:"); |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | { |
| | | for (Entry<DN, ServerState> entry : list.entrySet()) |
| | | { |
| | | entry.getKey().toString(buffer); |
| | | buffer.append(entry.getKey()); |
| | | buffer.append(":"); |
| | | entry.getValue().toString(buffer); |
| | | buffer.append(";"); |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tools.makeldif; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | if (numComponents == 0) |
| | | { |
| | | dn.toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn); |
| | | } |
| | | else if (numComponents > 0) |
| | | { |
| | | int count = Math.min(numComponents, dn.size()); |
| | | |
| | | dn.getRDN(0).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(0)); |
| | | for (int i = 1; i < count; i++) |
| | | { |
| | | templateValue.append(","); |
| | | dn.getRDN(i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(i)); |
| | | } |
| | | } |
| | | else |
| | |
| | | int sz = dn.size(); |
| | | int count = Math.min(Math.abs(numComponents), sz); |
| | | |
| | | dn.getRDN(sz - count).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(sz - count)); |
| | | for (int i = 1; i < count; i++) |
| | | { |
| | | templateValue.append(","); |
| | | dn.getRDN(sz - count + i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(sz - count + i)); |
| | | } |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tools.makeldif; |
| | | |
| | |
| | | return TagResult.SUCCESS_RESULT; |
| | | } |
| | | |
| | | parentDN.toString(templateValue.getValue()); |
| | | templateValue.getValue().append(parentDN); |
| | | return TagResult.SUCCESS_RESULT; |
| | | } |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tools.makeldif; |
| | | |
| | |
| | | DN dn = templateEntry.getDN(); |
| | | if (dn != null && !dn.isRootDN()) |
| | | { |
| | | dn.rdn().toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.rdn()); |
| | | } |
| | | return TagResult.SUCCESS_RESULT; |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tools.makeldif; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | if (numComponents == 0) |
| | | { |
| | | dn.getRDN(0).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(0)); |
| | | for (int i=1; i < dn.size(); i++) |
| | | { |
| | | templateValue.append("_"); |
| | | dn.getRDN(i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(i)); |
| | | } |
| | | } |
| | | else if (numComponents > 0) |
| | | { |
| | | int count = Math.min(numComponents, dn.size()); |
| | | |
| | | dn.getRDN(0).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(0)); |
| | | for (int i = 1; i < count; i++) |
| | | { |
| | | templateValue.append("_"); |
| | | dn.getRDN(i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(i)); |
| | | } |
| | | } |
| | | else |
| | |
| | | int sz = dn.size(); |
| | | int count = Math.min(Math.abs(numComponents), sz); |
| | | |
| | | dn.getRDN(sz - count).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(sz - count)); |
| | | for (int i = 1; i < count; i++) { |
| | | templateValue.append("_"); |
| | | dn.getRDN(sz - count + i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(dn.getRDN(sz - count + i)); |
| | | } |
| | | } |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tools.makeldif; |
| | | |
| | |
| | | return TagResult.SUCCESS_RESULT; |
| | | } |
| | | |
| | | parentDN.getRDN(0).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(parentDN.getRDN(0)); |
| | | for (int i=1; i < parentDN.size(); i++) |
| | | { |
| | | templateValue.append("_"); |
| | | parentDN.getRDN(i).toString(templateValue.getValue()); |
| | | templateValue.getValue().append(parentDN.getRDN(i)); |
| | | } |
| | | |
| | | return TagResult.SUCCESS_RESULT; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | |
| | | if (authenticationEntry != null) |
| | | { |
| | | authenticationEntry.getName().toString(buffer); |
| | | buffer.append(authenticationEntry.getName()); |
| | | } |
| | | |
| | | if (authorizationEntry == null) |
| | |
| | | else |
| | | { |
| | | buffer.append("\",authorizationDN=\""); |
| | | authorizationEntry.getName().toString(buffer); |
| | | buffer.append(authorizationEntry.getName()); |
| | | buffer.append("\""); |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | rdnComponents[0].toString(buffer); |
| | | buffer.append(rdnComponents[0]); |
| | | |
| | | for (int i=1; i < numComponents; i++) |
| | | { |
| | | buffer.append(","); |
| | | rdnComponents[i].toString(buffer); |
| | | buffer.append(rdnComponents[i]); |
| | | } |
| | | |
| | | dnString = buffer.toString(); |
| | |
| | | return dnString; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Appends a string representation of this DN to the provided |
| | | * buffer. |
| | | * |
| | | * @param buffer The buffer to which the information should be |
| | | * appended. |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append(this); |
| | | } |
| | | |
| | | /** |
| | | * Retrieves a normalized string representation of this DN. |
| | | * <p> |
| | |
| | | public void toSingleLineString(StringBuilder buffer) |
| | | { |
| | | buffer.append("Entry(dn=\""); |
| | | dn.toString(buffer); |
| | | buffer.append(dn); |
| | | buffer.append("\",objectClasses={"); |
| | | |
| | | Iterator<String> iterator = objectClasses.values().iterator(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Appends a string representation of this RDN to the provided |
| | | * buffer. |
| | | * |
| | | * @param buffer The buffer to which the string representation |
| | | * should be appended. |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append(this); |
| | | } |
| | | |
| | | /** |
| | | * Retrieves a normalized string representation of this RDN. |
| | | * <p> |
| | | * |
| | |
| | | (ModifyDNChangeRecordEntry) changeRecord; |
| | | |
| | | StringBuilder newRDNLine = new StringBuilder("newrdn: "); |
| | | modifyDNRecord.getNewRDN().toString(newRDNLine); |
| | | newRDNLine.append(modifyDNRecord.getNewRDN()); |
| | | writeLDIFLine(newRDNLine, writer, wrapLines, wrapColumn); |
| | | |
| | | StringBuilder deleteOldRDNLine = new StringBuilder("deleteoldrdn: "); |
| | |
| | | if (newSuperiorDN != null) |
| | | { |
| | | StringBuilder newSuperiorLine = new StringBuilder("newsuperior: "); |
| | | newSuperiorDN.toString(newSuperiorLine); |
| | | newSuperiorLine.append(newSuperiorDN); |
| | | writeLDIFLine(newSuperiorLine, writer, wrapLines, wrapColumn); |
| | | } |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | |
| | | if (newSuperiorDN != null) |
| | | { |
| | | buffer.append(", newSuperior=\""); |
| | | newSuperiorDN.toString(buffer); |
| | | buffer.append(newSuperiorDN); |
| | | buffer.append("\""); |
| | | } |
| | | |