public class LDAPUtil extends Object
Utility class for working with LDAP.
| Constructor and Description |
|---|
LDAPUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertGUIDToEdirectoryHexString(String guid)
see http://support.novell.com/docs/Tids/Solutions/10096551.html
|
static String |
convertObjectGUIDToByteString(byte[] objectGUID)
Creates a byte-based
String representation of a raw byte array representing the value of the
objectGUID attribute retrieved from Active Directory. |
static String |
decodeGuid(byte[] guid)
Decode a raw byte array representing the value of the
guid attribute retrieved from Novell
eDirectory. |
static String |
decodeObjectGUID(byte[] objectGUID)
Decode a raw byte array representing the value of the
objectGUID attribute retrieved from Active
Directory. |
static String |
formatDate(Date date)
Formats the given date.
|
static Date |
parseDate(String date)
Parses dates/time stamps stored in LDAP.
|
public static final String formatDate(Date date)
Formats the given date.
date - The Date to format.public static final Date parseDate(String date)
Parses dates/time stamps stored in LDAP. Some possible values:
date - The date string to parse from.public static String convertObjectGUIDToByteString(byte[] objectGUID)
Creates a byte-based String representation of a raw byte array representing the value of the
objectGUID attribute retrieved from Active Directory.
The returned string is useful to perform queries on AD based on the objectGUID value. Eg.:
String filter = "(&(objectClass=*)(objectGUID" + EQUAL + convertObjectGUIDToByteString(objectGUID) + "))";
objectGUID - A raw byte array representing the value of the objectGUID attribute retrieved from
Active Directory.public static String convertGUIDToEdirectoryHexString(String guid)
guid - A GUID in the form of a dashed String as the result of (@see LDAPUtil#convertToDashedString)public static String decodeObjectGUID(byte[] objectGUID)
Decode a raw byte array representing the value of the objectGUID attribute retrieved from Active
Directory.
The returned string is useful to directly bind an entry. Eg.:
String bindingString = decodeObjectGUID(objectGUID);
Attributes attributes = ctx.getAttributes(bindingString);
objectGUID - A raw byte array representing the value of the objectGUID attribute retrieved from
Active Directory.public static String decodeGuid(byte[] guid)
Decode a raw byte array representing the value of the guid attribute retrieved from Novell
eDirectory.
guid - A raw byte array representing the value of the guid attribute retrieved from
Novell eDirectory.Copyright © 2021 JBoss by Red Hat. All rights reserved.