/** * Generates a hash code for this DN. * * @return The generated hash code for this DN. */ @Override() public int hashCode() { return toNormalizedString().hashCode(); }
/** * Generates a hash code for this DN. * * @return The generated hash code for this DN. */ @Override() public int hashCode() { return toNormalizedString().hashCode(); }
/** * Retrieves a normalized string representation of this DN. * * @return A normalized string representation of this DN. */ public String toNormalizedString() { if (normalizedString == null) { final StringBuilder buffer = new StringBuilder(); toNormalizedString(buffer); normalizedString = buffer.toString(); } return normalizedString; }
/** * Indicates whether the provided object is equal to this DN. In order for * the provided object to be considered equal, it must be a non-null DN with * the same set of RDN components. * * @param o The object for which to make the determination. * * @return {@code true} if the provided object is considered equal to this * DN, or {@code false} if not. */ @Override() public boolean equals(final Object o) { if (o == null) { return false; } if (this == o) { return true; } if (! (o instanceof DN)) { return false; } final DN dn = (DN) o; return (toNormalizedString().equals(dn.toNormalizedString())); }
/** * Retrieves a normalized string representation of this DN. * * @return A normalized string representation of this DN. */ public String toNormalizedString() { if (normalizedString == null) { final StringBuilder buffer = new StringBuilder(); toNormalizedString(buffer); normalizedString = buffer.toString(); } return normalizedString; }
/** * Indicates whether the provided object is equal to this DN. In order for * the provided object to be considered equal, it must be a non-null DN with * the same set of RDN components. * * @param o The object for which to make the determination. * * @return {@code true} if the provided object is considered equal to this * DN, or {@code false} if not. */ @Override() public boolean equals(final Object o) { if (o == null) { return false; } if (this == o) { return true; } if (! (o instanceof DN)) { return false; } final DN dn = (DN) o; return (toNormalizedString().equals(dn.toNormalizedString())); }
/** * Returns the authzId string representation of the specified * distinguished name (DN). * * @param dn The distinguished name (DN). Must not be {@code null}. * * @return The authzId string. */ private static String toAuthzIdString(final DN dn) { if (dn == null) throw new IllegalArgumentException("The authzId DN must not be null"); if (dn.equals(DN.NULL_DN)) return "dn:"; else return "dn:" + dn.toNormalizedString(); }
/** * Retrieves a normalized representation of the DN with the provided string * representation. * * @param s The string representation of the DN to normalize. It must * not be {@code null}. * @param schema The schema to use to generate the normalized string * representation of the DN. It may be {@code null} if no * schema is available. * * @return The normalized representation of the DN with the provided string * representation. * * @throws LDAPException If the provided string cannot be parsed as a DN. */ public static String normalize(final String s, final Schema schema) throws LDAPException { return new DN(s, schema).toNormalizedString(); }
/** * Retrieves a normalized representation of the DN with the provided string * representation. * * @param s The string representation of the DN to normalize. It must * not be {@code null}. * @param schema The schema to use to generate the normalized string * representation of the DN. It may be {@code null} if no * schema is available. * * @return The normalized representation of the DN with the provided string * representation. * * @throws LDAPException If the provided string cannot be parsed as a DN. */ public static String normalize(final String s, final Schema schema) throws LDAPException { return new DN(s, schema).toNormalizedString(); }
percentEncode(baseDN.toNormalizedString(), buffer); buffer.append('?');
percentEncode(baseDN.toNormalizedString(), buffer); buffer.append('?');
a.hasValue(dn.toNormalizedString(), DistinguishedNameMatchingRule.getInstance())) for (final String attrName : referentialIntegrityAttributes) copy.removeAttributeValue(attrName, dn.toNormalizedString(), DistinguishedNameMatchingRule.getInstance());
a.hasValue(oldDN.toNormalizedString(), DistinguishedNameMatchingRule.getInstance())) for (final String attrName : referentialIntegrityAttributes) if (copy.removeAttributeValue(attrName, oldDN.toNormalizedString(), DistinguishedNameMatchingRule.getInstance()))
for (final Map.Entry<DN,String> e : generationIDs.entrySet()) idStrings.add(e.getKey().toNormalizedString() + ' ' + e.getValue());
/** * {@inheritDoc} */ @Override() public ASN1OctetString normalize(final ASN1OctetString value) throws LDAPException { try { final DN dn = new DN(value.stringValue()); return new ASN1OctetString(dn.toNormalizedString()); } catch (LDAPException le) { debugException(le); throw new LDAPException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, le.getMessage(), le); } }
/** * {@inheritDoc} */ @Override() public ASN1OctetString normalize(final ASN1OctetString value) throws LDAPException { try { final DN dn = new DN(value.stringValue()); return new ASN1OctetString(dn.toNormalizedString()); } catch (LDAPException le) { debugException(le); throw new LDAPException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, le.getMessage(), le); } }
entry.addAttribute(new Attribute("entryDN", DistinguishedNameMatchingRule.getInstance(), dn.toNormalizedString())); entry.addAttribute(new Attribute("entryUUID", UUID.randomUUID().toString()));
updatedEntry.setAttribute(new Attribute("entryDN", DistinguishedNameMatchingRule.getInstance(), newDN.toNormalizedString())); newMapEntryDN.toNormalizedString()));