8#ifndef BOTAN_TLS_SQL_SESSION_MANAGER_H_
9#define BOTAN_TLS_SQL_SESSION_MANAGER_H_
11#include <botan/database.h>
12#include <botan/tls_session_manager.h>
40 std::string_view passphrase,
41 const std::shared_ptr<RandomNumberGenerator>& rng,
42 size_t max_sessions = 1000);
57 std::optional<Session> retrieve_one(
const Session_Handle& handle)
override;
58 std::vector<Session_with_Handle> find_some(
const Server_Information& info,
size_t max_sessions_hint)
override;
75 enum Schema_Revision {
78 PRE_BOTAN_3_0 = 20120609,
82 void create_or_migrate_and_open(std::string_view passphrase);
83 Schema_Revision detect_schema_revision();
84 void create_with_latest_schema(std::string_view passphrase, Schema_Revision rev);
85 void initialize_existing_database(std::string_view passphrase);
87 void prune_session_cache();
90 std::shared_ptr<SQL_Database> m_db;
92 size_t m_max_sessions;
#define BOTAN_PUBLIC_API(maj, min)
Helper class to embody a session handle in all protocol versions.
bool emits_session_tickets() override
Session_Manager_SQL(std::shared_ptr< SQL_Database > db, std::string_view passphrase, const std::shared_ptr< RandomNumberGenerator > &rng, size_t max_sessions=1000)
void store(const Session &session, const Session_Handle &handle) override
Save a Session under a Session_Handle (TLS Client)
size_t remove(const Session_Handle &handle) override
~Session_Manager_SQL() override=default
virtual bool database_is_threadsafe() const
size_t remove_all() override
Session_Manager_SQL & operator=(const Session_Manager_SQL &)=delete
Session_Manager_SQL(const Session_Manager_SQL &)=delete
Session_Manager_SQL(Session_Manager_SQL &&)=delete
Session_Manager_SQL & operator=(Session_Manager_SQL &&)=delete
BOTAN_FUTURE_EXPLICIT Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)