public class DirectoryAttributeRetriever extends Object
Constructor and Description |
---|
DirectoryAttributeRetriever() |
Modifier and Type | Method and Description |
---|---|
static String |
getValueFromAttributes(String directoryAttributeName,
Attributes directoryAttributes)
Retrieves the first value from the collection of attributes for the
supplied name directoryAttributeName.
|
static String |
getValueFromExternalIdAttribute(String externalIdAttribute,
Attributes directoryAttributes)
Retrieves the first value from the collection of attributes for the
supplied name externalIdAttribute.
|
static String |
toSaveableLDAPValue(String value)
Transforms attribute values in order to comply with LDAP schemas.
|
public static String getValueFromAttributes(String directoryAttributeName, Attributes directoryAttributes)
null
is returned.directoryAttributeName
- attribute name key.directoryAttributes
- collection of attributes to examine.@Nullable public static String getValueFromExternalIdAttribute(String externalIdAttribute, Attributes directoryAttributes)
Although RFC4530 (http://www.ietf.org/rfc/rfc4530.txt) says that the 'entryUUID' attribute is "encoded using the ASCII character string representation described in RFC4122, for example 597ae2f6-16a6-1027-98f4-d28b5365dc14", it is conceivable that a directory may be configured to use any other binary or text attribute (e.g., the email) as external identifier. Therefore, this method accepts both String values and byte arrays, and makes sure that the Strings are XML-safe.
externalIdAttribute
- name of external Id attributedirectoryAttributes
- collection of attributespublic static String toSaveableLDAPValue(String value)
fromSavedLDAPValue(String)
is not lossless; see notes about value
below.value
- the value to save. If null, it will be treated as the empty string.IllegalArgumentException
- if the given value can't be saved as the value of an LDAP attributeCopyright © 2021 Atlassian. All rights reserved.
View cookie preferences