public class AMIdentityRepository extends Object
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);
Modifier and Type | Field and Description |
---|---|
static Debug |
debug |
static Map |
listeners |
Constructor and Description |
---|
AMIdentityRepository(SSOToken ssotoken,
String realmName)
Deprecated.
in 13.0.0, use
AMIdentityRepository(String, com.iplanet.sso.SSOToken) instead |
AMIdentityRepository(String realmName,
SSOToken ssoToken)
Constructor for the
AMIdentityRepository object. |
Modifier and Type | Method and Description |
---|---|
static void |
addCreationListener(IdRepoCreationListener listener)
Adds a creation listener that will be notified each time a
AMIdentityRepository is created . |
int |
addEventListener(IdEventListener listener)
Adds a listener, which should receive notifications for all changes that
occurred in this organization.
|
boolean |
authenticate(Callback[] credentials)
Non-javadoc, non-public methods Returns
true if the data
store has successfully authenticated the identity with the provided
credentials. |
boolean |
authenticate(IdType idType,
Callback[] credentials)
Non-javadoc, non-public methods Returns
true if the data
store has successfully authenticated the identity with the provided
credentials. |
static void |
clearCache()
Clears the cache.
|
Set |
createIdentities(IdType type,
Map identityNamesAndAttrs)
Creates multiple objects of the same type.
|
AMIdentity |
createIdentity(IdType type,
String idName,
Map attrMap)
Creates a single object of a type.
|
void |
deleteIdentities(IdType type,
Set identities)
Deprecated.
As of release AM 7.1, replaced by
deleteIdentities(Set) |
void |
deleteIdentities(Set identities)
Deletes identities.
|
Set |
getAllowedIdOperations(IdType type)
Returns the set of Operations for a given
IdType ,
IdOperations that can be performed on an Identity. |
AMIdentity |
getRealmIdentity()
Returns a handle of the Identity object representing this
realm for services related operations only.
|
IdSearchResults |
getSpecialIdentities(IdType type)
Return the special identities for this realm for a given type.
|
IdSearchResults |
getSpecialIdentities(SSOToken token,
IdType type,
String orgName) |
Set |
getSupportedIdTypes()
Returns the set of supported object types
IdType for this
deployment. |
static boolean |
removeCreationListener(IdRepoCreationListener listener)
Removes a creation listener so that it will no longer be notified when a
AMIdentityRepository is created. |
void |
removeEventListener(int identifier)
Removes listener as the application is no longer interested in receiving
notifications.
|
IdSearchResults |
searchIdentities(IdType type,
CrestQuery crestQuery,
IdSearchControl ctrl)
Searches 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.
|
IdSearchResults |
searchIdentities(IdType type,
String pattern,
IdSearchControl ctrl)
Searches for identities of certain types from each plugin and returns a
combined result.
|
IdSearchResults |
searchIdentities(IdType type,
String pattern,
Map avPairs,
boolean recursive,
int maxResults,
int maxTime,
Set returnAttributes,
boolean returnAllAttributes)
Deprecated.
This method is deprecated. Use
searchIdentities(IdType type,String pattern,
IdSearchControl ctrl) |
String |
toString()
Return String representation of the
AMIdentityRepository
object. |
@Deprecated public AMIdentityRepository(SSOToken ssotoken, String realmName) throws IdRepoException, SSOException
AMIdentityRepository(String, com.iplanet.sso.SSOToken)
insteadAMIdentityRepository
object. If a null
is passed for the organization identifier realmName
, then
the "root" realm is assumed.ssotoken
- Single sign on token of the userrealmName
- Name of the realm (can be a Fully qualified DN)IdRepoException
- Never thrown, required by legacy code.SSOException
- Never thrown, required by legacy code.@Inject public AMIdentityRepository(@Nullable String realmName, SSOToken ssoToken)
AMIdentityRepository
object. If a null
is passed for
the organization identifier realmName
, then the "root" realm is assumed.ssoToken
- Single sign on token of the user.realmName
- Name of the realm (can be a Fully qualified DN).public static void addCreationListener(IdRepoCreationListener listener)
AMIdentityRepository
is created .listener
- The listener.public static boolean removeCreationListener(IdRepoCreationListener listener)
AMIdentityRepository
is created.listener
- The listener.true
if the listener was removed.public Set getSupportedIdTypes() throws IdRepoException, SSOException
IdType
for this
deployment. This is not realm specific. IdType
objects.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public Set getAllowedIdOperations(IdType type) throws IdRepoException, SSOException
IdType
,
IdOperations
that can be performed on an Identity. This
varies for each organization (and each plugin?).type
- Type of identityIdOperation
objects.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public IdSearchResults getSpecialIdentities(IdType type) throws IdRepoException, SSOException
type
- Type of the identityIdRepoException
- if there is a datastore exceptionSSOException
- if the user's single sign on token is not valid.public IdSearchResults searchIdentities(IdType type, String pattern, Map avPairs, boolean recursive, int maxResults, int maxTime, Set returnAttributes, boolean returnAllAttributes) throws IdRepoException, SSOException
searchIdentities(IdType type,String pattern,
IdSearchControl ctrl)
type
- Type of identity being searched for.pattern
- Search pattern, like "a*" or "*".avPairs
- Map of attribute-values which can further help qualify the
search pattern.recursive
- If true, then the search is performed on the entire subtree
(if applicable)maxResults
- Maximum number of results to be returned. A -1 means no limit
on the result set.maxTime
- Maximum amount of time after which the search should return
with partial results.returnAttributes
- Set of attributes to be read when performing the search.returnAllAttributes
- If true, then read all the attributes of the entries.AMIdentity
objects.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public IdSearchResults searchIdentities(IdType type, String pattern, IdSearchControl ctrl) throws IdRepoException, SSOException
AMIdentity
object can be used to assign and unassign services containing
dynamic attributes to this realm.type
- Type of identity being searched for.pattern
- Pattern to be used when searching.ctrl
- IdSearchControl which can be used to set up various search
controls on the search to be performed.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.IdSearchControl
,
IdSearchResults
public IdSearchResults searchIdentities(IdType type, CrestQuery crestQuery, IdSearchControl ctrl) throws IdRepoException, SSOException
AMIdentity
object can be used to assign and unassign services containing
dynamic attributes to this realm.type
- Type of identity being searched for.crestQuery
- Basically just an object which supports both _queryId and _queryFilterctrl
- IdSearchControl which can be used to set up various search
controls on the search to be performed.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.IdSearchControl
,
IdSearchResults
public AMIdentity getRealmIdentity() throws IdRepoException, SSOException
AMIdentity
object can be used to assign and unassign services containing
dynamic attributes to this realmIdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public AMIdentity createIdentity(IdType type, String idName, Map attrMap) throws IdRepoException, SSOException
IdType.REALM
identities,
a map of sunIdentityRepositoryService
attributes need to
be passed. Also, AMIdentity object representing this realm can be
used for services related operations only. This AMIdentity
object can be used to assign and unassign services containing
dynamic attributes to this realmtype
- IdType
of object to be created.idName
- Name of object. If the type is IdType.REALM
then enter a valid realm name.attrMap
- Map of attribute-values to be set when creating the entry.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public Set createIdentities(IdType type, Map identityNamesAndAttrs) throws IdRepoException, SSOException
IdRepo
plugins that support creation of these objects.
This method is only valid for:
IdType.AGENT
IdType.REALM
IdType.REALM
identities,
a map of sunIdentityRepositoryService
attributes need to
be passed. Also, AMIdentity object representing this realm can be
used for services related operations only. This AMIdentity
object can be used to assign and unassign services containing
dynamic attributes to this realm.type
- Type of object to be createdidentityNamesAndAttrs
- Names of the identities and theirIdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public void deleteIdentities(IdType type, Set identities) throws IdRepoException, SSOException
deleteIdentities(Set)
AMIdentity
objects.
This method is only valid for:
IdType.AGENT
IdType.REALM
type
- Type of Identity to be deleted.identities
- Set of AMIdentity
objects to be deleted.IdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public void deleteIdentities(Set identities) throws IdRepoException, SSOException
AMIdentity
objects.
This method is only valid for:
IdType.AGENT
IdType.REALM
identities
- Set of AMIdentity
objects to be deletedIdRepoException
- if there are repository related error conditions.SSOException
- if user's single sign on token is invalid.public boolean authenticate(Callback[] credentials) throws IdRepoException, AuthLoginException
true
if the data
store has successfully authenticated the identity with the provided
credentials. In case the data store requires additional credentials, the
list would be returned via the IdRepoException
exception.credentials
- Array of callback objects containing information such as
username and password.true
if data store authenticates the identity;
else false
IdRepoException
AuthLoginException
public boolean authenticate(IdType idType, Callback[] credentials) throws IdRepoException, AuthLoginException
true
if the data
store has successfully authenticated the identity with the provided
credentials. In case the data store requires additional credentials, the
list would be returned via the IdRepoException
exception.credentials
- Array of callback objects containing information such as
username and password.idType
- The type of identity to authenticate as, or null for any.true
if data store authenticates the identity;
else false
IdRepoException
AuthLoginException
public int addEventListener(IdEventListener listener)
listener
- The callback which implements AMEventListener
.public void removeEventListener(int identifier)
identifier
- Integer identifying the listener.public static void clearCache()
public IdSearchResults getSpecialIdentities(SSOToken token, IdType type, String orgName) throws IdRepoException, SSOException
IdRepoException
SSOException
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.