Class SessionManagerDB


  • public final class SessionManagerDB
    extends Object
    Data base connection.
    • Constructor Detail

      • SessionManagerDB

        public SessionManagerDB​(SQLiteDataSource dataSource)
        Constructor.
    • Method Detail

      • createTables

        public void createTables()
        Create tables of MDS.
      • dropTables

        public void dropTables()
        Delete the tables of MDS. Just the other way around of createTables --much simpler.
      • store

        public void store​(Session infoSession)
        Store into database
        Parameters:
        infoSession - Object to store
      • getSessionByID

        public Session getSessionByID​(SessionID sessionID)
        Get session info by ID
        Parameters:
        sessionID - ID of the session
        Returns:
        The info of the session. Null if it is not registered.
      • getSessionsOfAccount

        public List<Session> getSessionsOfAccount​(AccountID accountID)
        Get Sessions of account
        Parameters:
        accountID - AccountID ID
        Returns:
        The Sessions
      • deleteSession

        public void deleteSession​(SessionID sessionID)
        Delete accessedImplementation
        Parameters:
        sessionID - ID of object to delete
      • close

        public void close()
        Close DB.
      • existsObjectByID

        public boolean existsObjectByID​(SessionID sessionID)
        Check if session exists
        Parameters:
        sessionID - session iD
        Returns:
        TRUE if exists.
      • storeExt

        public void storeExt​(Session infoSession)
        Store external session.
        Parameters:
        infoSession - info of the external session to be stored
      • getExtSession

        public Session getExtSession​(DataClayInstanceID extDataClayID)
        Get info about an external session
        Parameters:
        extDataClayID - id of the external dataClay instance
        Returns:
        session info. null if there is no session for the given dataClay instance.