Class UniversalId

java.lang.Object
org.forgerock.am.identity.domain.UniversalId
Direct Known Subclasses:
AMIdentity

public class UniversalId extends Object
Represents a reference to an identity that is managed by AM.
  • Constructor Details

    • UniversalId

      protected UniversalId(UniversalId other)
      Construct a new instance based on an existing universal id
      Parameters:
      other - The universal id to use as a base
  • Method Details

    • getName

      public String getName()
      Returns the name of the identity.
      Returns:
      name of the identity
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getType

      public IdType getType()
      Returns the type of the identity.
      Returns:
      IdType representing the type of this object
    • getRealmDn

      public Dn getRealmDn()
      Returns the realm for this identity.
      Returns:
      string representing realm name
    • getUniversalId

      public String getUniversalId()
      Returns the universal identifier for this identity.
      Returns:
      string representing the universal identifier of this identity
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • of

      public static UniversalId of(SSOToken token) throws SSOException, IdRepoException
      Creates a new UniversalId instance based of the passed token.
      Parameters:
      token - non-null token from which to create an identity instance
      Returns:
      a UniversalId instance
      Throws:
      SSOException - should an error occur handling the token
      IdRepoException - if the passed universal ID is not a valid universal ID or special user DN
    • of

      public static UniversalId of(Dn universalId) throws IdRepoException
      Creates a new UniversalId instance based of the passed universal ID.
      Parameters:
      universalId - the universal ID of the identity
      Returns:
      a UniversalId instance
      Throws:
      IdRepoException - if the passed universal ID is not a valid universal ID or special user DN
    • of

      public static UniversalId of(String name, IdType type, Realm realm) throws IdRepoException
      Creates a new UniversalId instance based of the passed individual parts that represent a unique identity.
      Parameters:
      name - the identity name
      type - the identity type
      realm - the realm in which the identity resides
      Returns:
      a UniversalId instance
      Throws:
      IllegalArgumentException - if it is not possible to parse the passed realm
      IdRepoException - if the passed universal ID is not a valid universal ID or special user DN
    • of

      public static UniversalId of(String name, IdType type, Dn realmDn) throws IdRepoException
      Creates a new UniversalId instance based of the passed individual parts that represent a unique identity.
      Parameters:
      name - the identity name
      type - the identity type
      realmDn - the realm in which the identity resides
      Returns:
      an UniversalId instance
      Throws:
      IllegalArgumentException - if it is not possible to parse the passed realm
      IdRepoException - if the passed universal ID is not a valid universal ID or special user DN
    • isUniversalIdOrSpecialUserDn

      public static boolean isUniversalIdOrSpecialUserDn(Dn dn) throws IdRepoException
      Check if dn is a universalId or a special user dn.
      Parameters:
      dn - the dn that needs to be checked.
      Returns:
      returns if the provided dn is a universal id or special user dn.
      Throws:
      IdRepoException