Package com.sun.identity.idm
Class AMIdentityRepository
java.lang.Object
com.sun.identity.idm.AMIdentityRepository
- All Implemented Interfaces:
IdentityStore
The class
AMIdentityRepository
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
ConstructorDescriptionAMIdentityRepository
(SSOToken ssoToken, String realmName) Deprecated.AMIdentityRepository
(String realmName, SSOToken ssoToken) Instantiates a newAMIdentityRepository
. -
Method Summary
Modifier and TypeMethodDescriptionint
addEventListener
(IdEventListener listener) Add anIdEventListener
to the pool of listeners.static void
Clear caches related to Identity repositories.createIdentities
(IdType type, Map<String, Map<?, ?>> identityNamesAndAttrs) Create a set ofAMIdentity
s.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.getAllowedIdOperations
(IdType type) Get allowed identity operations.Get the realmAMIdentity
object.Get supported identity types.void
removeEventListener
(int identifier) Remove anIdEventListener
from the pool of listeners.searchIdentities
(IdType type, String pattern, IdSearchControl ctrl) Search for identities of certain types from each plugin and returns a combined result.
-
Constructor Details
-
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
Instantiates a newAMIdentityRepository
.- Parameters:
realmName
- the realm namessoToken
- the sso token
-
-
Method Details
-
clearCache
Clear caches related to Identity repositories. -
getSupportedIdTypes
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
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:
-
getRealmIdentity
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<?, throws IdRepoException, SSOException?>> identityNamesAndAttrs) 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
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
Remove anIdEventListener
from the pool of listeners.- Specified by:
removeEventListener
in interfaceIdentityStore
- Parameters:
identifier
- the identifier for theIdEventListener
to be removed
-
AMIdentityRepository(String, SSOToken)