DUNE: Uniform Navigational Environment  2019.02.0
Transports::HTTP::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onResourceAcquisition (void)
 
void onResourceRelease (void)
 
void onEntityResolution (void)
 
void consume (const IMC::Message *msg)
 
void consume (const IMC::LogBookEntry *msg)
 
void handleGET (TCPSocket *sock, TupleList &headers, const char *uri)
 
void handlePOST (TCPSocket *sock, TupleList &headers, const char *uri)
 
void handlePUT (TCPSocket *sock, TupleList &headers, const char *uri)
 
void sendStaticFile (TCPSocket *sock, TupleList &headers, const Path &file)
 
void getMessage (TCPSocket *sock, TupleList &headers, const char *uri)
 
void setTime (TCPSocket *sock, TupleList &headers, const char *uri)
 
void showMessages (TCPSocket *sock, TupleList &headers, const char *uri)
 
void showLogBook (TCPSocket *sock, TupleList &headers, const char *uri)
 
void sendVersionJSON (TCPSocket *sock, TupleList &headers, const char *uri)
 
void sendAgentJSON (TCPSocket *sock, TupleList &headers, const char *uri)
 
void handlePowerChannel (TCPSocket *sock, TupleList &headers, const char *uri)
 
void onMain (void)
 
- Public Member Functions inherited from Transports::HTTP::RequestHandler
 RequestHandler (void)
 
virtual ~RequestHandler (void)
 
virtual void handleGET (TCPSocket *sock, Utils::TupleList &headers, const char *uri)
 
virtual void handlePOST (TCPSocket *sock, Utils::TupleList &headers, const char *uri)
 
virtual void handlePUT (TCPSocket *sock, Utils::TupleList &headers, const char *uri)
 
void sendHeader (TCPSocket *sock, const char *status_line, int64_t length, HeaderFieldsMap *hdr_fields=0)
 
void sendResponse100 (TCPSocket *sock)
 
void sendResponse201 (TCPSocket *sock)
 
void sendResponse200 (TCPSocket *sock)
 
void sendResponse403 (TCPSocket *sock)
 
void sendResponse404 (TCPSocket *sock, const std::string &message)
 
void sendResponse404 (TCPSocket *sock)
 
void sendResponse416 (TCPSocket *sock)
 
void sendResponse500 (TCPSocket *sock)
 
void sendResponse503 (TCPSocket *sock)
 
void sendData (TCPSocket *sock, const char *data, int size, HeaderFieldsMap *hdr_fields=0)
 
void sendData (TCPSocket *sock, const std::string &data, HeaderFieldsMap *hdr_fields=0)
 
void sendFile (TCPSocket *sock, const std::string &file, HeaderFieldsMap &hdr_fields, int64_t off_beg=-1, int64_t off_end=-1)
 
void handleRequest (TCPSocket *sock)
 

Static Public Member Functions

static bool isSpecialURI (const char *uri)
 
static bool matchURL (const char *url, const char *str, bool fragment=false)
 

Public Attributes

Serverm_server
 
std::string m_cfg_dir
 
std::string m_agent
 
MessageMonitor m_msg_mon
 
Arguments m_args
 

Additional Inherited Members

- Public Types inherited from Transports::HTTP::RequestHandler
typedef std::map< std::string,
std::string > 
HeaderFieldsMap
 

Constructor & Destructor Documentation

Transports::HTTP::Task::Task ( const std::string &  name,
Tasks::Context &  ctx 
)
inline

Member Function Documentation

void Transports::HTTP::Task::consume ( const IMC::Message *  msg)
inline
void Transports::HTTP::Task::consume ( const IMC::LogBookEntry *  msg)
inline
void Transports::HTTP::Task::getMessage ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::handleGET ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::handlePOST ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::handlePowerChannel ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::handlePUT ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
static bool Transports::HTTP::Task::isSpecialURI ( const char *  uri)
inlinestatic

Referenced by handleGET(), handlePOST(), and handlePUT().

static bool Transports::HTTP::Task::matchURL ( const char *  url,
const char *  str,
bool  fragment = false 
)
inlinestatic

Referenced by handleGET(), and handlePOST().

void Transports::HTTP::Task::onEntityResolution ( void  )
inline
void Transports::HTTP::Task::onMain ( void  )
inline
void Transports::HTTP::Task::onResourceAcquisition ( void  )
inline
void Transports::HTTP::Task::onResourceRelease ( void  )
inline

References m_server.

void Transports::HTTP::Task::sendAgentJSON ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::sendStaticFile ( TCPSocket *  sock,
TupleList &  headers,
const Path &  file 
)
inline
void Transports::HTTP::Task::sendVersionJSON ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::setTime ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::showLogBook ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline
void Transports::HTTP::Task::showMessages ( TCPSocket *  sock,
TupleList &  headers,
const char *  uri 
)
inline

Member Data Documentation

std::string Transports::HTTP::Task::m_agent

Agent name.

Referenced by sendAgentJSON(), and Task().

Arguments Transports::HTTP::Task::m_args

Task arguments.

Referenced by onResourceAcquisition(), and Task().

std::string Transports::HTTP::Task::m_cfg_dir

Configuration directory.

Referenced by Task().

MessageMonitor Transports::HTTP::Task::m_msg_mon

Message Monitor.

Referenced by consume(), onEntityResolution(), showLogBook(), and showMessages().

Server* Transports::HTTP::Task::m_server
Collaboration diagram for Transports::HTTP::Task:
Collaboration graph