cumbia-http 1.x
Qt widgets on top of the cumbia C++ library
Public Types | Public Member Functions | List of all members
CumbiaHttp Class Reference

#include <cumbiahttp.h>

Inheritance diagram for CumbiaHttp:
Inheritance graph
[legend]

Public Types

enum  Type { CumbiaHTTPType = Cumbia::CumbiaUserType + 18 }
 

Public Member Functions

 CumbiaHttp (const QString &url, const QString &channel, CuThreadFactoryImplI *tfi, CuThreadsEventBridgeFactory_I *teb)
 CumbiaHttp. More...
 
 ~CumbiaHttp ()
 
void setTag (const QString &tag)
 
CuThreadFactoryImplI * getThreadFactoryImpl () const
 
CuThreadsEventBridgeFactory_I * getThreadEventsBridgeFactory () const
 
QString url () const
 
virtual int getType () const
 
void readEnqueue (const CuHTTPSrc &source, CuDataListener *l, const CuHTTPActionFactoryI &f)
 
void unsubscribeEnqueue (const CuHTTPSrc &httpsrc, CuDataListener *l)
 
void executeWrite (const CuHTTPSrc &source, CuDataListener *l, const CuHTTPActionFactoryI &f)
 
void unlinkListener (const CuHTTPSrc &source, const std::string &method, CuDataListener *l)
 disconnect the listener l of the given source More...
 
void addReplaceWildcardI (QuReplaceWildcards_I *rwi)
 add a QuReplaceWildcards_I instance More...
 
void addSrcHelper (CuHttpSrcHelper_I *srch)
 Add an implementation of CuHttpSrcHelper_I to help processing and preparing the sources before sending them through the http module. More...
 
QList< QuReplaceWildcards_I * > getReplaceWildcard_Ifaces () const
 
QList< CuHttpSrcHelper_I * > getSrcHelpers () const
 
void onSrcBundleReqReady (const QList< SrcItem > &rsrcs, const QList< SrcItem > &wsrcs)
 
void onSrcBundleReplyReady (const QByteArray &json)
 
void onSrcBundleReplyError (const CuData &errd)
 notify every listener of a http server/gateway general error More...
 
void onCredsReady (const QString &user, const QString &passwd)
 
void onAuthReply (bool authorised, const QString &user, const QString &message, bool encrypted)
 
void onAuthError (const QString &errm)
 
virtual void onSrcBundleReplyReady (const QByteArray &json)=0
 
virtual void onSrcBundleReplyError (const CuData &errd)=0
 
virtual void onIdReady (const unsigned long long &client_id, const time_t ttl)=0
 
virtual void onIdManError (const QString &err)=0
 
virtual void onSrcBundleReqReady (const QList< SrcItem > &rsrcs, const QList< SrcItem > &wsrcs)=0
 
virtual void onCredsReady (const QString &user, const QString &passwd)=0
 
virtual void onAuthReply (bool authorised, const QString &user, const QString &message, bool encrypted)=0
 
virtual void onAuthError (const QString &errm)=0
 

Member Enumeration Documentation

◆ Type

Enumerator
CumbiaHTTPType 

Constructor & Destructor Documentation

◆ CumbiaHttp()

CumbiaHttp::CumbiaHttp ( const QString &  url,
const QString &  channel,
CuThreadFactoryImplI *  tfi,
CuThreadsEventBridgeFactory_I *  teb 
)

CumbiaHttp.

Parameters
http_urlthe url to be used for http incoming data
http_urlthe http (https) url to be used to send requests to the server (output)
tfithread factory implementation
tebthread events bridge factory

TEST

References url().

◆ ~CumbiaHttp()

CumbiaHttp::~CumbiaHttp ( )

Member Function Documentation

◆ addReplaceWildcardI()

void CumbiaHttp::addReplaceWildcardI ( QuReplaceWildcards_I *  rwi)

add a QuReplaceWildcards_I instance

Note
Ownership is handed to CumbiaHttp and objects are deleted in ~CumbiaHttp

Referenced by CuHttpRegisterEngine::registerWithDefaults().

◆ addSrcHelper()

void CumbiaHttp::addSrcHelper ( CuHttpSrcHelper_I srch)

Add an implementation of CuHttpSrcHelper_I to help processing and preparing the sources before sending them through the http module.

Parameters
srcha pointer to a valid CuHttpSrcHelper_I instance.
Ownership
Ownership is handed to CumbiaHttp and CuHttpSrcHelper_I is deleted within the CumbiaHttp destructor.

Referenced by CuHttpRegisterEngine::registerWithDefaults().

◆ executeWrite()

void CumbiaHttp::executeWrite ( const CuHTTPSrc source,
CuDataListener *  l,
const CuHTTPActionFactoryI f 
)

◆ getReplaceWildcard_Ifaces()

QList< QuReplaceWildcards_I * > CumbiaHttp::getReplaceWildcard_Ifaces ( ) const

◆ getSrcHelpers()

QList< CuHttpSrcHelper_I * > CumbiaHttp::getSrcHelpers ( ) const

◆ getThreadEventsBridgeFactory()

CuThreadsEventBridgeFactory_I * CumbiaHttp::getThreadEventsBridgeFactory ( ) const

◆ getThreadFactoryImpl()

CuThreadFactoryImplI * CumbiaHttp::getThreadFactoryImpl ( ) const

◆ getType()

int CumbiaHttp::getType ( ) const
virtual

References CumbiaHTTPType.

◆ onAuthError()

void CumbiaHttp::onAuthError ( const QString &  errm)
virtual

Implements CuHttpAuthManListener.

◆ onAuthReply()

void CumbiaHttp::onAuthReply ( bool  authorised,
const QString &  user,
const QString &  message,
bool  encrypted 
)
virtual

◆ onCredsReady()

void CumbiaHttp::onCredsReady ( const QString &  user,
const QString &  passwd 
)
virtual

Implements CuHttpAuthManListener.

◆ onSrcBundleReplyError()

void CumbiaHttp::onSrcBundleReplyError ( const CuData &  errd)
virtual

notify every listener of a http server/gateway general error

Parameters
errddata provided by CuHttpBundledSrcReq::onError after getting an error from an http request

For each listener of a given source (or target), an error message is built and delivered. It will be made up of

  • the error from the http server
  • the "data" (web page) received by the web server
  • the portion of the original request for the listener, extracted from the whole request payload, which in principle contains a JSon array of requests bundled together.

Implements CuHttpBundledSrcReqListener.

References CumbiaHTTPWorld::request_reverse_eng().

◆ onSrcBundleReplyReady()

void CumbiaHttp::onSrcBundleReplyReady ( const QByteArray &  json)
virtual

◆ onSrcBundleReqReady()

void CumbiaHttp::onSrcBundleReqReady ( const QList< SrcItem > &  rsrcs,
const QList< SrcItem > &  wsrcs 
)
virtual

◆ readEnqueue()

void CumbiaHttp::readEnqueue ( const CuHTTPSrc source,
CuDataListener *  l,
const CuHTTPActionFactoryI f 
)

◆ setTag()

void CumbiaHttp::setTag ( const QString &  tag)

◆ unlinkListener()

void CumbiaHttp::unlinkListener ( const CuHTTPSrc source,
const std::string &  method,
CuDataListener *  l 
)

disconnect the listener l of the given source

Parameters
sourcethe full name of the source, as from CuHTTPSrc.prepare
lthe CuDataListener to disconnect
Note
Disconnect the listener both from a pending sync reply (onSrcBundleReplyReady) and the channel receiver
called by CuHttpControlsR

References CuHTTPSrc::getName().

◆ unsubscribeEnqueue()

void CumbiaHttp::unsubscribeEnqueue ( const CuHTTPSrc httpsrc,
CuDataListener *  l 
)

◆ url()

QString CumbiaHttp::url ( ) const

Referenced by CumbiaHttp().


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