2 * @file sslid_session_data_processor.h
3 * @brief sslid session data processor header file.
5 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6 * Copyright (C) 2009 NTT COMWARE Corporation.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 **********************************************************************/
25 #ifndef SSLID_SESSION_DATA_PROCESSOR_H
26 #define SSLID_SESSION_DATA_PROCESSOR_H
28 #include "sslid_replication_data_processor.h"
29 #include "logger_enum.h"
30 #include <boost/asio.hpp>
36 class sslid_session_data_processor
39 //! loglevel get function object type
40 typedef boost::function< LOG_LEVEL_TAG(void) >
41 getloglevel_func_type;
42 //! log output function object type
43 typedef boost::function< void (const unsigned int, const std::string&, const char*, int) >
47 sslid_session_data_processor(
50 sslid_replication_data_processor* replication_data_processor,
51 getloglevel_func_type ingetloglevel,
52 logger_func_type inputLogFatal,
53 logger_func_type inputLogError,
54 logger_func_type inputLogWarn,
55 logger_func_type inputLogInfo,
56 logger_func_type inputLogDebug);
58 virtual ~sslid_session_data_processor();
60 int get_endpoint_from_session_data(
61 const std::string& session_id,
62 boost::asio::ip::tcp::endpoint& endpoint);
64 int write_session_data(
65 const std::string& session_id,
66 const boost::asio::ip::tcp::endpoint& endpoint,
69 int read_session_data_from_replication_area(sslid_replication_data* replication_area);
72 int clear_expired_session_data();
77 std::map<std::string, boost::asio::ip::tcp::endpoint> session_endpoint_map;
78 std::map<std::string, time_t> session_lasttime_map;
79 std::multimap<time_t, std::string> lasttime_session_map;
80 boost::mutex session_map_mutex;
81 sslid_replication_data_processor* replication_data_processor;
82 getloglevel_func_type getloglevel; //!< get loglevel function object
83 logger_func_type putLogFatal; //!< fatal log output function object
84 logger_func_type putLogError; //!< error log output function object
85 logger_func_type putLogWarn; //!< warn log output function object
86 logger_func_type putLogInfo; //!< info log output function object
87 logger_func_type putLogDebug; //!< debug log output function object
92 #endif // SSLID_SESSION_DATA_PROCESSOR_H