Package org.forgerock.am.identity.domain
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 Summary
Constructors Modifier Constructor Description protectedUniversalId(UniversalId other)Construct a new instance based on an existing universal id
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)StringgetName()Returns the name of the identity.DngetRealmDn()Returns the realm for this identity.IdTypegetType()Returns the type of the identity.StringgetUniversalId()Returns the universal identifier for this identity.inthashCode()static booleanisUniversalIdOrSpecialUserDn(Dn dn)Check if dn is a universalId or a special user dn.static UniversalIdof(SSOToken token)Creates a newUniversalIdinstance based of the passed token.static UniversalIdof(String name, IdType type, Realm realm)Creates a newUniversalIdinstance based of the passed individual parts that represent a unique identity.static UniversalIdof(String name, IdType type, Dn realmDn)Creates a newUniversalIdinstance based of the passed individual parts that represent a unique identity.static UniversalIdof(Dn universalId)Creates a newUniversalIdinstance based of the passed universal ID.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
getName
public String getName()
Returns the name of the identity.- Returns:
- name of the identity
-
getType
public IdType getType()
Returns the type of the identity.- Returns:
IdTyperepresenting 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
-
of
public static UniversalId of(SSOToken token) throws SSOException, IdRepoException
Creates a newUniversalIdinstance based of the passed token.- Parameters:
token- non-null token from which to create an identity instance- Returns:
- a
UniversalIdinstance - Throws:
SSOException- should an error occur handling the tokenIdRepoException- 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 newUniversalIdinstance based of the passed universal ID.- Parameters:
universalId- the universal ID of the identity- Returns:
- a
UniversalIdinstance - 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 newUniversalIdinstance based of the passed individual parts that represent a unique identity.- Parameters:
name- the identity nametype- the identity typerealm- the realm in which the identity resides- Returns:
- a
UniversalIdinstance - Throws:
IllegalArgumentException- if it is not possible to parse the passed realmIdRepoException- 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 newUniversalIdinstance based of the passed individual parts that represent a unique identity.- Parameters:
name- the identity nametype- the identity typerealmDn- the realm in which the identity resides- Returns:
- an
UniversalIdinstance - Throws:
IllegalArgumentException- if it is not possible to parse the passed realmIdRepoException- 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
-
-