Public Types | Public Member Functions | Protected Types | Protected Member Functions | Friends

atscppapi::InterceptPlugin Class Reference

Allows a plugin to act as a server and return the response. More...

#include <InterceptPlugin.h>

Inherits atscppapi::TransactionPlugin.

Collaboration diagram for atscppapi::InterceptPlugin:
Collaboration graph
[legend]

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.
HeadersgetRequestHeaders ()
 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

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
REQUEST_HEADER 
REQUEST_BODY 

Definition at line 54 of file InterceptPlugin.h.

The available types of intercepts.

Enumerator:
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.


Constructor & Destructor Documentation

atscppapi::InterceptPlugin::InterceptPlugin ( Transaction transaction,
Type  type 
) [protected]

a plugin must implement this interface, it cannot be constructed directly

virtual atscppapi::InterceptPlugin::~InterceptPlugin (  )  [virtual]

Member Function Documentation

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]

Definition at line 85 of file InterceptPlugin.h.

References produce().

Referenced by produce().

bool atscppapi::InterceptPlugin::setOutputComplete (  )  [protected]

Friends And Related Function Documentation

friend class utils::internal [friend]

Reimplemented from atscppapi::TransactionPlugin.

Definition at line 95 of file InterceptPlugin.h.


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