Package com.sun.identity.idm.server
Class IdCachedServicesImpl
- java.lang.Object
-
- com.sun.identity.idm.server.IdServicesImpl
-
- com.sun.identity.idm.server.IdCachedServicesImpl
-
- All Implemented Interfaces:
ConfigurationListener,IdCachedServices,IdServices
public class IdCachedServicesImpl extends IdServicesImpl implements IdCachedServices, ConfigurationListener
-
-
Field Summary
-
Fields inherited from class com.sun.identity.idm.server.IdServicesImpl
DEBUG, emptyUserIdentities, shutdownCalled, specialIdentities, specialIdentityNames
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap, String amOrgName, String amsdkDN)voidclearCache()This method is used to clear the entire SDK cache in the event that EventService notifies that all entries have been modified (or should be marked dirty).AMIdentitycreate(SSOToken token, IdType type, String name, Map attrMap, String amOrgName)voiddelete(SSOToken token, IdType type, String name, String orgName, String amsdkDN)voiddirtyCache(String dn, int eventType, boolean cosType, boolean aciChange, Set attrNames)This method will be called byAMIdRepoListener.Set<String>getAssignedServices(SSOToken token, IdType type, String name, Map mapOfServiceNamesAndOCs, String amOrgName, String amsdkDN)MapgetAttributes(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN)MapgetAttributes(SSOToken token, IdType type, String name, Set attrNames, String amOrgName, String amsdkDN, boolean isStringValues)SetgetFullyQualifiedNames(SSOToken token, IdType type, String name, String orgName)Returns the set of fully qualified names for the identity.protected static IdServicesgetInstance()protected static intgetMaxSize()Method to get the maximum size of the Cache.SetgetMembers(SSOToken token, IdType type, String name, String amOrgName, IdType membersType, String amsdkDN)SetgetMemberships(SSOToken token, IdType type, String name, IdType membershipType, String amOrgName, String amsdkDN)MapgetServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames, String amOrgName, String amsdkDN, boolean isString)intgetSize()Method to get the current cache sizebooleanisActive(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN)booleanisExists(SSOToken token, IdType type, String name, String amOrgName)voidmodifyMemberShip(SSOToken token, IdType type, String name, Set members, IdType membersType, int operation, String amOrgName)voidmodifyService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap, String amOrgName, String amsdkDN)voidnotifyChanges()This method will be call if configuration changed.voidremoveAttributes(SSOToken token, IdType type, String name, Set attrNames, String orgName, String amsdkDN)IdSearchResultssearch(SSOToken token, IdType type, IdSearchControl ctrl, String orgName, CrestQuery crestQuery)By passing in a CrestQuery object, we now support searching by id (via _queryId) or by filter (_queryFilter).voidsetActiveStatus(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN, boolean active)voidsetAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd, String amOrgName, String amsdkDN, boolean isString)StringtoString()-
Methods inherited from class com.sun.identity.idm.server.IdServicesImpl
authenticate, authenticate, changePassword, clearIdRepoPlugins, clearIdRepoPlugins, clearSpecialIdentityCache, getBinaryServiceAttributes, getServiceAttributes, getServiceAttributesAscending, getSpecialIdentities, getSupportedOperations, getSupportedTypes, isShutdownCalled, isSpecialIdentity, reinitialize, reloadIdRepoServiceSchema, unassignService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.identity.idm.IdServices
authenticate, authenticate, changePassword, clearIdRepoPlugins, clearIdRepoPlugins, getBinaryServiceAttributes, getServiceAttributes, getServiceAttributesAscending, getSpecialIdentities, getSupportedOperations, getSupportedTypes, reinitialize, reloadIdRepoServiceSchema, unassignService
-
-
-
-
Method Detail
-
getSize
public int getSize()
Method to get the current cache size- Specified by:
getSizein interfaceIdCachedServices- Returns:
- the size of the SDK LRU cache
-
getInstance
protected static IdServices getInstance()
-
getMaxSize
protected static int getMaxSize()
Method to get the maximum size of the Cache. To be called by all other LRU Caches that are created in AM SDK- Returns:
- the maximum cache size for a LRU cache
-
clearCache
public void clearCache()
This method is used to clear the entire SDK cache in the event that EventService notifies that all entries have been modified (or should be marked dirty).- Specified by:
clearCachein interfaceIdCachedServices
-
dirtyCache
public void dirtyCache(String dn, int eventType, boolean cosType, boolean aciChange, Set attrNames)
This method will be called byAMIdRepoListener. This method will update the cache by removing all the entires which are affected as a result of an event notification caused because of changes/deletions/renaming of entries with and without aci's.NOTE: The event could have been caused either by changes to an aci entry or a costemplate or a cosdefinition or changes to a normal entry
- Specified by:
dirtyCachein interfaceIdCachedServices- Parameters:
dn- name of entity being modifiedeventType- type of modificationcosType- true if it is cos related. false otherwiseaciChange- true if it is aci related. false otherwiseattrNames- Set of attribute Names which should be removed from the CacheEntry in the case of COS change
-
getAttributes
public Map getAttributes(SSOToken token, IdType type, String name, Set attrNames, String amOrgName, String amsdkDN, boolean isStringValues) throws IdRepoException, SSOException
- Specified by:
getAttributesin interfaceIdServices- Overrides:
getAttributesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
getMembers
public Set getMembers(SSOToken token, IdType type, String name, String amOrgName, IdType membersType, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
getMembersin interfaceIdServices- Overrides:
getMembersin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
getMemberships
public Set getMemberships(SSOToken token, IdType type, String name, IdType membershipType, String amOrgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
getMembershipsin interfaceIdServices- Overrides:
getMembershipsin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
getServiceAttributes
public Map getServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames, String amOrgName, String amsdkDN, boolean isString) throws IdRepoException, SSOException
- Overrides:
getServiceAttributesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
modifyService
public void modifyService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap, String amOrgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
modifyServicein interfaceIdServices- Overrides:
modifyServicein classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
getAssignedServices
public Set<String> getAssignedServices(SSOToken token, IdType type, String name, Map mapOfServiceNamesAndOCs, String amOrgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
getAssignedServicesin interfaceIdServices- Overrides:
getAssignedServicesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
assignService
public void assignService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap, String amOrgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
assignServicein interfaceIdServices- Overrides:
assignServicein classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
isExists
public boolean isExists(SSOToken token, IdType type, String name, String amOrgName) throws SSOException, IdRepoException
- Specified by:
isExistsin interfaceIdServices- Overrides:
isExistsin classIdServicesImpl- Throws:
SSOExceptionIdRepoException
-
isActive
public boolean isActive(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN) throws SSOException, IdRepoException
- Specified by:
isActivein interfaceIdServices- Overrides:
isActivein classIdServicesImpl- Throws:
SSOExceptionIdRepoException
-
getAttributes
public Map getAttributes(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
getAttributesin interfaceIdServices- Overrides:
getAttributesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
setActiveStatus
public void setActiveStatus(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN, boolean active) throws SSOException, IdRepoException
- Specified by:
setActiveStatusin interfaceIdServices- Overrides:
setActiveStatusin classIdServicesImpl- Throws:
SSOExceptionIdRepoException
-
setAttributes
public void setAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd, String amOrgName, String amsdkDN, boolean isString) throws IdRepoException, SSOException
- Specified by:
setAttributesin interfaceIdServices- Overrides:
setAttributesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
modifyMemberShip
public void modifyMemberShip(SSOToken token, IdType type, String name, Set members, IdType membersType, int operation, String amOrgName) throws IdRepoException, SSOException
- Specified by:
modifyMemberShipin interfaceIdServices- Overrides:
modifyMemberShipin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
create
public AMIdentity create(SSOToken token, IdType type, String name, Map attrMap, String amOrgName) throws IdRepoException, SSOException
- Specified by:
createin interfaceIdServices- Overrides:
createin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
delete
public void delete(SSOToken token, IdType type, String name, String orgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
deletein interfaceIdServices- Overrides:
deletein classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
removeAttributes
public void removeAttributes(SSOToken token, IdType type, String name, Set attrNames, String orgName, String amsdkDN) throws IdRepoException, SSOException
- Specified by:
removeAttributesin interfaceIdServices- Overrides:
removeAttributesin classIdServicesImpl- Throws:
IdRepoExceptionSSOException
-
search
public IdSearchResults search(SSOToken token, IdType type, IdSearchControl ctrl, String orgName, CrestQuery crestQuery) throws IdRepoException, SSOException
Description copied from interface:IdServicesBy passing in a CrestQuery object, we now support searching by id (via _queryId) or by filter (_queryFilter).- Specified by:
searchin interfaceIdServices- Overrides:
searchin classIdServicesImpl- Parameters:
token- is the sso token of the person performing this operation.type- is the identity type of the name parameter.ctrl- the search controlorgName- is the orgname.crestQuery- encapsulates _queryId or _queryFilter from the CREST endpoint.- Throws:
IdRepoException- if there are repository related error conditions.SSOException- if user's single sign on token is invalid.
-
getFullyQualifiedNames
public Set getFullyQualifiedNames(SSOToken token, IdType type, String name, String orgName) throws IdRepoException, SSOException
Description copied from class:IdServicesImplReturns the set of fully qualified names for the identity. The fully qualified names would be unique for a given datastore.- Specified by:
getFullyQualifiedNamesin interfaceIdServices- Overrides:
getFullyQualifiedNamesin classIdServicesImpl- Parameters:
token- SSOToken that can be used by the datastore to determine the fully qualified nametype- type of the identityname- name of the identity- Returns:
- fully qualified names for the identity
- Throws:
IdRepoException- If there are repository related error conditionsSSOException- If identity's single sign on token is invalid
-
notifyChanges
public void notifyChanges()
Description copied from interface:ConfigurationListenerThis method will be call if configuration changed.- Specified by:
notifyChangesin interfaceConfigurationListener
-
-