20#ifndef ORES_COMMS_SERVICE_SESSION_DATA_HPP
21#define ORES_COMMS_SERVICE_SESSION_DATA_HPP
27#include <boost/uuid/uuid.hpp>
28#include <boost/asio/ip/address.hpp>
67 boost::uuids::uuid
id;
84 std::optional<std::chrono::system_clock::time_point>
end_time;
150 [[nodiscard]] std::optional<std::chrono::seconds>
duration()
const {
154 return std::chrono::duration_cast<std::chrono::seconds>(
Main server application for ORE Studio.
Definition application.hpp:30
session_protocol
Protocol used for the session connection.
Definition session_data.hpp:35
@ http
HTTP/REST API with JWT authentication.
@ binary
ORE Studio binary protocol over TCP.
Session data owned by ores.comms for protocol-level session tracking.
Definition session_data.hpp:63
std::optional< std::chrono::seconds > duration() const
Calculates the session duration.
Definition session_data.hpp:150
std::optional< std::chrono::system_clock::time_point > end_time
Timestamp when the session ended (logout or disconnect).
Definition session_data.hpp:84
std::string client_identifier
Client identifier string from handshake.
Definition session_data.hpp:96
std::uint16_t client_version_major
Client protocol version major number.
Definition session_data.hpp:101
std::uint64_t bytes_sent
Total bytes sent to the client during this session.
Definition session_data.hpp:111
boost::asio::ip::address client_ip
Client IP address.
Definition session_data.hpp:89
boost::uuids::uuid account_id
Foreign key referencing the associated account.
Definition session_data.hpp:72
session_protocol protocol
Protocol used for this session (binary or HTTP).
Definition session_data.hpp:128
std::uint16_t client_version_minor
Client protocol version minor number.
Definition session_data.hpp:106
std::string username
Username of the account that owns this session.
Definition session_data.hpp:136
std::uint64_t bytes_received
Total bytes received from the client during this session.
Definition session_data.hpp:116
boost::uuids::uuid id
Unique identifier for this session.
Definition session_data.hpp:67
std::chrono::system_clock::time_point start_time
Timestamp when the session started (login time).
Definition session_data.hpp:77
std::string country_code
ISO 3166-1 alpha-2 country code from geolocation.
Definition session_data.hpp:123
bool is_active() const
Checks if the session is still active.
Definition session_data.hpp:141