#include <http_handler.h>
Public Member Functions | |
HttpHandler (Json::Value &json_out, Json::Value json_in, struct evhttp_request *req) | |
bool | handleRequest () |
bool | validate (string &default_schema, string &default_table, bool allow_drop_table) |
void | sendResponse () |
void | generateHttpError () |
void | generateDropTableError () |
const char * | getSchema () const |
const char * | getTable () const |
const string & | getQuery () const |
const char * | getId () const |
const Json::Value | getOutputJson () const |
const Json::Value | getInputJson () const |
void | setOutputJson (Json::Value &json_out) |
Private Attributes | |
const char * | _schema |
const char * | _table |
string | _query |
const char * | _id |
Json::Value | _json_out |
Json::Value | _json_in |
int | _http_response_code |
const char * | _http_response_text |
struct evhttp_request * | _req |
a class. used to handles http request and response.
Definition at line 46 of file http_handler.h.
drizzle_plugin::json_server::HttpHandler::HttpHandler | ( | Json::Value & | json_out, |
Json::Value | json_in, | ||
struct evhttp_request * | req | ||
) |
Constructor
json_out | an empty json output object. |
json_in | an empty json input object. |
req | the http request object to parse. |
Definition at line 31 of file http_handler.cc.
void drizzle_plugin::json_server::HttpHandler::generateDropTableError | ( | ) |
Generate a error occurs using DROP Table command.
Definition at line 128 of file http_handler.cc.
void drizzle_plugin::json_server::HttpHandler::generateHttpError | ( | ) |
Generate a http error when table is null.
Definition at line 120 of file http_handler.cc.
|
inline |
|
inline |
Get input json object.
Definition at line 133 of file http_handler.h.
Referenced by drizzle_plugin::json_server::process_json_req().
|
inline |
Get output json object.
Definition at line 125 of file http_handler.h.
Referenced by drizzle_plugin::json_server::process_json_req().
|
inline |
Get query being used.
Definition at line 109 of file http_handler.h.
|
inline |
Get schema being used.
Definition at line 92 of file http_handler.h.
Referenced by drizzle_plugin::json_server::process_json_req().
|
inline |
Get table being used.
Definition at line 101 of file http_handler.h.
Referenced by drizzle_plugin::json_server::process_json_req().
bool drizzle_plugin::json_server::HttpHandler::handleRequest | ( | ) |
Parse http request and retrieve various http headers.
Definition at line 44 of file http_handler.cc.
Referenced by drizzle_plugin::json_server::process_json_req().
void drizzle_plugin::json_server::HttpHandler::sendResponse | ( | ) |
Send http response back.
json_out | a Json::Value object. |
Definition at line 136 of file http_handler.cc.
References Json::StyledWriter::write().
Referenced by drizzle_plugin::json_server::process_json_req().
|
inline |
Set Output json object.
json_out | a Json::Value object. |
Definition at line 141 of file http_handler.h.
Referenced by drizzle_plugin::json_server::process_json_req().
bool drizzle_plugin::json_server::HttpHandler::validate | ( | string & | default_schema, |
string & | default_table, | ||
bool | allow_drop_table | ||
) |
Parse input json query and generate input json object.
default_schema | a string. |
default_table | a string. |
allow_drop_table | a boolean value. |
Definition at line 76 of file http_handler.cc.
References Json::Reader::getFormatedErrorMessages(), and Json::Reader::parse().
Referenced by drizzle_plugin::json_server::process_json_req().
|
private |
Stores http response code.
Definition at line 174 of file http_handler.h.
|
private |
Stores http response text.
Definition at line 178 of file http_handler.h.
|
private |
Stores id primary key for a dcument.
Definition at line 162 of file http_handler.h.
|
private |
Stores input json object.
Definition at line 170 of file http_handler.h.
|
private |
Stores output json object.
Definition at line 166 of file http_handler.h.
|
private |
Stores query being used.
Definition at line 158 of file http_handler.h.
|
private |
Stores http request object.
Definition at line 182 of file http_handler.h.
|
private |
Stores schema being used.
Definition at line 150 of file http_handler.h.
|
private |
Stores table being used.
Definition at line 154 of file http_handler.h.