/** * Returns the RDN after escaping the characters requiring escaping. * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#escapeRDN(java.lang.String)"> com.novell.ldap.LDAPDN.escapeRDN(String)</a> */ public static String escapeRDN (String rdn) { return com.novell.ldap.LDAPDN.escapeRDN(rdn); }
/** * Returns true if the string conforms to distinguished name syntax. * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#isValid(java.lang.String)"> com.novell.ldap.LDAPDN.isValid(String)</a> */ public static boolean isValid(String dn){ return com.novell.ldap.LDAPDN.isValid(dn); }
/** * Compares the two strings per the distinguishedNameMatch equality matching * (using case-ignore matching). * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#equals(java.lang.String, java.lang.String)"> com.novell.ldap.LDAPDN.equals(String, String)</a> */ public static boolean equals (String dn1, String dn2) { return com.novell.ldap.LDAPDN.equals(dn1, dn2); }
/** * Returns the DN normalized by removal of non-significant space characters. * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#normalize(java.lang.String)"> com.novell.ldap.LDAPDN.normalize(String)</a> */ public static String normalize(String dn){ return com.novell.ldap.LDAPDN.normalize(dn); }
/** * Returns the individual components of a distinguished name (DN). * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#explodeDN(java.lang.String, boolean)"> com.novell.ldap.LDAPDN.explodeDN(String, boolean)</a> */ public static String[] explodeDN(String dn, boolean noTypes) { return com.novell.ldap.LDAPDN.explodeDN(dn,noTypes); }
/** * Returns the individual components of a relative distinguished name * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#explodeRDN(java.lang.String, boolean)"> com.novell.ldap.LDAPDN.explodeRDN(String, boolean)</a> */ public static String[] explodeRDN(String rdn, boolean noTypes) { return com.novell.ldap.LDAPDN.explodeRDN(rdn,noTypes); }
/** * Returns the RDN after unescaping the characters requiring escaping. * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#unescapeRDN(java.lang.String)"> com.novell.ldap.LDAPDN.unescapeRDN(String)</a> */ public static String unescapeRDN (String rdn) { return com.novell.ldap.LDAPDN.unescapeRDN(rdn); } }
/** * Compares this object with the specified object for order. * * <p>Ordering is determined by comparing normalized DN values * (see {@link LDAPEntry#getDN() } and * {@link LDAPDN#normalize(java.lang.String)}) using the * compareTo method of the String class. </p> * * @param entry Entry to compare to * * @return A negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. */ public int compareTo(Object entry){ return LDAPDN.normalize( this.dn ).compareTo( LDAPDN.normalize( ((LDAPEntry)entry).dn ) ); }
/** * Fully escape DN value (the part after the =). * <p> * For example, for the dn value "Acme, Inc", the escapeLDAPDNValue method returns "Acme\, Inc". * </p> * * @param value the DN value to escape * @return the escaped version o the DN value */ public static String escapeLDAPDNValue(String value) { return LDAPDN.escapeRDN("key=" + value).substring(4); }
if (LDAPDN.isValid(userOrGroup)) { LOGGER.debug("[{}] is a valid DN, lets try to get corresponding entry.", userOrGroup);
/** * Fully escape DN value (the part after the =). * <p> * For example, for the dn value "Acme, Inc", the escapeLDAPDNValue method returns "Acme\, Inc". * </p> * * @param value the DN value to escape * @return the escaped version o the DN value */ public static String escapeLDAPDNValue(String value) { return StringUtils.isBlank(value) ? value : LDAPDN.escapeRDN("key=" + value).substring(4); }
/** * Creates and returns a string that represents this DN. The string * follows RFC 2253, which describes String representation of DN's and * RDN's * * @return A DN string. */ public String toString() { int length=rdnList.size(); String dn = ""; if (length < 1) return null; dn = LDAPDN.escapeRDN(rdnList.get(0).toString()); for (int i=1; i<length; i++) dn += "," + LDAPDN.escapeRDN(rdnList.get(i).toString()); return dn; }