Package com.sun.identity.idm
Class AMIdentityRepository
- java.lang.Object
-
- com.sun.identity.idm.AMIdentityRepository
-
- All Implemented Interfaces:
IdentityStore
@Supported public class AMIdentityRepository extends Object implements IdentityStore
The classAMIdentityRepository
represents an object to access the repositories in which user/role/group and other identity data is configured. This class provides access to methods which will search, create and delete identities. An instance of this class can be obtained in the following manner:AMIdentityRepository idRepo = new AMIdentityRepository(ssoToken, realmName);
-
-
Constructor Summary
Constructors Constructor Description AMIdentityRepository(SSOToken ssoToken, String realmName)
Deprecated.Use the other constructorAMIdentityRepository(String, SSOToken)
AMIdentityRepository(String realmName, SSOToken ssoToken)
Instantiates a newAMIdentityRepository
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addEventListener(IdEventListener listener)
Add anIdEventListener
to the pool of listeners.static void
clearCache()
Clear caches related to Identity repositories.Set<AMIdentity>
createIdentities(IdType type, Map<String,Map<?,?>> identityNamesAndAttrs)
Create a set ofAMIdentity
s.AMIdentity
createIdentity(IdType type, String idName, Map attrMap)
Create anAMIdentity
object.void
deleteIdentities(IdType type, Set identities)
Delete a set of identities byIdType
.void
deleteIdentities(Set<AMIdentity> identities)
Delete a set ofAMIdentity
s.Set
getAllowedIdOperations(IdType type)
Get allowed identity operations.AMIdentity
getRealmIdentity()
Get the realmAMIdentity
object.Set
getSupportedIdTypes()
Get supported identity types.void
removeEventListener(int identifier)
Remove anIdEventListener
from the pool of listeners.IdSearchResults
searchIdentities(IdType type, String pattern, IdSearchControl ctrl)
Search for identities of certain types from each plugin and returns a combined result.
-
-
-
Constructor Detail
-
AMIdentityRepository
@Supported @Deprecated public AMIdentityRepository(SSOToken ssoToken, String realmName) throws IdRepoException, SSOException
Deprecated.Use the other constructorAMIdentityRepository(String, SSOToken)
Instantiates a newAMIdentityRepository
.- Parameters:
ssoToken
- the sso tokenrealmName
- the realm name- Throws:
IdRepoException
SSOException
-
AMIdentityRepository
@Supported @Inject public AMIdentityRepository(@Nullable String realmName, SSOToken ssoToken)
Instantiates a newAMIdentityRepository
.- Parameters:
realmName
- the realm namessoToken
- the sso token
-
-
Method Detail
-
clearCache
@Supported public static void clearCache()
Clear caches related to Identity repositories.
-
getSupportedIdTypes
@Supported public Set getSupportedIdTypes() throws IdRepoException, SSOException
Get supported identity types.- Specified by:
getSupportedIdTypes
in interfaceIdentityStore
- Returns:
- the supported identity types
- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
getAllowedIdOperations
@Supported public Set getAllowedIdOperations(IdType type) throws IdRepoException, SSOException
Get allowed identity operations.- Specified by:
getAllowedIdOperations
in interfaceIdentityStore
- Parameters:
type
- type of identity being searched for- Returns:
- the allowed identity operations
- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
searchIdentities
@Supported public IdSearchResults searchIdentities(IdType type, String pattern, IdSearchControl ctrl) throws IdRepoException, SSOException
Search for identities of certain types from each plugin and returns a combined result. Note: The AMIdentity objects representing IdType.REALM can be used for services related operations only. The realmAMIdentity
object can be used to assign and unassign services containing dynamic attributes to this realm.- Specified by:
searchIdentities
in interfaceIdentityStore
- Parameters:
type
- type of identity being searched forpattern
- the query identity patternctrl
- IdSearchControl which can be used to set up various search controls on the search to be performed- Returns:
- Returns the combined results in an object IdSearchResults
- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if user's single sign on token is invalid- See Also:
IdSearchControl
,IdSearchResults
-
getRealmIdentity
@Supported public AMIdentity getRealmIdentity() throws IdRepoException, SSOException
Get the realmAMIdentity
object.- Specified by:
getRealmIdentity
in interfaceIdentityStore
- Returns:
- the realm identity
- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
createIdentity
@Supported public AMIdentity createIdentity(IdType type, String idName, Map attrMap) throws IdRepoException, SSOException
Create anAMIdentity
object.- Specified by:
createIdentity
in interfaceIdentityStore
- Parameters:
type
- type of identity being searched foridName
- the id nameattrMap
- the attr map- Returns:
- the am identity
- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
createIdentities
@Supported public Set<AMIdentity> createIdentities(IdType type, Map<String,Map<?,?>> identityNamesAndAttrs) throws IdRepoException, SSOException
Create a set ofAMIdentity
s.- Parameters:
type
- type of identity being searched foridentityNamesAndAttrs
- the identity names and attrs- Returns:
- the
AMIdentity
set - Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
deleteIdentities
@Supported public void deleteIdentities(IdType type, Set identities) throws IdRepoException, SSOException
Delete a set of identities byIdType
.- Parameters:
type
- type of identity being searched foridentities
- the identities- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
deleteIdentities
@Supported public void deleteIdentities(Set<AMIdentity> identities) throws IdRepoException, SSOException
Delete a set ofAMIdentity
s.- Parameters:
identities
- the identities- Throws:
IdRepoException
- if there are repository related error conditionsSSOException
- if there is an SSO token related error
-
addEventListener
@Supported public int addEventListener(IdEventListener listener)
Add anIdEventListener
to the pool of listeners.- Specified by:
addEventListener
in interfaceIdentityStore
- Parameters:
listener
- the identity event listener to add- Returns:
- the total amount of
IdEventListener
s available
-
removeEventListener
@Supported public void removeEventListener(int identifier)
Remove anIdEventListener
from the pool of listeners.- Specified by:
removeEventListener
in interfaceIdentityStore
- Parameters:
identifier
- the identifier for theIdEventListener
to be removed
-
-