Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

Dv::Ticket::Request Class Reference

A class representing a reques from a client. More...

#include <request.h>

Inheritance diagram for Dv::Ticket::Request:

Inheritance graph
[legend]
Collaboration diagram for Dv::Ticket::Request:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Dv::Util::ref< RequestRef
 Shorthand typedef.


Public Member Functions

virtual Dv::Xml::Documenthandle (Dv::Xml::Document &result)
 Handle a request.

virtual ~Request ()
 Destructor.

const Dv::Xml::Node::Refroot () const
const std::string & host () const
Dv::Ticket::Serverserver ()
 Server that received the request.


Static Public Member Functions

Ref make (const Dv::Xml::Document &req, Dv::Util::ref< Dv::Ssl::SslSocket > client, Server &server)
 Factory function.


Protected Member Functions

 Request (const Dv::Xml::Document &req, Dv::Util::ref< Dv::Ssl::SslSocket > client, Server &server)
 Constructor (protected, use Dv::Request::make).

Dv::Util::ref< Dv::Ssl::SslSocketclient ()

Private Attributes

Dv::Xml::Document req_
 XML document containing the request.

Dv::Xml::Node::Ref root_
 root of req_

Dv::Util::ref< Dv::Ssl::SslSocketclient_
 SSL connection to client making the request.

std::string host_
 Dot address of client making the request.

Serverserver_
 Server that received the request.


Detailed Description

A class representing a reques from a client.

A client may e.g. request to obtain a new ticket (anonymous or otherwise), or to validate an existing ticket (via its serial number).

See also:
Dv::Ticket::Ticket

Definition at line 17 of file request.h.


Member Typedef Documentation

typedef Dv::Util::ref<Request> Dv::Ticket::Request::Ref
 

Shorthand typedef.

Definition at line 20 of file request.h.


Constructor & Destructor Documentation

virtual Dv::Ticket::Request::~Request  )  [inline, virtual]
 

Destructor.

Definition at line 45 of file request.h.

Dv::Ticket::Request::Request const Dv::Xml::Document req,
Dv::Util::ref< Dv::Ssl::SslSocket client,
Server server
[protected]
 

Constructor (protected, use Dv::Request::make).

Parameters:
req XML document as received from a client.
client SSL connection with client making the request
server that received this request
See also:
Dv::Ticket::Request::make


Member Function Documentation

Ref Dv::Ticket::Request::make const Dv::Xml::Document req,
Dv::Util::ref< Dv::Ssl::SslSocket client,
Server server
[static]
 

Factory function.

The function will return a pointer to an instance object of a class derived from a Request. The derived class depends on the data in the req XML document parameter.

Parameters:
req XML document as received from a client.
client SSL connection with client making the request
server that received this request
Returns:
0 upon any error, e.g. unknown request type, otherwise a pointer to a valid instance of a class derived from Request.
See also:
Dv::Ticket::LoginRequest, Dv::Ticket::AnonLoginRequest, Dv::Ticket::ValidateRequest

virtual Dv::Xml::Document& Dv::Ticket::Request::handle Dv::Xml::Document result  )  [inline, virtual]
 

Handle a request.

This is a virtual function, the default implementation simly returns its unmodified argument.

Parameters:
result reference to an XML document that will be filled with the reply to the request.
Returns:
a reference to the first argument.

Reimplemented in Dv::Ticket::LoginRequest, Dv::Ticket::AnonLoginRequest, and Dv::Ticket::ValidateRequest.

Definition at line 41 of file request.h.

const Dv::Xml::Node::Ref& Dv::Ticket::Request::root  )  const [inline]
 

Returns:
reference to root node of the request XML representation.

Definition at line 47 of file request.h.

References root_.

const std::string& Dv::Ticket::Request::host  )  const [inline]
 

Returns:
dot address of client making the request, e.g. "134.184.65.2"

Definition at line 49 of file request.h.

References host_.

Dv::Ticket::Server& Dv::Ticket::Request::server  )  [inline]
 

Server that received the request.

Definition at line 51 of file request.h.

References server_.

Referenced by Dv::Ticket::AnonLoginRequest::AnonLoginRequest(), Dv::Ticket::LoginRequest::LoginRequest(), and Dv::Ticket::ValidateRequest::ValidateRequest().

Dv::Util::ref<Dv::Ssl::SslSocket> Dv::Ticket::Request::client  )  [inline, protected]
 

Returns:
reference to SSL connection with requesting client

Definition at line 61 of file request.h.

References client_.


Member Data Documentation

Dv::Xml::Document Dv::Ticket::Request::req_ [private]
 

XML document containing the request.

Definition at line 64 of file request.h.

Dv::Xml::Node::Ref Dv::Ticket::Request::root_ [private]
 

root of req_

Definition at line 66 of file request.h.

Referenced by root().

Dv::Util::ref<Dv::Ssl::SslSocket> Dv::Ticket::Request::client_ [private]
 

SSL connection to client making the request.

Definition at line 68 of file request.h.

Referenced by client().

std::string Dv::Ticket::Request::host_ [private]
 

Dot address of client making the request.

E.g. 134.184.65.2

Definition at line 70 of file request.h.

Referenced by host().

Server& Dv::Ticket::Request::server_ [private]
 

Server that received the request.

Definition at line 72 of file request.h.

Referenced by server().


The documentation for this class was generated from the following file:
dvticket-0.7.1 [24 October, 2003]