Class UserProfile
java.lang.Object
org.forgerock.openig.tools.userprofile.UserProfile
Class containing user profile information.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the raw JSON representation as aJsonValue
.Get the common name (cn) ornull
if none.Get the user's distinguished name (dn) ornull
if none.getRealm()
Get the user's realm ornull
if none.Get the user's username.rawInfo()
Returns the unmodifiableMap
of the user profile info, notnull
.static String
Utility method to unwrap a profile attribute that is wrapped in a JSON array.
-
Constructor Details
-
UserProfile
Constructor taking the rawJsonValue
. Note that this does not raise an error if the profile is empty.- Parameters:
rawInfo
- raw user profile data
-
-
Method Details
-
unwrap
Utility method to unwrap a profile attribute that is wrapped in a JSON array. Example:{ "cn": [ "foo" ] } ==> foo
- Parameters:
config
- The JsonValue node holding the datakey
- The attribute that holds the multivalued data as an array- Returns:
- The first value of that the multivalued data, or null if none.
-
getUsername
Get the user's username.- Returns:
- the username
-
getRealm
Get the user's realm ornull
if none.- Returns:
- the realm or
null
if none.
-
getDistinguishedName
Get the user's distinguished name (dn) ornull
if none.- Returns:
- the distinguished name (dn) or
null
if none.
-
getCommonName
Get the common name (cn) ornull
if none.- Returns:
- the common name (cn) or
null
if none.
-
rawInfo
Returns the unmodifiableMap
of the user profile info, notnull
.- Returns:
- the unmodifiable
Map
of the user profile info, notnull
.
-
asRawJson
Get the raw JSON representation as aJsonValue
. This is not null and will contain the Access Management user profile object structure. It could hypothetically be empty and values may be null, depending on the fields requested.- Returns:
- the JSON representation.
-