public class CachedRemoteServicesImpl extends RemoteServicesImpl implements ICachedDirectoryServices
Modifier and Type | Field and Description |
---|---|
protected static String |
NSROLE_ATTR |
protected static String |
NSROLEDN_ATTR |
AM_SDK_DEBUG_FILE, AMSR_ATTRS, AMSR_CODE, AMSR_COUNT, AMSR_RESULTS, callBackHelperBase, complianceServicesImpl, dcTreeServicesImpl, debug, IDREPO_SERVICE, SDK_SERVICE
Modifier and Type | Method and Description |
---|---|
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).
|
String |
createAMTemplate(SSOToken token,
String entryDN,
int objectType,
String serviceName,
Map attributes,
int priority)
Create an AMTemplate (COSTemplate)
|
void |
createEntry(SSOToken token,
String entryName,
int objectType,
String parentDN,
Map attributes)
Create an entry in the Directory
|
void |
dirtyCache(String dn,
int eventType,
boolean cosType,
boolean aciChange,
Set attrNames)
This method will be called by
AMIdRepoListener . |
boolean |
doesEntryExists(SSOToken token,
String entryDN)
Checks if the entry exists in the directory.
|
Map |
getAttributes(SSOToken token,
String entryDN,
boolean ignoreCompliance,
boolean byteValues,
int profileType)
Gets all attributes corresponding to the entryDN.
|
Map |
getAttributes(SSOToken token,
String entryDN,
int profileType)
Returns a Map with attribute-values requested from the directory.
|
Map |
getAttributes(SSOToken token,
String entryDN,
Set attrNames,
boolean ignoreCompliance,
boolean byteValues,
int profileType)
Gets the specific attributes corresponding to the entryDN.
|
Map |
getAttributes(SSOToken token,
String entryDN,
Set attrNames,
int profileType)
Returns a Map with attribute-values requested from the directory.
|
Map |
getAttributesByteValues(SSOToken token,
String entryDN,
int profileType)
Returns a map of attribute-values for binary attributes.
|
Map |
getAttributesByteValues(SSOToken token,
String entryDN,
Set attrNames,
int profileType)
Returns a map of attribute-values for binary attributes.
|
Map |
getExternalAttributes(SSOToken token,
String entryDN,
Set attrNames,
int profileType)
Returns attributes from an external data store.
|
protected static IDirectoryServices |
getInstance() |
protected static int |
getMaxSize()
Method to get the maximum size of the Cache.
|
int |
getObjectType(SSOToken token,
String dn)
Gets the type of the object given its DN.
|
String |
getOrganizationDN(SSOToken token,
String entryDN)
Gets the Organization DN for the specified entryDN.
|
int |
getSize()
Method to get the current cache size
|
void |
removeEntry(SSOToken token,
String entryDN,
int objectType,
boolean recursive,
boolean softDelete)
Remove an entry from the directory.
|
String |
renameEntry(SSOToken token,
int objectType,
String entryDN,
String newName,
boolean deleteOldName)
Renames an entry.
|
void |
setAttributes(SSOToken token,
String entryDN,
int objectType,
Map stringAttributes,
Map byteAttributes,
boolean isAdd)
Method Set the attributes of an entry.
|
void |
setGroupFilter(SSOToken token,
String entryDN,
String filter)
Sets the filter for a dynamic group in the datastore.
|
String |
toString()
Prints the contents of the cache.
|
void |
updateUserAttribute(SSOToken token,
Set members,
String staticGroupDN,
boolean toAdd)
Adds or remove static group DN to or from member attribute
'iplanet-am-static-group-dn'
|
addListener, changePassword, convertException, getAMTemplateDN, getAttributesForSchema, getAttributesFromDS, getComplianceServicesImpl, getCreationTemplateName, getDCTreeAttributes, getDCTreeServicesImpl, getDebug, getGroupFilterAndScope, getMembers, getNamingAttribute, getObjectClass, getObjectType, getOrgSearchFilter, getRegisteredServiceNames, getSearchFilterFromTemplate, getSOAPClient, getTopLevelContainers, modifyMemberShip, registerService, removeAdminRole, search, search, unRegisterService, verifyAndGetOrgDN
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, changePassword, getAMTemplateDN, getAttributesForSchema, getAttributesFromDS, getComplianceServicesImpl, getCreationTemplateName, getDCTreeAttributes, getDCTreeServicesImpl, getGroupFilterAndScope, getMembers, getNamingAttribute, getObjectClass, getObjectType, getOrgSearchFilter, getRegisteredServiceNames, getSearchFilterFromTemplate, getTopLevelContainers, modifyMemberShip, registerService, removeAdminRole, search, search, unRegisterService, verifyAndGetOrgDN
protected static String NSROLEDN_ATTR
protected static String NSROLE_ATTR
public int getSize()
getSize
in interface ICachedDirectoryServices
protected static IDirectoryServices getInstance()
protected static int getMaxSize()
public String toString()
public void dirtyCache(String dn, int eventType, boolean cosType, boolean aciChange, Set attrNames)
AMIdRepoListener
. 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
dirtyCache
in interface ICachedDirectoryServices
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 changepublic void clearCache()
clearCache
in interface ICachedDirectoryServices
public void createEntry(SSOToken token, String entryName, int objectType, String parentDN, Map attributes) throws AMEntryExistsException, AMException, SSOException
RemoteServicesImpl
createEntry
in interface IDirectoryServices
createEntry
in class RemoteServicesImpl
token
- SSOTokenentryName
- name of the entry (naming value), e.g. "sun.com", "manager"objectType
- Profile Type, ORGANIZATION, AMObject.ROLE, AMObject.USER, etc.parentDN
- the parent DNattributes
- the initial attribute set for creationAMEntryExistsException
AMException
SSOException
public boolean doesEntryExists(SSOToken token, String entryDN)
RemoteServicesImpl
doesEntryExists
in interface IDirectoryServices
doesEntryExists
in class RemoteServicesImpl
token
- a valid SSOTokenentryDN
- The DN of the entry that needs to be checkedpublic void updateUserAttribute(SSOToken token, Set members, String staticGroupDN, boolean toAdd) throws AMException
RemoteServicesImpl
updateUserAttribute
in interface IDirectoryServices
updateUserAttribute
in class RemoteServicesImpl
token
- SSOTokenmembers
- set of user DN'sstaticGroupDN
- DN of the static grouptoAdd
- true to add, false to removeAMException
- if there is an internal problem with AM Store.public String getOrganizationDN(SSOToken token, String entryDN) throws AMException
NOTE: This method will involve serveral directory searches, hence be cautious of Performance hit.
This method does not call its base classes method unlike the rest of the overriden methods to obtain the organization DN, as it requires special processing requirements.
getOrganizationDN
in interface IDirectoryServices
getOrganizationDN
in class RemoteServicesImpl
token
- a valid SSOTokenentryDN
- the entry whose parent Organization is to be obtainedAMException
- if an error occured while obtaining the parent Organizationpublic int getObjectType(SSOToken token, String dn) throws AMException, SSOException
getObjectType
in interface IDirectoryServices
getObjectType
in class RemoteServicesImpl
token
- token a valid SSOTokendn
- DN of the object whose type is to be known.AMException
- if the data store is unavailable or if the objecttype is
unknownSSOException
- if ssoToken is invalid or expired.public Map getExternalAttributes(SSOToken token, String entryDN, Set attrNames, int profileType) throws AMException
getExternalAttributes
in interface IDirectoryServices
getExternalAttributes
in class RemoteServicesImpl
token
- Single sign on token of userentryDN
- DN of the entry user is trying to readattrNames
- Set of attributes to be readprofileType
- Integer determining the type of profile being readAMException
- if an error occurs when trying to read external datastorepublic Map getAttributes(SSOToken token, String entryDN, int profileType) throws AMException, SSOException
IDirectoryServices
getAttributes
in interface IDirectoryServices
getAttributes
in class RemoteServicesImpl
token
- User's single sign on tokenentryDN
- DN
of the entry.profileType
- Integer representing type of the object.AMException
- If unable to access datastoreSSOException
- If user's single sign on token is invalid.public Map getAttributes(SSOToken token, String entryDN, Set attrNames, int profileType) throws AMException, SSOException
IDirectoryServices
getAttributes
in interface IDirectoryServices
getAttributes
in class RemoteServicesImpl
token
- User's single sign on tokenentryDN
- DN
of the entry.attrNames
- Set of attributes to be read.profileType
- Integer representing type of the object.AMException
- If unable to access datastoreSSOException
- If user's single sign on token is invalid.public Map getAttributesByteValues(SSOToken token, String entryDN, int profileType) throws AMException, SSOException
IDirectoryServices
getAttributesByteValues
in interface IDirectoryServices
getAttributesByteValues
in class RemoteServicesImpl
token
- User's single sign on tokenentryDN
- DN
of the entry.profileType
- Integer representing type of the object.AMException
- If unable to access datastoreSSOException
- If user's single sign on token is invalid.public Map getAttributesByteValues(SSOToken token, String entryDN, Set attrNames, int profileType) throws AMException, SSOException
IDirectoryServices
getAttributesByteValues
in interface IDirectoryServices
getAttributesByteValues
in class RemoteServicesImpl
token
- User's single sign on tokenentryDN
- DN
of the entry.attrNames
- Names of the attributes to be read.profileType
- Integer representing type of the object.AMException
- If unable to access datastoreSSOException
- If user's single sign on token is invalid.public Map getAttributes(SSOToken token, String entryDN, boolean ignoreCompliance, boolean byteValues, int profileType) throws AMException, SSOException
getAttributes
in interface IDirectoryServices
getAttributes
in class RemoteServicesImpl
token
- a valid SSOTokenentryDN
- the DN of the entry whose attributes need to retrievedignoreCompliance
- a boolean value specificying if compliance related entries
need to ignored or not. Ignored if true.byteValues
- if false StringValues are fetched, if true byte values are
fetched.profileType
- the oject type of entryDNAMException
- if an error is encountered in fetching the attributesSSOException
- If user's single sign on token is invalid.public Map getAttributes(SSOToken token, String entryDN, Set attrNames, boolean ignoreCompliance, boolean byteValues, int profileType) throws AMException, SSOException
getAttributes
in interface IDirectoryServices
getAttributes
in class RemoteServicesImpl
token
- a valid SSOTokenentryDN
- the DN of the entry whose attributes need to retrievedattrNames
- a Set of names of the attributes that need to be retrieved.
The attrNames should not be nullignoreCompliance
- a boolean value specificying if compliance related entries
need to ignored or not. Ignored if true.byteValues
- Return binary attributes, if true.profileType
- Integer representing type of the object.AMException
- if an error is encountered in fetching the attributesSSOException
- If user's single sign on token is invalid.public String renameEntry(SSOToken token, int objectType, String entryDN, String newName, boolean deleteOldName) throws AMException
renameEntry
in interface IDirectoryServices
renameEntry
in class RemoteServicesImpl
token
- the sso tokenobjectType
- the type of entryentryDN
- the entry DNnewName
- the new name (i.e., if RDN is cn=John, the value passed should
be "John"deleteOldName
- if true the old name is deleted otherwise it is retained.DN
of the renamed entryAMException
- if the operation was not successfulpublic void setAttributes(SSOToken token, String entryDN, int objectType, Map stringAttributes, Map byteAttributes, boolean isAdd) throws AMException, SSOException
setAttributes
in interface IDirectoryServices
setAttributes
in class RemoteServicesImpl
token
- SSOTokenentryDN
- DN of the profile whose template is to be setobjectType
- profile typestringAttributes
- a AMHashMap of attributes to be setbyteAttributes
- a AMHashMap of attributes to be setisAdd
- true
add to existing value;
otherwise replace the existing valueAMException
SSOException
public void removeEntry(SSOToken token, String entryDN, int objectType, boolean recursive, boolean softDelete) throws AMException, SSOException
removeEntry
in interface IDirectoryServices
removeEntry
in class RemoteServicesImpl
token
- SSOTokenentryDN
- dn of the profile to be removedobjectType
- profile typerecursive
- if true, remove all sub entries & the objectsoftDelete
- Used to let pre/post callback plugins know that this delete is
either a soft delete (marked for deletion) or a purge/hard
delete itself, otherwise, remove the object onlyAMException
SSOException
public String createAMTemplate(SSOToken token, String entryDN, int objectType, String serviceName, Map attributes, int priority) throws AMException
createAMTemplate
in interface IDirectoryServices
createAMTemplate
in class RemoteServicesImpl
token
- tokenentryDN
- DN of the profile whose template is to be setobjectType
- the object typeserviceName
- Service Nameattributes
- attributes to be setpriority
- template priorityAMException
public void setGroupFilter(SSOToken token, String entryDN, String filter) throws AMException, SSOException
RemoteServicesImpl
setGroupFilter
in interface IDirectoryServices
setGroupFilter
in class RemoteServicesImpl
token
- Single sign on tokenentryDN
- DN
of group entryfilter
- Search filterAMException
- If there is a datastore exception.SSOException
- If user's single sign on token is invalid.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.