com.sun.identity.idm
Class AMIdentityRepository

java.lang.Object
  extended by com.sun.identity.idm.AMIdentityRepository

public final class AMIdentityRepository
extends Object

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
AMIdentityRepository(SSOToken ssotoken, String realmName)
           
 
Method Summary
 int addEventListener(IdEventListener listener)
           
static void clearCache()
           
 Set createIdentities(IdType type, Map identityNamesAndAttrs)
           
 AMIdentity createIdentity(IdType type, String idName, Map attrMap)
           
 void deleteIdentities(IdType type, Set identities)
          Deprecated. As of release AM 7.1, replaced by AMIdentityRepository.deleteIdentities(Set)
 void deleteIdentities(Set identities)
           
 Set getAllowedIdOperations(IdType type)
           
 AMIdentity getRealmIdentity()
           
 Set getSupportedIdTypes()
           
 void removeEventListener(int identifier)
           
 IdSearchResults searchIdentities(IdType type, String pattern, IdSearchControl ctrl)
           
 

Constructor Detail

AMIdentityRepository

public AMIdentityRepository(SSOToken ssotoken,
                            String realmName)
                     throws IdRepoException,
                            SSOException
Parameters:
ssotoken - Single sign on token of the user
realmName - Name of the realm (can be a Fully qualified DN)
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.
Method Detail

getSupportedIdTypes

public Set getSupportedIdTypes()
                        throws IdRepoException,
                               SSOException
Returns:
Set of supported IdType objects.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

getAllowedIdOperations

public Set getAllowedIdOperations(IdType type)
                           throws IdRepoException,
                                  SSOException
Parameters:
type - Type of identity
Returns:
Set of IdOperation objects.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

searchIdentities

public IdSearchResults searchIdentities(IdType type,
                                        String pattern,
                                        IdSearchControl ctrl)
                                 throws IdRepoException,
                                        SSOException
Parameters:
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.
Returns:
Returns the combined results in an object IdSearchResults.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.
See Also:
IdSearchControl, IdSearchResults

getRealmIdentity

public AMIdentity getRealmIdentity()
                            throws IdRepoException,
                                   SSOException
Returns:
a handle of the Identity object.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

createIdentity

public AMIdentity createIdentity(IdType type,
                                 String idName,
                                 Map attrMap)
                          throws IdRepoException,
                                 SSOException
Parameters:
type - 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.
Returns:
Identity object representing the newly created entry.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

createIdentities

public Set createIdentities(IdType type,
                            Map identityNamesAndAttrs)
                     throws IdRepoException,
                            SSOException
Parameters:
type - Type of object to be created
identityNamesAndAttrs - Names of the identities and their
Returns:
Set of created Identities.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

deleteIdentities

public void deleteIdentities(IdType type,
                             Set identities)
                      throws IdRepoException,
                             SSOException
Deprecated. As of release AM 7.1, replaced by AMIdentityRepository.deleteIdentities(Set)

Parameters:
type - Type of Identity to be deleted.
identities - Set of AMIdentity objects to be deleted.
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

deleteIdentities

public void deleteIdentities(Set identities)
                      throws IdRepoException,
                             SSOException
Parameters:
identities - Set of AMIdentity objects to be deleted
Throws:
IdRepoException - if there are repository related error conditions.
SSOException - if user's single sign on token is invalid.

addEventListener

public int addEventListener(IdEventListener listener)
Parameters:
listener - The callback which implements AMEventListener.
Returns:
Integer identifier for this listener.

removeEventListener

public void removeEventListener(int identifier)
Parameters:
identifier - Integer identifying the listener.

clearCache

public static void clearCache()