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 protected
UniversalId(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 boolean
equals(Object other)
String
getName()
Returns the name of the identity.Dn
getRealmDn()
Returns the realm for this identity.IdType
getType()
Returns the type of the identity.String
getUniversalId()
Returns the universal identifier for this identity.int
hashCode()
static boolean
isUniversalIdOrSpecialUserDn(Dn dn)
Check if dn is a universalId or a special user dn.static UniversalId
of(SSOToken token)
Creates a newUniversalId
instance based of the passed token.static UniversalId
of(String name, IdType type, Realm realm)
Creates a newUniversalId
instance based of the passed individual parts that represent a unique identity.static UniversalId
of(String name, IdType type, Dn realmDn)
Creates a newUniversalId
instance based of the passed individual parts that represent a unique identity.static UniversalId
of(Dn universalId)
Creates a newUniversalId
instance based of the passed universal ID.String
toString()
-
-
-
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:
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
-
of
public static UniversalId of(SSOToken token) throws SSOException, IdRepoException
Creates a newUniversalId
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 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 newUniversalId
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 newUniversalId
instance 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
UniversalId
instance - 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 newUniversalId
instance 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
UniversalId
instance - 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
-
-