Class UserProfile

java.lang.Object
org.forgerock.openig.tools.userprofile.UserProfile

public class UserProfile extends Object
Class containing user profile information.
  • Constructor Details

    • UserProfile

      public UserProfile(JsonValue rawInfo)
      Constructor taking the raw JsonValue. Note that this does not raise an error if the profile is empty.
      Parameters:
      rawInfo - raw user profile data
  • Method Details

    • unwrap

      public static String unwrap(JsonValue config, String key)
      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 data
      key - The attribute that holds the multivalued data as an array
      Returns:
      The first value of that the multivalued data, or null if none.
    • getUsername

      public String getUsername()
      Get the user's username.
      Returns:
      the username
    • getRealm

      public String getRealm()
      Get the user's realm or null if none.
      Returns:
      the realm or null if none.
    • getDistinguishedName

      public String getDistinguishedName()
      Get the user's distinguished name (dn) or null if none.
      Returns:
      the distinguished name (dn) or null if none.
    • getCommonName

      public String getCommonName()
      Get the common name (cn) or null if none.
      Returns:
      the common name (cn) or null if none.
    • rawInfo

      public Map<String,Object> rawInfo()
      Returns the unmodifiable Map of the user profile info, not null.
      Returns:
      the unmodifiable Map of the user profile info, not null.
    • asRawJson

      public JsonValue asRawJson()
      Get the raw JSON representation as a JsonValue. 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.