Package com.sun.identity.sm.ldap
Class SMSLdapObject
- java.lang.Object
-
- com.sun.identity.sm.SMSObject
-
- com.sun.identity.sm.SMSObjectDB
-
- com.sun.identity.sm.ldap.SMSLdapObject
-
- All Implemented Interfaces:
SMSObjectListener,EventListener
public class SMSLdapObject extends SMSObjectDB implements SMSObjectListener
This object represents an LDAP entry in the directory server. The UMS have an equivalent class called PersistentObject. The SMS could not integrate with PersistentObject, because of the its dependecy on the Session object. This would mean that, to instantiate an PersistentObject inside SMS, we need to create an UMS instance, which would be having directory parameters of SMS.This class is used both to read and write information into the directory server. The appropriate constructors discusses it is done.
There can be only three types of SMS entries in the directory (i) entry with organizationUnit object class (attribute: ou) (ii) entry with sunService object class (attributes: ou, labeledURI, sunServiceSchema, sunPluginSchema, and sunKeyValue (sunXMLKeyValue, in the future) (iii) entry with sunServiceComponent object class (attributes: ou, sunServiceID, sunSMSPriority, sunKeyValue. All the schema, configuration and plugin entries will be stored using the above entries.
-
-
Field Summary
Fields Modifier and Type Field Description static StringORG_CANNOT_OBTAINstatic StringSUBORG_CANNOT_OBTAIN-
Fields inherited from interface com.sun.identity.sm.SMSObjectListener
ADD, DELETE, MODIFY
-
-
Constructor Summary
Constructors Constructor Description SMSLdapObject()Public constructor for SMSLdapObject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallObjectsChanged()This callback notifies the listener that all object should be marked as "changed" or "dirty".voidcreate(SSOToken token, String dn, Map attrs)Create an entry in the directoryvoiddelete(SSOToken token, String dn)Delete the entry in the directory.voidderegisterCallbackHandler(String id)De-Registration of Notification CallbacksbooleanentryExists(SSOToken token, String dn)Checks if the provided DN exists.voidmodify(SSOToken token, String dn, ModificationItem[] mods)Save the entry using the token provided.voidobjectChanged(String dn, int type)This callback method is called by the EventService when the Directory Server triggers a PersistentSearch notificationMap<String,Set<String>>read(SSOToken token, String dn)Reads in the object from persistent store, assuming that the guid and the SSOToken are validvoidregisterCallbackHandler(SMSObjectListener changeListener)Registration of Notification CallbacksSet<String>schemaSubEntries(SSOToken token, String dn, String filter, String sidFilter, int numOfEntries, boolean sortResults, boolean ascendingOrder)Returns the sub-entry names.Set<String>search(SSOToken token, String startDN, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder)Returns LDAP entries that match the filter, using the start DN provided in methodIterator<SMSDataEntry>search(SSOToken token, String startDN, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder, Set<String> excludes)Returns LDAP entries that match the filter, using the start DN provided in methodSet<String>searchOrganizationNames(SSOToken token, String dn, int numOfEntries, boolean sortResults, boolean ascendingOrder, String serviceName, String attrName, Set values)Returns the organization names.Set<String>searchSubOrgNames(SSOToken token, String dn, String filter, int numOfEntries, boolean sortResults, boolean ascendingOrder, boolean recursive)Returns the suborganization names.voidshutdown()Set<String>subEntries(SSOToken token, String dn, String filter, int numOfEntries, boolean sortResults, boolean ascendingOrder)Returns the sub-entry names.StringtoString()-
Methods inherited from class com.sun.identity.sm.SMSObjectDB
getAMSdkBaseDN, getRootSuffix
-
Methods inherited from class com.sun.identity.sm.SMSObject
cacheResults, debug, getAttributeNames, getNamingAttribute, getOrgNamingAttribute, getSearchFilter, getServiceIdSearchFilter, initialize
-
-
-
-
Field Detail
-
ORG_CANNOT_OBTAIN
public static final String ORG_CANNOT_OBTAIN
- See Also:
- Constant Field Values
-
SUBORG_CANNOT_OBTAIN
public static final String SUBORG_CANNOT_OBTAIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SMSLdapObject
public SMSLdapObject() throws SMSExceptionPublic constructor for SMSLdapObject- Throws:
SMSException
-
-
Method Detail
-
read
public Map<String,Set<String>> read(SSOToken token, String dn) throws SMSException, SSOException
Reads in the object from persistent store, assuming that the guid and the SSOToken are valid- Specified by:
readin classSMSObject- Throws:
SMSExceptionSSOException
-
create
public void create(SSOToken token, String dn, Map attrs) throws SMSException, SSOException
Create an entry in the directory- Specified by:
createin classSMSObject- Throws:
SMSExceptionSSOException
-
modify
public void modify(SSOToken token, String dn, ModificationItem[] mods) throws SMSException, SSOException
Save the entry using the token provided. The principal provided will be used to get the proxy connection.- Specified by:
modifyin classSMSObject- Throws:
SMSExceptionSSOException
-
delete
public void delete(SSOToken token, String dn) throws SMSException, SSOException
Delete the entry in the directory. This will delete sub-entries also!- Specified by:
deletein classSMSObject- Throws:
SMSExceptionSSOException
-
subEntries
public Set<String> subEntries(SSOToken token, String dn, String filter, int numOfEntries, boolean sortResults, boolean ascendingOrder) throws SMSException, SSOException
Returns the sub-entry names. Returns a set of RDNs that are sub-entries. The paramternumOfEntriesidentifies the number of entries to return, if0returns all the entries.- Specified by:
subEntriesin classSMSObject- Throws:
SMSExceptionSSOException
-
schemaSubEntries
public Set<String> schemaSubEntries(SSOToken token, String dn, String filter, String sidFilter, int numOfEntries, boolean sortResults, boolean ascendingOrder) throws SMSException, SSOException
Returns the sub-entry names. Returns a set of RDNs that are sub-entries. The paramternumOfEntriesidentifies the number of entries to return, if0returns all the entries.- Specified by:
schemaSubEntriesin classSMSObject- Throws:
SMSExceptionSSOException
-
search
public Iterator<SMSDataEntry> search(SSOToken token, String startDN, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder, Set<String> excludes) throws SSOException, SMSException
Returns LDAP entries that match the filter, using the start DN provided in method- Specified by:
searchin classSMSObject- Throws:
SSOExceptionSMSException
-
search
public Set<String> search(SSOToken token, String startDN, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder) throws SSOException, SMSException
Returns LDAP entries that match the filter, using the start DN provided in method- Specified by:
searchin classSMSObject- Throws:
SSOExceptionSMSException
-
entryExists
public boolean entryExists(SSOToken token, String dn)
Checks if the provided DN exists. Used by PolicyManager.- Specified by:
entryExistsin classSMSObject- Parameters:
token- Admin token.dn- The DN to check.- Returns:
trueif the entry exists,falseotherwise.
-
registerCallbackHandler
public void registerCallbackHandler(SMSObjectListener changeListener) throws SMSException
Registration of Notification Callbacks- Overrides:
registerCallbackHandlerin classSMSObject- Throws:
SMSException
-
deregisterCallbackHandler
public void deregisterCallbackHandler(String id)
Description copied from class:SMSObjectDe-Registration of Notification Callbacks- Overrides:
deregisterCallbackHandlerin classSMSObject
-
objectChanged
public void objectChanged(String dn, int type)
Description copied from interface:SMSObjectListenerThis callback method is called by the EventService when the Directory Server triggers a PersistentSearch notification- Specified by:
objectChangedin interfaceSMSObjectListener
-
allObjectsChanged
public void allObjectsChanged()
Description copied from interface:SMSObjectListenerThis callback notifies the listener that all object should be marked as "changed" or "dirty". This callback is only used in the case when Event Service looses the directory connection and does not know what could have changed in the directory.- Specified by:
allObjectsChangedin interfaceSMSObjectListener
-
searchSubOrgNames
public Set<String> searchSubOrgNames(SSOToken token, String dn, String filter, int numOfEntries, boolean sortResults, boolean ascendingOrder, boolean recursive) throws SMSException, SSOException
Returns the suborganization names. Returns a set of RDNs that are suborganization name. The paramternumOfEntriesidentifies the number of entries to return, if0returns all the entries.- Specified by:
searchSubOrgNamesin classSMSObject- Throws:
SMSExceptionSSOException
-
searchOrganizationNames
public Set<String> searchOrganizationNames(SSOToken token, String dn, int numOfEntries, boolean sortResults, boolean ascendingOrder, String serviceName, String attrName, Set values) throws SMSException, SSOException
Returns the organization names. Returns a set of RDNs that are organization name. The paramternumOfEntriesidentifies the number of entries to return, if0returns all the entries.- Specified by:
searchOrganizationNamesin classSMSObject- Throws:
SMSExceptionSSOException
-
-