Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ola::OladHTTPServer Class Reference
Inheritance diagram for ola::OladHTTPServer:
ola::http::OlaHTTPServer

Classes

struct  OladHTTPServerOptions
struct  port_identifier

Public Member Functions

 OladHTTPServer (ExportMap *export_map, const OladHTTPServerOptions &options, ola::io::ConnectedDescriptor *client_socket, class OlaServer *ola_server, const ola::network::Interface &interface)
bool Init ()
void SetPidStore (const ola::rdm::RootPidStore *pid_store)
int JsonServerStats (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int JsonUniversePluginList (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int JsonPluginInfo (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int JsonUniverseInfo (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int JsonAvailablePorts (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int CreateNewUniverse (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int ModifyUniverse (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int GetDmx (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int HandleSetDmx (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int DisplayQuit (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int ReloadPlugins (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
int ReloadPidStore (const ola::http::HTTPRequest *request, ola::http::HTTPResponse *response)
void HandlePluginList (ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaPlugin > &plugins)
void HandleUniverseList (ola::http::HTTPResponse *response, ola::web::JsonObject *json, const client::Result &result, const std::vector< client::OlaUniverse > &universes)
void HandlePartialPluginInfo (ola::http::HTTPResponse *response, int plugin_id, const client::Result &result, const std::string &description)
void HandlePluginInfo (ola::http::HTTPResponse *response, std::string description, const client::Result &result, const ola::client::PluginState &state)
void HandleUniverseInfo (ola::http::HTTPResponse *response, const client::Result &result, const client::OlaUniverse &universe)
void HandlePortsForUniverse (ola::http::HTTPResponse *response, ola::web::JsonObject *json, unsigned int universe_id, const client::Result &result, const std::vector< client::OlaDevice > &devices)
void HandleCandidatePorts (ola::http::HTTPResponse *response, const client::Result &result, const std::vector< client::OlaDevice > &devices)
void CreateUniverseComplete (ola::http::HTTPResponse *response, unsigned int universe_id, bool included_name, class ActionQueue *action_queue)
void SendCreateUniverseResponse (ola::http::HTTPResponse *response, unsigned int universe_id, bool included_name, class ActionQueue *action_queue)
void ModifyUniverseComplete (ola::http::HTTPResponse *response, class ActionQueue *action_queue)
void SendModifyUniverseResponse (ola::http::HTTPResponse *response, class ActionQueue *action_queue)
- Public Member Functions inherited from ola::http::OlaHTTPServer
 OlaHTTPServer (const HTTPServer::HTTPServerOptions &options, ola::ExportMap *export_map)
bool Start ()
void Stop ()

Static Public Member Functions

static int ServeHelpRedirect (ola::http::HTTPResponse *response)
static int ServeUsage (ola::http::HTTPResponse *response, const std::string &details)

Static Public Attributes

static const char HELP_PARAMETER [] = "help"

Additional Inherited Members

- Protected Member Functions inherited from ola::http::OlaHTTPServer
void RegisterFile (const std::string &file, const std::string &content_type)
- Protected Attributes inherited from ola::http::OlaHTTPServer
Clock m_clock
ola::ExportMapm_export_map
HTTPServer m_server
TimeStamp m_start_time

Constructor & Destructor Documentation

ola::OladHTTPServer::OladHTTPServer ( ExportMap export_map,
const OladHTTPServerOptions options,
ola::io::ConnectedDescriptor client_socket,
class OlaServer ola_server,
const ola::network::Interface interface 
)

Create a new OLA HTTP server

Parameters
export_mapthe ExportMap to display when /debug is called
client_socketA ConnectedDescriptor which is used to communicate with the server.
interfacethe network interface to bind to

Member Function Documentation

int ola::OladHTTPServer::CreateNewUniverse ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Create a new universe by binding one or more ports.

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::DisplayQuit ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Cause the server to shutdown

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::GetDmx ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Handle the get DMX command

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
void ola::OladHTTPServer::HandleCandidatePorts ( ola::http::HTTPResponse response,
const client::Result result,
const std::vector< client::OlaDevice > &  devices 
)

Handle the list of candidate ports

Parameters
responsethe HTTPResponse that is associated with the request.
devicesthe possbile devices & ports
void ola::OladHTTPServer::HandlePartialPluginInfo ( ola::http::HTTPResponse response,
int  plugin_id,
const client::Result result,
const std::string &  description 
)

Handle the plugin description response.

Parameters
responsethe HTTPResponse that is associated with the request.
plugin_idthe plugin id.
descriptionthe plugin description.
void ola::OladHTTPServer::HandlePluginInfo ( ola::http::HTTPResponse response,
std::string  description,
const client::Result result,
const ola::client::PluginState state 
)

Handle the plugin description response.

Parameters
responsethe HTTPResponse that is associated with the request.
descriptionthe plugin description.
statethe state of the plugin.
void ola::OladHTTPServer::HandlePluginList ( ola::http::HTTPResponse response,
const client::Result result,
const std::vector< client::OlaPlugin > &  plugins 
)

Handle the plugin list callback

Parameters
responsethe HTTPResponse that is associated with the request.
pluginsa list of plugins
int ola::OladHTTPServer::HandleSetDmx ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Handle the set DMX command

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
void ola::OladHTTPServer::HandleUniverseInfo ( ola::http::HTTPResponse response,
const client::Result result,
const client::OlaUniverse universe 
)

Handle the universe info

Parameters
responsethe HTTPResponse that is associated with the request.
universethe OlaUniverse object
void ola::OladHTTPServer::HandleUniverseList ( ola::http::HTTPResponse response,
ola::web::JsonObject json,
const client::Result result,
const std::vector< client::OlaUniverse > &  universes 
)

Handle the universe list callback

Parameters
responsethe HTTPResponse that is associated with the request.
bool ola::OladHTTPServer::Init ( )
virtual

Setup the OLA HTTP server

Returns
true if this worked, false otherwise.

Reimplemented from ola::http::OlaHTTPServer.

int ola::OladHTTPServer::JsonAvailablePorts ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Return a list of unbound ports

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::JsonPluginInfo ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Print the plugin info as a json string

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::JsonServerStats ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Print the server stats json

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::JsonUniverseInfo ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Return information about a universe

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::JsonUniversePluginList ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Print the list of universes / plugins as a json string

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::ModifyUniverse ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Modify an existing universe.

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::ReloadPidStore ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Reload the PID Store.

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
int ola::OladHTTPServer::ReloadPlugins ( const ola::http::HTTPRequest request,
ola::http::HTTPResponse response 
)

Reload all plugins

Parameters
requestthe HTTPRequest
responsethe HTTPResponse
Returns
MHD_NO or MHD_YES
static int ola::OladHTTPServer::ServeHelpRedirect ( ola::http::HTTPResponse response)
inlinestatic

Serve a help redirect

Parameters
responsethe response to use
int ola::OladHTTPServer::ServeUsage ( ola::http::HTTPResponse response,
const std::string &  details 
)
static

Serve usage information.

Parameters
responsethe reponse to use.
detailsthe usage information
void ola::OladHTTPServer::SetPidStore ( const ola::rdm::RootPidStore pid_store)

Can be called while the http server is running


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