TreeFrogFramework  2.8
Public Member Functions | List of all members
TSessionSqlObjectStore Class Reference

#include <tsessionsqlobjectstore.h>

Inheritance diagram for TSessionSqlObjectStore:
Inheritance graph
[legend]
Collaboration diagram for TSessionSqlObjectStore:
Collaboration graph
[legend]

Public Member Functions

QString key () const
 
TSession find (const QByteArray &id) override
 
bool store (TSession &session) override
 
bool remove (const QByteArray &id) override
 
int gc (const QDateTime &expire) override
 
- Public Member Functions inherited from TSessionStore
 TSessionStore ()
 
virtual ~TSessionStore ()
 

Additional Inherited Members

- Static Public Member Functions inherited from TSessionStore
static int64_t lifeTimeSecs ()
 

Detailed Description

The TSessionSqlObjectStore class stores HTTP sessions into database system using object-relational mapping tool.

Table schema: 'CREATE TABLE session (id VARCHAR(50) PRIMARY KEY, data TEXT, updated_at TIMESTAMP);'

See also
TSessionObject

Member Function Documentation

◆ find()

TSession TSessionSqlObjectStore::find ( const QByteArray &  id)
overridevirtual

Returns the session which has the ID id and is newer than or equal to the expiration datetime in the session store.

If the store contains no such session, the function returns a empty session. This function should be called from any reimplementations of find().

Implements TSessionStore.

◆ gc()

int TSessionSqlObjectStore::gc ( const QDateTime &  expire)
overridevirtual

Implements TSessionStore.

◆ key()

QString TSessionSqlObjectStore::key ( ) const
inline

◆ remove()

bool TSessionSqlObjectStore::remove ( const QByteArray &  id)
overridevirtual

Removes all sessions older than the expiration datetime.

Removes the session with the ID id.

This function should be called from any reimplementations of remove().

Implements TSessionStore.

◆ store()

bool TSessionSqlObjectStore::store ( TSession sesion)
overridevirtual

Stores the session in the session store.

This function should be called from any reimplementations of store().

Implements TSessionStore.


The documentation for this class was generated from the following files: