Interface LegacyIdentityService
-
public interface LegacyIdentityService
This is a collection of identity related methods which either should not exist, or belong elsewhere. The intent is to break this apart over time, until it can be removed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
doesIdentityExist(String universalId)
Checks whether a given non-null universal ID exists.Set<AMIdentity>
findActiveIdentities(Realm realm, IdType idType, Map<String,Set<String>> searchAttributes, IdSearchOpModifier searchModifier)
Searches for AM identities with the given attributes in the given realm.Optional<AMIdentity>
findActiveIdentity(Realm realm, IdType idType, Map<String,Set<String>> searchAttributes)
Searches for an AM identity with the given attributes in the given realm.AMIdentity
getAmIdentity(SSOToken token, String identityName, IdType idType, String realm)
Create anAMIdentity
using the specified information.String
getIdentityName(String universalId)
Determines the name of the identity based on the provided universal ID.String
getIdentityUniversalId(String subject, String realmPath)
Convert an identity subject to anAMIdentity
universal id.String
getUniversalId(String identityName, IdType idType, String realm)
Determines the universal ID of the user based on the provided details.Optional<String>
getUniversalId(String username, String realmPath, IdType idType)
Determines the universal ID of the user based on the username and the realm.
-
-
-
Method Detail
-
getIdentityName
String getIdentityName(String universalId)
Determines the name of the identity based on the provided universal ID.- Parameters:
universalId
- the universal ID of the identity- Returns:
- the name of the identity, or null if the name could not be determined
-
doesIdentityExist
boolean doesIdentityExist(String universalId) throws IdentityException
Checks whether a given non-null universal ID exists.- Parameters:
universalId
- non-null universal ID- Returns:
- whether the universal ID exists
- Throws:
IdentityException
- if there's an error reading from the identity repository
-
getAmIdentity
AMIdentity getAmIdentity(SSOToken token, String identityName, IdType idType, String realm) throws IdRepoException
Create anAMIdentity
using the specified information.- Parameters:
token
- the identity's SSO TokenidentityName
- the name of the identityidType
- the type of the identityrealm
- the realm this identity belongs to- Returns:
- the
AMIdentity
based on the provided parameters - Throws:
IdRepoException
-
getUniversalId
String getUniversalId(String identityName, IdType idType, String realm) throws IdRepoException
Determines the universal ID of the user based on the provided details.- Parameters:
identityName
- the name of the identityidType
- the type of the identityrealm
- the realm this identity belongs to- Returns:
- the universal ID based on the provided parameters
- Throws:
IdRepoException
-
getUniversalId
Optional<String> getUniversalId(String username, String realmPath, IdType idType)
Determines the universal ID of the user based on the username and the realm.- Parameters:
username
- the username attribute of the identity objectrealmPath
- the realm path of the realm the identity belongs toidType
- the type of the identity object- Returns:
- the universal ID of the identity object in the realm
-
findActiveIdentity
Optional<AMIdentity> findActiveIdentity(Realm realm, IdType idType, Map<String,Set<String>> searchAttributes) throws SSOException, IdRepoException
Searches for an AM identity with the given attributes in the given realm. Identity searches will be cached to improve performance.- Parameters:
realm
- the realm in which to search for identities. Cannot be nullidType
- the type of identity to find. Cannot be nullsearchAttributes
- the search attributes. Cannot be null or empty- Returns:
- the matching identity or else
Optional.empty()
if there is no unique match - Throws:
SSOException
- if there is a problem with the SSOToken used for the searchIdRepoException
- if an error occurs during the search
-
findActiveIdentities
Set<AMIdentity> findActiveIdentities(Realm realm, IdType idType, Map<String,Set<String>> searchAttributes, IdSearchOpModifier searchModifier) throws SSOException, IdRepoException
Searches for AM identities with the given attributes in the given realm. Identity searches will be cached to improve performance.- Parameters:
realm
- the realm in which to search for identities. Cannot be nullidType
- the type of identity to find. Cannot be nullsearchAttributes
- the search attributes. Cannot be null or emptysearchModifier
- the modifier to use to perform the search- Returns:
- the potentially empty set of matching identities
- Throws:
SSOException
- if there is a problem with the SSOToken used for the searchIdRepoException
- if an error occurs during the search
-
getIdentityUniversalId
String getIdentityUniversalId(String subject, String realmPath) throws IdRepoException
Convert an identity subject to anAMIdentity
universal id.- Parameters:
subject
- the identity subjectrealmPath
- the realm path- Returns:
- the AM identity
- Throws:
IdRepoException
-
-