Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::ChannelHandlerInterface Class Referenceabstract

A Channel handler is used to make the link between JamiAccount and ConnectionManager Its role is to manage channels for a protocol (git/sip/etc) More...

#include <channel_handler.h>

Inheritance diagram for jami::ChannelHandlerInterface:
Inheritance graph
Collaboration diagram for jami::ChannelHandlerInterface:
Collaboration graph

Public Member Functions

virtual void connect (const DeviceId &deviceId, const std::string &name, ConnectCb &&cb, const std::string &connectionType="", bool forceNewConnection=false)=0
 Ask for a new channel.
 
virtual void connect (const dht::InfoHash &, const std::string &, ConnectCallbackLegacy &&)
 
virtual void onReady (const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name, std::shared_ptr< dhtnet::ChannelSocket > channel)=0
 Called when ConnectionManager has a new channel ready.
 
virtual bool onRequest (const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name)=0
 Determine if we accept or not the request.
 
virtual ~ChannelHandlerInterface ()
 

Detailed Description

A Channel handler is used to make the link between JamiAccount and ConnectionManager Its role is to manage channels for a protocol (git/sip/etc)

Definition at line 36 of file channel_handler.h.

Constructor & Destructor Documentation

◆ ~ChannelHandlerInterface()

virtual jami::ChannelHandlerInterface::~ChannelHandlerInterface ( )
inlinevirtual

Definition at line 39 of file channel_handler.h.

Member Function Documentation

◆ connect() [1/2]

virtual void jami::ChannelHandlerInterface::connect ( const DeviceId deviceId,
const std::string &  name,
ConnectCb &&  cb,
const std::string &  connectionType = "",
bool  forceNewConnection = false 
)
pure virtual

Ask for a new channel.

Parameters
deviceIdThe device to connect
nameThe name of the channel
cbThe callback to call when connected (can be immediate if already connected)
connectionTypeThe connection type used by iOS notifications (not used)
forceNewConnectionIf we want a new SIP connection (not used)

Implemented in jami::MessageChannelHandler, jami::SyncChannelHandler, jami::TransferChannelHandler, jami::AuthChannelHandler, and jami::ConversationChannelHandler.

◆ connect() [2/2]

virtual void jami::ChannelHandlerInterface::connect ( const dht::InfoHash &  ,
const std::string &  ,
ConnectCallbackLegacy &&   
)
inlinevirtual

Reimplemented in jami::AuthChannelHandler.

Definition at line 56 of file channel_handler.h.

◆ onReady()

virtual void jami::ChannelHandlerInterface::onReady ( const std::shared_ptr< dht::crypto::Certificate > &  peer,
const std::string &  name,
std::shared_ptr< dhtnet::ChannelSocket >  channel 
)
pure virtual

Called when ConnectionManager has a new channel ready.

Parameters
peerConnected peer
nameThe name of the channel
channelChannel to handle

Implemented in jami::AuthChannelHandler, jami::ConversationChannelHandler, jami::MessageChannelHandler, jami::SwarmChannelHandler, jami::SyncChannelHandler, and jami::TransferChannelHandler.

◆ onRequest()

virtual bool jami::ChannelHandlerInterface::onRequest ( const std::shared_ptr< dht::crypto::Certificate > &  peer,
const std::string &  name 
)
pure virtual

Determine if we accept or not the request.

Called when ConnectionManager receives a request

Parameters
peerPeer who asked
nameThe name of the channel
Returns
if we accept or not

Implemented in jami::AuthChannelHandler, jami::ConversationChannelHandler, jami::MessageChannelHandler, jami::SwarmChannelHandler, jami::SyncChannelHandler, and jami::TransferChannelHandler.


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