5 #ifndef __XMPP_CHANNEL_H__
6 #define __XMPP_CHANNEL_H__
8 #include <boost/asio/ip/tcp.hpp>
9 #include <boost/scoped_ptr.hpp>
10 #include <tbb/atomic.h>
11 #include <tbb/spin_mutex.h>
21 class ShowXmppConnection;
39 tbb::atomic<uint32_t>
open;
69 virtual boost::asio::ip::tcp::endpoint
endpoint()
const;
81 bool Send(
const uint8_t *data,
size_t size,
82 const std::string *msg_str = NULL);
96 const boost::system::error_code& error);
110 void SetTo(
const std::string &);
204 void LogMsg(std::string msg);
248 std::string error_message);
273 boost::scoped_ptr<XmppChannelMux>
mux_;
311 void FillShowInfo(ShowXmppConnection *show_connection)
const;
virtual ~XmppClientConnection()
virtual void set_close_reason(const std::string &reason)
virtual void ManagedDelete()
virtual void increment_flap_count()
virtual const std::string last_flap_at() const
boost::scoped_ptr< DeleteActor > deleter_
virtual LifetimeManager * lifetime_manager()
virtual LifetimeActor * deleter()
LifetimeRef< XmppClientConnection > server_delete_ref_
XmppClientConnection(XmppClient *server, const XmppChannelConfig *config)
std::string close_reason_
virtual uint32_t flap_count() const
virtual void RetryDelete()
void set_connection(XmppConnection *connection)
XmppConnectionEndpoint(const std::string &client)
void increment_flap_count()
void set_close_reason(const std::string &close_reason)
uint32_t flap_count() const
XmppConnection * connection()
XmppConnection * connection_
uint64_t last_flap() const
std::string close_reason_
const std::string last_flap_at() const
boost::asio::ip::tcp::endpoint local_endpoint_
virtual void increment_flap_count()=0
void set_disable_read(bool disable_read)
virtual LifetimeActor * deleter()=0
bool KeepAliveTimerExpired()
uint32_t tx_update() const
uint32_t rx_keepalive() const
const Timer * keepalive_timer() const
bool Send(const uint8_t *data, size_t size, const std::string *msg_str=NULL)
const XmppSession * session() const
std::string & GetControllerHostName()
std::string LastEvent() const
tbb::spin_mutex spin_mutex_
void StopKeepAliveTimer()
std::string local_endpoint_string() const
int GetTaskInstance() const
std::string GetXmppAuthenticationType() const
std::string & GetComputeHostName()
boost::asio::ip::tcp::endpoint & endpoint()
bool IsActiveChannel() const
XmppChannelMux * ChannelMux()
int GetConfiguredHoldTime() const
const XmppChannelMux * channel_mux() const
virtual bool SendStreamFeatureRequest(XmppSession *session)
bool disable_read() const
int ProcessXmppIqMessage(const XmppStanza::XmppMessage *)
static const char * kAuthTypeNil
size_t get_connect_error()
XmppSession * CreateSession()
void inc_handshake_failure()
void SwapContents(XmppConnection *other)
size_t get_sm_connect_attempts()
virtual boost::asio::ip::tcp::endpoint local_endpoint() const
virtual void ReceiveMsg(XmppSession *session, const std::string &)
virtual ~XmppConnection()
virtual bool SendOpen(XmppSession *session)
virtual void ManagedDelete()=0
xmsm::XmOpenConfirmState GetStateMcOpenConfirmState() const
virtual bool SendStartTls(XmppSession *session)
virtual LifetimeManager * lifetime_manager()=0
virtual boost::asio::ip::tcp::endpoint endpoint() const
void UpdateKeepAliveTimer(uint8_t time_out)
void KeepaliveTimerErrorHanlder(std::string error_name, std::string error_message)
virtual bool SendProceedTls(XmppSession *session)
friend class XmppStateMachineTest
std::string StateName() const
void SetAdminDown(bool toggle)
XmppConnection(TcpServer *server, const XmppChannelConfig *config)
int ProcessXmppChatMessage(const XmppStanza::XmppChatMessage *)
std::string LastStateName() const
void SetConfig(const XmppChannelConfig *)
const std::string & FromString() const
XmppStanza::XmppMessage * XmppDecode(const std::string &msg)
void set_state_machine(XmppStateMachine *state_machine)
boost::scoped_ptr< XmppStateMachine > state_machine_
virtual bool AcceptSession(XmppSession *session)
uint32_t tx_keepalive() const
void SetTo(const std::string &)
DISALLOW_COPY_AND_ASSIGN(XmppConnection)
uint32_t tx_close() const
void SwapXmppStateMachine(XmppConnection *other)
virtual const LifetimeActor * deleter() const =0
void StartKeepAliveTimer()
int SetDscpValue(uint8_t value)
int GetNegotiatedHoldTime() const
const XmppChannelConfig * config_
virtual void RetryDelete()=0
size_t get_stream_feature_fail()
std::unique_ptr< XmppStanza::XmppMessage > last_msg_
boost::scoped_ptr< XmppChannelMux > mux_
virtual uint32_t flap_count() const =0
void inc_stream_feature_fail()
size_t get_session_close()
size_t get_handshake_failure()
void IncProtoStats(unsigned int type)
void SendClose(XmppSession *session)
virtual void WriteReady()
XmppStateMachine * state_machine()
static const char * kAuthTypeTls
virtual bool SendOpenConfirm(XmppSession *session)
xmsm::XmState GetStateMcState() const
std::string endpoint_string() const
void LogMsg(std::string msg)
std::string LastStateChangeAt() const
void ProcessSslHandShakeResponse(SslSessionPtr session, const boost::system::error_code &error)
const std::string & ToString() const
void SetChannelMux(XmppChannelMux *channel_mux)
void set_session(XmppSession *session)
uint8_t dscp_value() const
uint32_t rx_update() const
boost::asio::ip::tcp::endpoint endpoint_
const std::string & ToUVEKey() const
uint32_t rx_close() const
virtual void set_close_reason(const std::string &reason)=0
size_t get_sm_keepalive_count()
void SetAdminState(bool down)
virtual const std::string last_flap_at() const =0
virtual void ManagedDelete()
virtual uint32_t flap_count() const
bool on_work_queue() const
XmppConnectionEndpoint * conn_endpoint()
XmppServerConnection(XmppServer *server, const XmppChannelConfig *config)
void clear_on_work_queue()
virtual void increment_flap_count()
virtual LifetimeManager * lifetime_manager()
virtual const std::string last_flap_at() const
boost::scoped_ptr< DeleteActor > deleter_
virtual LifetimeActor * deleter()
XmppConnectionEndpoint * conn_endpoint_
LifetimeRef< XmppServerConnection > server_delete_ref_
void set_conn_endpoint(XmppConnectionEndpoint *conn_endpoint)
virtual void RetryDelete()
virtual void set_close_reason(const std::string &reason)
void FillShowInfo(ShowXmppConnection *show_connection) const
virtual ~XmppServerConnection()
boost::intrusive_ptr< SslSession > SslSessionPtr
tbb::atomic< uint32_t > handshake_fail
tbb::atomic< uint32_t > connect_error
tbb::atomic< uint32_t > session_close
tbb::atomic< uint32_t > stream_feature_fail
tbb::atomic< uint32_t > open_fail
tbb::atomic< uint32_t > keepalive
tbb::atomic< uint32_t > open
tbb::atomic< uint32_t > close
tbb::atomic< uint32_t > update