Package es.bsc.dataclay.logic.sessionmgr
Class SessionManagerDB
- java.lang.Object
-
- es.bsc.dataclay.logic.sessionmgr.SessionManagerDB
-
public final class SessionManagerDB extends Object
Data base connection.
-
-
Constructor Summary
Constructors Constructor Description SessionManagerDB(SQLiteDataSource dataSource)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close DB.void
createTables()
Create tables of MDS.void
deleteExtSession(DataClayInstanceID dataClayID)
void
deleteSession(SessionID sessionID)
Delete accessedImplementationvoid
dropTables()
Delete the tables of MDS.boolean
existsObjectByID(SessionID sessionID)
Check if session existsSession
getExtSession(DataClayInstanceID extDataClayID)
Get info about an external sessionSession
getSessionByID(SessionID sessionID)
Get session info by IDList<Session>
getSessionsOfAccount(AccountID accountID)
Get Sessions of accountvoid
store(Session infoSession)
Store into databasevoid
storeExt(Session infoSession)
Store external session.
-
-
-
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.
-
deleteExtSession
public void deleteExtSession(DataClayInstanceID dataClayID)
-
-