Class DBSSession

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    LDAPSession

    public class DBSSession
    extends java.lang.Object
    implements java.lang.AutoCloseable
    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 
      Constructor Description
      DBSSession()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abandon​(netscape.ldap.LDAPSearchResults results)  
      void add​(java.lang.String name, IDBObj obj)
      Adds object to backend database.
      void close()
      Closes this session.
      <T extends IDBObj>
      IDBVirtualList<T>
      createVirtualList​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs)
      Retrieves a list of objects.
      <T extends IDBObj>
      IDBVirtualList<T>
      createVirtualList​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs, java.lang.String[] sortKeys, int pageSize)
      Retrieves a list of objects.
      <T extends IDBObj>
      IDBVirtualList<T>
      createVirtualList​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs, java.lang.String sortKey, int pageSize)
      Retrieves a list of objects.
      <T extends IDBObj>
      IDBVirtualList<T>
      createVirtualList​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs, java.lang.String startFrom, java.lang.String sortKey, int pageSize)
      Retrieves a list of objects.
      void delete​(java.lang.String name)
      Deletes object from database.
      void modify​(java.lang.String name, ModificationSet mods)
      Modify an object in the database.
      netscape.ldap.LDAPSearchResults persistentSearch​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs)
      Sets persistent search to retrieve modified certificate records.
      IDBObj read​(java.lang.String name)
      Reads an object from the database.
      IDBObj read​(java.lang.String name, java.lang.String[] attrs)
      Reads an object from the database, and only populates the selected attributes.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter)
      Searchs for a list of objects that match the filter.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter, int maxSize)
      Searchs for a list of objects that match the filter.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter, int maxSize, int timeLimit)
      Searchs for a list of objects that match the filter.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter, int maxSize, int timeLimit, java.lang.String sortAttribute)
      Searchs for a list of objects that match the filter.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter, int maxSize, java.lang.String sortAttribute)
      Searchs for a list of objects that match the filter.
      IDBSearchResults search​(java.lang.String base, java.lang.String filter, java.lang.String[] attrs)
      Retrieves a list of object that satifies the given filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DBSSession

        public DBSSession()
    • Method Detail

      • close

        public void close()
                   throws EDBException
        Closes this session.
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        EDBException - failed to close session
      • add

        public void add​(java.lang.String name,
                        IDBObj obj)
                 throws EBaseException
        Adds object to backend database. For example,
         session.add("cn=123459,o=certificate repository,o=airius.com", record);
         
        Parameters:
        name - name of the object
        obj - object to be added
        Throws:
        EDBException - failed to add object
        EBaseException
      • read

        public IDBObj read​(java.lang.String name)
                    throws EBaseException
        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

        public IDBObj read​(java.lang.String name,
                           java.lang.String[] attrs)
                    throws EBaseException
        Reads an object from the database, and only populates the selected attributes.
        Parameters:
        name - name of the object that is to be read
        attrs - selected attributes
        Returns:
        database object
        Throws:
        EBaseException - failed to read object
      • delete

        public void delete​(java.lang.String name)
                    throws EBaseException
        Deletes object from database.
        Parameters:
        name - name of the object that is to be deleted
        Throws:
        EBaseException - failed to delete object
      • modify

        public void modify​(java.lang.String name,
                           ModificationSet mods)
                    throws EBaseException
        Modify an object in the database.
        Parameters:
        name - name of the object that is to be modified
        mods - modifications
        Throws:
        EBaseException - failed to modify
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter)
                                throws EBaseException
        Searchs for a list of objects that match the filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter,
                                       int maxSize)
                                throws EBaseException
        Searchs for a list of objects that match the filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        maxSize - max number of entries
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter,
                                       int maxSize,
                                       int timeLimit)
                                throws EBaseException
        Searchs for a list of objects that match the filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        maxSize - max number of entries
        timeLimit - timeout limit
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter,
                                       int maxSize,
                                       java.lang.String sortAttribute)
                                throws EBaseException
        Searchs for a list of objects that match the filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        maxSize - max number of entries
        sortAttribute - Field to sort the records on
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter,
                                       int maxSize,
                                       int timeLimit,
                                       java.lang.String sortAttribute)
                                throws EBaseException
        Searchs for a list of objects that match the filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        maxSize - max number of entries
        timeLimit - timeout limit
        sortAttribute - Field to sort the records on
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • search

        public IDBSearchResults search​(java.lang.String base,
                                       java.lang.String filter,
                                       java.lang.String[] attrs)
                                throws EBaseException
        Retrieves a list of object that satifies the given filter.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        Returns:
        search results
        Throws:
        EBaseException - failed to search
      • persistentSearch

        public netscape.ldap.LDAPSearchResults persistentSearch​(java.lang.String base,
                                                                java.lang.String filter,
                                                                java.lang.String[] attrs)
                                                         throws EBaseException
        Sets persistent search to retrieve modified certificate records.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        Returns:
        LDAP search results
        Throws:
        EBaseException - failed to search
      • createVirtualList

        public <T extends IDBObjIDBVirtualList<T> createVirtualList​(java.lang.String base,
                                                                      java.lang.String filter,
                                                                      java.lang.String[] attrs)
                                                               throws EBaseException
        Retrieves a list of objects.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        Returns:
        search results in virtual list
        Throws:
        EBaseException - failed to search
      • createVirtualList

        public <T extends IDBObjIDBVirtualList<T> createVirtualList​(java.lang.String base,
                                                                      java.lang.String filter,
                                                                      java.lang.String[] attrs,
                                                                      java.lang.String sortKey,
                                                                      int pageSize)
                                                               throws EBaseException
        Retrieves a list of objects.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        sortKey - key used to sort the list
        pageSize - page size in the virtual list
        Returns:
        search results in virtual list
        Throws:
        EBaseException - failed to search
      • createVirtualList

        public <T extends IDBObjIDBVirtualList<T> createVirtualList​(java.lang.String base,
                                                                      java.lang.String filter,
                                                                      java.lang.String[] attrs,
                                                                      java.lang.String[] sortKeys,
                                                                      int pageSize)
                                                               throws EBaseException
        Retrieves a list of objects.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        sortKeys - keys used to sort the list
        pageSize - page size in the virtual list
        Returns:
        search results in virtual list
        Throws:
        EBaseException - failed to search
      • createVirtualList

        public <T extends IDBObjIDBVirtualList<T> createVirtualList​(java.lang.String base,
                                                                      java.lang.String filter,
                                                                      java.lang.String[] attrs,
                                                                      java.lang.String startFrom,
                                                                      java.lang.String sortKey,
                                                                      int pageSize)
                                                               throws EBaseException
        Retrieves a list of objects.
        Parameters:
        base - starting point of the search
        filter - search filter
        attrs - selected attributes
        startFrom - starting point
        sortKey - key used to sort the list
        pageSize - page size in the virtual list
        Returns:
        search results in virtual list
        Throws:
        EBaseException - failed to search