Allows a plugin to act as a server and return the response. More...
#include <InterceptPlugin.h>
Inherits atscppapi::TransactionPlugin.
Public Types | |
enum | RequestDataType { REQUEST_HEADER = 0, REQUEST_BODY } |
Public Member Functions | |
virtual void | consume (const std::string &data, RequestDataType type)=0 |
A method that you must implement when writing an InterceptPlugin, this method will be invoked whenever client request data is read. | |
virtual void | handleInputComplete ()=0 |
A method that you must implement when writing an InterceptPlugin, this method will be invoked when the client request is deemed complete. | |
Headers & | getRequestHeaders () |
Should be called only after request header has completely been consumed. | |
virtual | ~InterceptPlugin () |
Protected Types | |
enum | Type { SERVER_INTERCEPT = 0, TRANSACTION_INTERCEPT } |
The available types of intercepts. More... | |
Protected Member Functions | |
InterceptPlugin (Transaction &transaction, Type type) | |
a plugin must implement this interface, it cannot be constructed directly | |
bool | produce (const void *data, int data_size) |
Internal use only. | |
bool | produce (const std::string &data) |
bool | setOutputComplete () |
Friends | |
class | utils::internal |
Allows a plugin to act as a server and return the response.
This plugin can be created in read request headers hook (pre or post remap).
Definition at line 40 of file InterceptPlugin.h.
Definition at line 54 of file InterceptPlugin.h.
enum atscppapi::InterceptPlugin::Type [protected] |
The available types of intercepts.
SERVER_INTERCEPT |
Plugin will act as origin. |
TRANSACTION_INTERCEPT |
Plugin will act as cache and origin (on cache miss). |
Definition at line 45 of file InterceptPlugin.h.
atscppapi::InterceptPlugin::InterceptPlugin | ( | Transaction & | transaction, | |
Type | type | |||
) | [protected] |
a plugin must implement this interface, it cannot be constructed directly
virtual atscppapi::InterceptPlugin::~InterceptPlugin | ( | ) | [virtual] |
virtual void atscppapi::InterceptPlugin::consume | ( | const std::string & | data, | |
RequestDataType | type | |||
) | [pure virtual] |
A method that you must implement when writing an InterceptPlugin, this method will be invoked whenever client request data is read.
Headers& atscppapi::InterceptPlugin::getRequestHeaders | ( | ) |
Should be called only after request header has completely been consumed.
virtual void atscppapi::InterceptPlugin::handleInputComplete | ( | ) | [pure virtual] |
A method that you must implement when writing an InterceptPlugin, this method will be invoked when the client request is deemed complete.
bool atscppapi::InterceptPlugin::produce | ( | const void * | data, | |
int | data_size | |||
) | [protected] |
Internal use only.
This method is how an InterceptPlugin will send output back to the client.
bool atscppapi::InterceptPlugin::produce | ( | const std::string & | data | ) | [inline, protected] |
bool atscppapi::InterceptPlugin::setOutputComplete | ( | ) | [protected] |
friend class utils::internal [friend] |
Reimplemented from atscppapi::TransactionPlugin.
Definition at line 95 of file InterceptPlugin.h.