/** * Appends a string representation of this RDN to the provided buffer. * * @param buffer The buffer to which the string representation is to be * appended. */ public void toString(final StringBuilder buffer) { toString(buffer, false); }
/** * Appends a string representation of this RDN to the provided buffer. * * @param buffer The buffer to which the string representation is to be * appended. */ public void toString(final StringBuilder buffer) { toString(buffer, false); }
/** * Retrieves the set of string representations of the RDNs that comprise this * DN. * * @return The set of string representations of the RDNs that comprise this * DN. */ public String[] getRDNStrings() { final String[] rdnStrings = new String[rdns.length]; for (int i=0; i < rdns.length; i++) { rdnStrings[i] = rdns[i].toString(); } return rdnStrings; }
/** * Retrieves the string representation of the leftmost (i.e., furthest from * the naming context) RDN component for this DN. * * @return The string representation of the leftmost RDN component for this * DN, or {@code null} if this DN does not have any RDNs (i.e., it is * the null DN). */ public String getRDNString() { if (rdns.length == 0) { return null; } else { return rdns[0].toString(); } }
/** * Retrieves the set of string representations of the RDNs that comprise this * DN. * * @return The set of string representations of the RDNs that comprise this * DN. */ public String[] getRDNStrings() { final String[] rdnStrings = new String[rdns.length]; for (int i=0; i < rdns.length; i++) { rdnStrings[i] = rdns[i].toString(); } return rdnStrings; }
/** * Retrieves the string representation of the leftmost (i.e., furthest from * the naming context) RDN component for this DN. * * @return The string representation of the leftmost RDN component for this * DN, or {@code null} if this DN does not have any RDNs (i.e., it is * the null DN). */ public String getRDNString() { if (rdns.length == 0) { return null; } else { return rdns[0].toString(); } }
/** * Retrieves a string representation of this RDN with minimal encoding for * special characters. Only those characters specified in RFC 4514 section * 2.4 will be escaped. No escaping will be used for non-ASCII characters or * non-printable ASCII characters. * * @return A string representation of this RDN with minimal encoding for * special characters. */ public String toMinimallyEncodedString() { final StringBuilder buffer = new StringBuilder(); toString(buffer, true); return buffer.toString(); }
/** * Retrieves a string representation of this RDN. * * @return A string representation of this RDN. */ @Override() public String toString() { if (rdnString == null) { final StringBuilder buffer = new StringBuilder(); toString(buffer, false); rdnString = buffer.toString(); } return rdnString; }
/** * Retrieves a string representation of this RDN with minimal encoding for * special characters. Only those characters specified in RFC 4514 section * 2.4 will be escaped. No escaping will be used for non-ASCII characters or * non-printable ASCII characters. * * @return A string representation of this RDN with minimal encoding for * special characters. */ public String toMinimallyEncodedString() { final StringBuilder buffer = new StringBuilder(); toString(buffer, true); return buffer.toString(); }
/** * Retrieves a string representation of this RDN. * * @return A string representation of this RDN. */ @Override() public String toString() { if (rdnString == null) { final StringBuilder buffer = new StringBuilder(); toString(buffer, false); rdnString = buffer.toString(); } return rdnString; }
/** * Appends a string representation of this DN to the provided buffer. * * @param buffer The buffer to which the string representation is * to be appended. * @param minimizeEncoding Indicates whether to restrict the encoding of * special characters to the bare minimum required * by LDAP (as per RFC 4514 section 2.4). If this * is {@code true}, then only leading and trailing * spaces, double quotes, plus signs, commas, * semicolons, greater-than, less-than, and * backslash characters will be encoded. */ public void toString(final StringBuilder buffer, final boolean minimizeEncoding) { for (int i=0; i < rdns.length; i++) { if (i > 0) { buffer.append(','); } rdns[i].toString(buffer, minimizeEncoding); } }
/** * Appends a string representation of this DN to the provided buffer. * * @param buffer The buffer to which the string representation is * to be appended. * @param minimizeEncoding Indicates whether to restrict the encoding of * special characters to the bare minimum required * by LDAP (as per RFC 4514 section 2.4). If this * is {@code true}, then only leading and trailing * spaces, double quotes, plus signs, commas, * semicolons, greater-than, less-than, and * backslash characters will be encoded. */ public void toString(final StringBuilder buffer, final boolean minimizeEncoding) { for (int i=0; i < rdns.length; i++) { if (i > 0) { buffer.append(','); } rdns[i].toString(buffer, minimizeEncoding); } }
/** * Specifies the new RDN for the entry. * * @param newRDN The new RDN for the entry. It must not be {@code null}. */ public void setNewRDN(final RDN newRDN) { ensureNotNull(newRDN); this.newRDN = newRDN.toString(); }
/** * Specifies the new RDN for the entry. * * @param newRDN The new RDN for the entry. It must not be {@code null}. */ public void setNewRDN(final RDN newRDN) { ensureNotNull(newRDN); this.newRDN = newRDN.toString(); }
/** * Creates a new DN below the provided parent DN with the given RDN. * * @param rdn The RDN for the new DN. It must not be {@code null}. * @param parentDN The parent DN for the new DN to create. It must not be * {@code null}. */ public DN(final RDN rdn, final DN parentDN) { ensureNotNull(rdn, parentDN); rdns = new RDN[parentDN.rdns.length + 1]; rdns[0] = rdn; System.arraycopy(parentDN.rdns, 0, rdns, 1, parentDN.rdns.length); Schema s = null; final StringBuilder buffer = new StringBuilder(); for (final RDN r : rdns) { if (buffer.length() > 0) { buffer.append(','); } r.toString(buffer, false); if (s == null) { s = r.getSchema(); } } dnString = buffer.toString(); schema = s; }
/** * Creates a new modify DN request that will rename the entry but will not * move it below a new entry. * * @param dn The current DN for the entry to rename. It must not * be {@code null}. * @param newRDN The new RDN for the target entry. It must not be * {@code null}. * @param deleteOldRDN Indicates whether to delete the current RDN value * from the target entry. * @param controls The set of controls to include in the request. */ public ModifyDNRequest(final DN dn, final RDN newRDN, final boolean deleteOldRDN, final Control[] controls) { super(controls); ensureNotNull(dn, newRDN); this.dn = dn.toString(); this.newRDN = newRDN.toString(); this.deleteOldRDN = deleteOldRDN; newSuperiorDN = null; }
/** * Creates a new modify DN request that will rename the entry but will not * move it below a new entry. * * @param dn The current DN for the entry to rename. It must not * be {@code null}. * @param newRDN The new RDN for the target entry. It must not be * {@code null}. * @param deleteOldRDN Indicates whether to delete the current RDN value * from the target entry. */ public ModifyDNRequest(final DN dn, final RDN newRDN, final boolean deleteOldRDN) { super(null); ensureNotNull(dn, newRDN); this.dn = dn.toString(); this.newRDN = newRDN.toString(); this.deleteOldRDN = deleteOldRDN; newSuperiorDN = null; }
/** * Creates a new modify DN request that will rename the entry but will not * move it below a new entry. * * @param dn The current DN for the entry to rename. It must not * be {@code null}. * @param newRDN The new RDN for the target entry. It must not be * {@code null}. * @param deleteOldRDN Indicates whether to delete the current RDN value * from the target entry. */ public ModifyDNRequest(final DN dn, final RDN newRDN, final boolean deleteOldRDN) { super(null); ensureNotNull(dn, newRDN); this.dn = dn.toString(); this.newRDN = newRDN.toString(); this.deleteOldRDN = deleteOldRDN; newSuperiorDN = null; }
/** * Creates a new modify DN request that will rename the entry but will not * move it below a new entry. * * @param dn The current DN for the entry to rename. It must not * be {@code null}. * @param newRDN The new RDN for the target entry. It must not be * {@code null}. * @param deleteOldRDN Indicates whether to delete the current RDN value * from the target entry. * @param controls The set of controls to include in the request. */ public ModifyDNRequest(final DN dn, final RDN newRDN, final boolean deleteOldRDN, final Control[] controls) { super(controls); ensureNotNull(dn, newRDN); this.dn = dn.toString(); this.newRDN = newRDN.toString(); this.deleteOldRDN = deleteOldRDN; newSuperiorDN = null; }
this.newRDN = newRDN.toString(); this.deleteOldRDN = deleteOldRDN;