MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
mrs::http::SessionManager Class Reference

#include <session_manager.h>

Classes

class  Configuration
 
class  Session
 

Public Types

enum  Allocation { OnlyExisting = 0 , CreateWhenNotExisting = 1 }
 
using AuthUser = mrs::database::entry::AuthUser
 
using SessionId = std::string
 
using system_clock = std::chrono::system_clock
 
using AuthorizationHandlerId = mrs::database::entry::UniversalId
 
using minutes = std::chrono::minutes
 
using SessionPtr = std::shared_ptr< Session >
 

Public Member Functions

 SessionManager ()
 
void configure (const Configuration &config)
 
SessionPtr get_session_secondary_id (const SessionId &id)
 
SessionPtr get_session (const SessionId &id)
 
SessionPtr new_session (const AuthorizationHandlerId id, const std::string &holder_name)
 
SessionPtr new_session (const SessionId &session_id)
 
template<class Generator >
void set_unique_session_secondary_id (Session *session, const Generator &g)
 
void remove_session (const Session::SessionData *session_data)
 
bool remove_session (const SessionPtr &session)
 
bool remove_session (const SessionId session)
 
void remove_timeouted ()
 

Private Member Functions

bool remove_session_impl (const Session *session)
 
SessionPtr get_session_impl (const SessionId &id)
 
SessionPtr get_session_handler_specific_id_impl (const SessionId &id)
 
SessionId generate_session_id_impl ()
 
void remove_timeouted_impl ()
 
void remove_inactive_impl (const system_clock::time_point &now)
 
void remove_expired_impl (const system_clock::time_point &now)
 

Private Attributes

std::vector< SessionPtrsessions_
 
std::mutex mutex_
 
system_clock::time_point oldest_inactive_session_
 
system_clock::time_point oldest_session_
 
Configuration config_
 

Member Typedef Documentation

◆ AuthorizationHandlerId

◆ AuthUser

◆ minutes

using mrs::http::SessionManager::minutes = std::chrono::minutes

◆ SessionId

◆ SessionPtr

◆ system_clock

using mrs::http::SessionManager::system_clock = std::chrono::system_clock

Member Enumeration Documentation

◆ Allocation

Enumerator
OnlyExisting 
CreateWhenNotExisting 

Constructor & Destructor Documentation

◆ SessionManager()

mrs::http::SessionManager::SessionManager ( )

Member Function Documentation

◆ configure()

void mrs::http::SessionManager::configure ( const Configuration config)

◆ generate_session_id_impl()

std::string mrs::http::SessionManager::generate_session_id_impl ( )
private

◆ get_session()

SessionPtr mrs::http::SessionManager::get_session ( const SessionId id)

◆ get_session_handler_specific_id_impl()

SessionPtr mrs::http::SessionManager::get_session_handler_specific_id_impl ( const SessionId id)
private

◆ get_session_impl()

SessionPtr mrs::http::SessionManager::get_session_impl ( const SessionId id)
private

◆ get_session_secondary_id()

SessionPtr mrs::http::SessionManager::get_session_secondary_id ( const SessionId id)

◆ new_session() [1/2]

SessionPtr mrs::http::SessionManager::new_session ( const AuthorizationHandlerId  id,
const std::string &  holder_name 
)

◆ new_session() [2/2]

SessionPtr mrs::http::SessionManager::new_session ( const SessionId session_id)

◆ remove_expired_impl()

void mrs::http::SessionManager::remove_expired_impl ( const system_clock::time_point &  now)
private

◆ remove_inactive_impl()

void mrs::http::SessionManager::remove_inactive_impl ( const system_clock::time_point &  now)
private

◆ remove_session() [1/3]

void mrs::http::SessionManager::remove_session ( const Session::SessionData session_data)

◆ remove_session() [2/3]

bool mrs::http::SessionManager::remove_session ( const SessionId  session)

◆ remove_session() [3/3]

bool mrs::http::SessionManager::remove_session ( const SessionPtr session)

◆ remove_session_impl()

bool mrs::http::SessionManager::remove_session_impl ( const Session session)
private

◆ remove_timeouted()

void mrs::http::SessionManager::remove_timeouted ( )

◆ remove_timeouted_impl()

void mrs::http::SessionManager::remove_timeouted_impl ( )
private

◆ set_unique_session_secondary_id()

template<class Generator >
void mrs::http::SessionManager::set_unique_session_secondary_id ( Session session,
const Generator &  g 
)
inline

Member Data Documentation

◆ config_

Configuration mrs::http::SessionManager::config_
private

◆ mutex_

std::mutex mrs::http::SessionManager::mutex_
private

◆ oldest_inactive_session_

system_clock::time_point mrs::http::SessionManager::oldest_inactive_session_
private

◆ oldest_session_

system_clock::time_point mrs::http::SessionManager::oldest_session_
private

◆ sessions_

std::vector<SessionPtr> mrs::http::SessionManager::sessions_
private

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