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 classAMIdentityRepositoryrepresents 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 intaddEventListener(IdEventListener listener)Add anIdEventListenerto the pool of listeners.static voidclearCache()Clear caches related to Identity repositories.Set<AMIdentity>createIdentities(IdType type, Map<String,Map<?,?>> identityNamesAndAttrs)Create a set ofAMIdentitys.AMIdentitycreateIdentity(IdType type, String idName, Map attrMap)Create anAMIdentityobject.voiddeleteIdentities(IdType type, Set identities)Delete a set of identities byIdType.voiddeleteIdentities(Set<AMIdentity> identities)Delete a set ofAMIdentitys.SetgetAllowedIdOperations(IdType type)Get allowed identity operations.AMIdentitygetRealmIdentity()Get the realmAMIdentityobject.SetgetSupportedIdTypes()Get supported identity types.voidremoveEventListener(int identifier)Remove anIdEventListenerfrom the pool of listeners.IdSearchResultssearchIdentities(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:
IdRepoExceptionSSOException
-
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:
getSupportedIdTypesin 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:
getAllowedIdOperationsin 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 realmAMIdentityobject can be used to assign and unassign services containing dynamic attributes to this realm.- Specified by:
searchIdentitiesin 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 realmAMIdentityobject.- Specified by:
getRealmIdentityin 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 anAMIdentityobject.- Specified by:
createIdentityin 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 ofAMIdentitys.- Parameters:
type- type of identity being searched foridentityNamesAndAttrs- the identity names and attrs- Returns:
- the
AMIdentityset - 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 ofAMIdentitys.- 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 anIdEventListenerto the pool of listeners.- Specified by:
addEventListenerin interfaceIdentityStore- Parameters:
listener- the identity event listener to add- Returns:
- the total amount of
IdEventListeners available
-
removeEventListener
@Supported public void removeEventListener(int identifier)
Remove anIdEventListenerfrom the pool of listeners.- Specified by:
removeEventListenerin interfaceIdentityStore- Parameters:
identifier- the identifier for theIdEventListenerto be removed
-
-