Class LDAPSession
java.lang.Object
com.netscape.cmscore.dbs.DBSSession
com.netscape.cmscore.dbs.LDAPSession
- All Implemented Interfaces:
AutoCloseable
A class represents the database session. Operations
can be performed with a session.
Transaction and Caching support can be integrated
into session.
- Version:
- $Revision$, $Date$
- Author:
- thomask
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLDAPSession(DBSubsystem dbSubsystem, netscape.ldap.LDAPConnection c) Constructs a database session. -
Method Summary
Modifier and TypeMethodDescriptionvoidabandon(netscape.ldap.LDAPSearchResults results) voidAdds object to backend database.voidclose()Closes this session.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs) Retrieves a list of objects.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String sortKey) Retrieves a list of objects.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String[] sortKey) Retrieves a list of objects.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String[] sortKey, int pageSize) Retrieves a list of objects.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String sortKey, int pageSize) Retrieves a list of objects.<T extends IDBObj>
IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String startFrom, String sortKey, int pageSize) Retrieves a list of objects.voidDeletes object from database.netscape.ldap.LDAPConnectionvoidmodify(String name, ModificationSet mods) Modify an object in the database.netscape.ldap.LDAPSearchResultspersistentSearch(String base, String filter, String[] attrs) Sets persistent search to retrieve modified certificate records.Reads an object from the database.Reads an object from the database, and only populates the selected attributes.voidReleases object to this interface.Searchs for a list of objects that match the filter.Searchs for a list of objects that match the filter.Searchs for a list of objects that match the filter.Searchs for a list of objects that match the filter.Searchs for a list of objects that match the filter.Retrieves a list of object that satifies the given filter.
-
Field Details
-
logger
public static final org.slf4j.Logger logger
-
-
Constructor Details
-
LDAPSession
Constructs a database session.- Parameters:
dbSubsystem- the database subsytemc- the ldap connection- Throws:
EDBException
-
-
Method Details
-
getConnection
public netscape.ldap.LDAPConnection getConnection() -
close
Closes this session.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classDBSSession- Throws:
EDBException- failed to close session
-
add
Adds object to backend database. For example,session.add("cn=123459,o=certificate repository,o=airius.com", certRec);- Overrides:
addin classDBSSession- Parameters:
name- the name of the ldap entryobj- the DBobj that can be mapped to ldap attrubute set- Throws:
EBaseException
-
read
Reads an object from the database. all attributes will be returned- Overrides:
readin classDBSSession- Parameters:
name- the name of the ldap entry- Returns:
- database object
- Throws:
EBaseException- failed to read object
-
read
Reads an object from the database, and only populates the selected attributes.- Overrides:
readin classDBSSession- Parameters:
name- the name of the ldap entryattrs- the attributes to be selected- Returns:
- database object
- Throws:
EBaseException- failed to read object
-
delete
Deletes object from database.- Overrides:
deletein classDBSSession- Parameters:
name- name of the object that is to be deleted- Throws:
EBaseException- failed to delete object
-
modify
Modify an object in the database.- Overrides:
modifyin classDBSSession- Parameters:
name- name of the object that is to be modifiedmods- modifications- Throws:
EBaseException- failed to modify
-
search
Searchs for a list of objects that match the filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filter- Returns:
- search results
- Throws:
EBaseException- failed to search
-
search
Description copied from class:DBSSessionSearchs for a list of objects that match the filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filtermaxSize- max number of entries- Returns:
- search results
- Throws:
EBaseException- failed to search
-
search
public IDBSearchResults search(String base, String filter, int maxSize, String sortAttribute) throws EBaseException Description copied from class:DBSSessionSearchs for a list of objects that match the filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filtermaxSize- max number of entriessortAttribute- Field to sort the records on- Returns:
- search results
- Throws:
EBaseException- failed to search
-
search
public IDBSearchResults search(String base, String filter, int maxSize, int timeLimit) throws EBaseException Description copied from class:DBSSessionSearchs for a list of objects that match the filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filtermaxSize- max number of entriestimeLimit- timeout limit- Returns:
- search results
- Throws:
EBaseException- failed to search
-
search
public IDBSearchResults search(String base, String filter, int maxSize, int timeLimit, String sortAttribute) throws EBaseException Description copied from class:DBSSessionSearchs for a list of objects that match the filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filtermaxSize- max number of entriestimeLimit- timeout limitsortAttribute- Field to sort the records on- Returns:
- search results
- Throws:
EBaseException- failed to search
-
search
Retrieves a list of object that satifies the given filter.- Overrides:
searchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributes- Returns:
- search results
- Throws:
EBaseException- failed to search
-
persistentSearch
public netscape.ldap.LDAPSearchResults persistentSearch(String base, String filter, String[] attrs) throws EBaseException Description copied from class:DBSSessionSets persistent search to retrieve modified certificate records.- Overrides:
persistentSearchin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributes- Returns:
- LDAP search results
- Throws:
EBaseException- failed to search
-
abandon
- Overrides:
abandonin classDBSSession- Throws:
EBaseException
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs) throws EBaseException Retrieves a list of objects.- Overrides:
createVirtualListin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributes- Returns:
- search results in virtual list
- Throws:
EBaseException- failed to search
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String[] sortKey) throws EBaseException Retrieves a list of objects.- Throws:
EBaseException
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String sortKey) throws EBaseException Retrieves a list of objects.- Throws:
EBaseException
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String[] sortKey, int pageSize) throws EBaseException Retrieves a list of objects.- Overrides:
createVirtualListin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributessortKey- keys used to sort the listpageSize- page size in the virtual list- Returns:
- search results in virtual list
- Throws:
EBaseException- failed to search
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String sortKey, int pageSize) throws EBaseException Retrieves a list of objects.- Overrides:
createVirtualListin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributessortKey- key used to sort the listpageSize- page size in the virtual list- Returns:
- search results in virtual list
- Throws:
EBaseException- failed to search
-
createVirtualList
public <T extends IDBObj> IDBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String startFrom, String sortKey, int pageSize) throws EBaseException Description copied from class:DBSSessionRetrieves a list of objects.- Overrides:
createVirtualListin classDBSSession- Parameters:
base- starting point of the searchfilter- search filterattrs- selected attributesstartFrom- starting pointsortKey- key used to sort the listpageSize- page size in the virtual list- Returns:
- search results in virtual list
- Throws:
EBaseException- failed to search
-
release
Releases object to this interface. This allows us to use memory more efficiently.
-