Package com.netscape.cmscore.dbs
Class DBSSession
java.lang.Object
com.netscape.cmscore.dbs.DBSSession
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
LDAPSession
An interface represents the database session. Operations
can be performed with a session.
Transaction and Caching support can be integrated
into session.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
abandon
(netscape.ldap.LDAPSearchResults results) void
Adds object to backend database.void
close()
Closes this session.<T extends IDBObj>
intcountEntries
(Class<T> classResults, String base, String filter, int timeLimit) Retrieves a list of object that satisfies the given filter.<T extends IDBObj>
DBPagedSearch<T>createPagedSearch
(Class<T> classResults, String base, String filter, String[] attrs, String sortKey) Retrieves a paged search of objects.<T extends IDBObj>
DBPagedSearch<T>createPagedSearch
(Class<T> classResults, String base, String filter, String[] attrs, String[] sortKeys) Retrieves a paged search of objects.<T extends IDBObj>
DBVirtualList<T>createVirtualList
(String base, String filter, String[] attrs) Deprecated, for removal: This API element is subject to removal in a future version.<T extends IDBObj>
DBVirtualList<T>createVirtualList
(String base, String filter, String[] attrs, String[] sortKeys, int pageSize) Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
<T extends IDBObj>
DBVirtualList<T>createVirtualList
(String base, String filter, String[] attrs, String sortKey, int pageSize) Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
<T extends IDBObj>
DBVirtualList<T>createVirtualList
(String base, String filter, String[] attrs, String startFrom, String sortKey, int pageSize) Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
void
Deletes object from database.void
modify
(String name, ModificationSet mods) Modify an object in the database.pagedSearch
(String base, String filter, int start, int size) Retrieves a list of object that satifies the given filter.pagedSearch
(String base, String filter, int start, int size, int timeLimit) Retrieves a list of object that satifies the given filter.pagedSearch
(String base, String filter, String[] sortKeys, int start, int size, int timeLimit) Retrieves a list of object that satifies the given filter.netscape.ldap.LDAPSearchResults
persistentSearch
(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.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.
-
Constructor Details
-
DBSSession
public DBSSession()
-
-
Method Details
-
close
Closes this session.- Specified by:
close
in interfaceAutoCloseable
- Throws:
DBException
- failed to close session
-
add
Adds object to backend database. For example,session.add("cn=123459,o=certificate repository,o=airius.com", record);
- Parameters:
name
- name of the objectobj
- object to be added- Throws:
DBException
- failed to add objectEBaseException
-
read
Reads an object from the database.- Parameters:
name
- name of the object that is to be read- Returns:
- database object
- Throws:
EBaseException
- failed to read object
-
read
Reads an object from the database, and only populates the selected attributes.- Parameters:
name
- name of the object that is to be readattrs
- selected attributes- Returns:
- database object
- Throws:
EBaseException
- failed to read object
-
delete
Deletes object from database.- Parameters:
name
- name of the object that is to be deleted- Throws:
EBaseException
- failed to delete object
-
modify
Modify an object in the database.- 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.- Parameters:
base
- starting point of the searchfilter
- search filter- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
search
Searchs for a list of objects that match the filter.- Parameters:
base
- starting point of the searchfilter
- search filtermaxSize
- max number of entries- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
search
public DBSearchResults search(String base, String filter, int maxSize, int timeLimit) throws EBaseException Searchs for a list of objects that match the filter.- 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 DBSearchResults search(String base, String filter, int maxSize, String sortAttribute) throws EBaseException Searchs for a list of objects that match the filter.- 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 DBSearchResults search(String base, String filter, int maxSize, int timeLimit, String sortAttribute) throws EBaseException Searchs for a list of objects that match the filter.- 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.- Parameters:
base
- starting point of the searchfilter
- search filterattrs
- selected attributes- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
pagedSearch
public DBSearchResults pagedSearch(String base, String filter, int start, int size) throws EBaseException Retrieves a list of object that satifies the given filter.- Parameters:
base
- starting point of the searchfilter
- search filterstart
- index of the first elementsize
- max number of element in the page- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
pagedSearch
public DBSearchResults pagedSearch(String base, String filter, int start, int size, int timeLimit) throws EBaseException Retrieves a list of object that satifies the given filter.- Parameters:
base
- starting point of the searchfilter
- search filterstart
- index of the first elementsize
- max number of element in the pagetimeLimit
- timeout limit- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
pagedSearch
public DBSearchResults pagedSearch(String base, String filter, String[] sortKeys, int start, int size, int timeLimit) throws EBaseException Retrieves a list of object that satifies the given filter.- Parameters:
base
- starting point of the searchfilter
- search filtersortKey
- key used to sort the liststart
- index of the first elementsize
- max number of element in the pagetimeLimit
- timeout limit- Returns:
- search results
- Throws:
EBaseException
- failed to search
-
countEntries
public <T extends IDBObj> int countEntries(Class<T> classResults, String base, String filter, int timeLimit) throws EBaseException Retrieves a list of object that satisfies the given filter.- Parameters:
classResults
- the class representing the entries in the paged listbase
- starting point of the searchfilter
- search filtertimeLimit
- timeout limit- Returns:
- the number of certificates
- Throws:
EBaseException
- failed to search
-
persistentSearch
public netscape.ldap.LDAPSearchResults persistentSearch(String base, String filter, String[] attrs) throws EBaseException Sets persistent search to retrieve modified certificate records.- Parameters:
base
- starting point of the searchfilter
- search filterattrs
- selected attributes- Returns:
- LDAP search results
- Throws:
EBaseException
- failed to search
-
createVirtualList
@Deprecated(since="11.6.0", forRemoval=true) public <T extends IDBObj> DBVirtualList<T> createVirtualList(String base, String filter, String[] attrs) throws EBaseException Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
Retrieves a list of objects.- Parameters:
base
- starting point of the searchfilter
- search filterattrs
- selected attributes- Returns:
- search results in virtual list
- Throws:
EBaseException
- failed to search
-
createVirtualList
@Deprecated(since="11.6.0", forRemoval=true) public <T extends IDBObj> DBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String sortKey, int pageSize) throws EBaseException Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
Retrieves a list of objects.- 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
@Deprecated(since="11.6.0", forRemoval=true) public <T extends IDBObj> DBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String[] sortKeys, int pageSize) throws EBaseException Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
Retrieves a list of objects.- Parameters:
base
- starting point of the searchfilter
- search filterattrs
- selected attributessortKeys
- keys used to sort the listpageSize
- page size in the virtual list- Returns:
- search results in virtual list
- Throws:
EBaseException
- failed to search
-
createVirtualList
@Deprecated(since="11.6.0", forRemoval=true) public <T extends IDBObj> DBVirtualList<T> createVirtualList(String base, String filter, String[] attrs, String startFrom, String sortKey, int pageSize) throws EBaseException Deprecated, for removal: This API element is subject to removal in a future version.As of release 11.6.0, replaced by<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)
Retrieves a list of objects.- 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
-
createPagedSearch
public <T extends IDBObj> DBPagedSearch<T> createPagedSearch(Class<T> classResults, String base, String filter, String[] attrs, String sortKey) throws EBaseException Retrieves a paged search of objects.- Parameters:
classResults
- the class representing the entries in the paged listbase
- starting point of the searchfilter
- search filterattrs
- selected attributessortKey
- key used to sort the list- Returns:
- search results in virtual list
- Throws:
EBaseException
- failed to search
-
createPagedSearch
public <T extends IDBObj> DBPagedSearch<T> createPagedSearch(Class<T> classResults, String base, String filter, String[] attrs, String[] sortKeys) throws EBaseException Retrieves a paged search of objects.- Parameters:
classResults
- the class representing the entries in the paged listbase
- starting point of the searchfilter
- search filterattrs
- selected attributessortKeys
- keys used to sort the list- Returns:
- search results in virtual list
- Throws:
EBaseException
- failed to search
-
abandon
- Throws:
EBaseException
-
<T>createPagedSearch(java.lang.Class<T>,java.lang.String,java.lang.String,java.lang.String[],java.lang.String)