29#ifndef Pt_Http_Servlet_h
30#define Pt_Http_Servlet_h
32#include <Pt/Http/Api.h>
33#include <Pt/NonCopyable.h>
131 void registerServer(Server& server);
134 void unregisterServer(Server& server);
Server-side authorization.
Definition Authorizer.h:145
bool onRequest(const Request &request) const
Returns true if the servlet should process the request.
MapAny(Service &s)
Construct with service.
Definition Servlet.h:179
MapAny(Service &s, Authorizer &a)
Construct with service and authorizer.
Definition Servlet.h:185
bool onRequest(const Request &request) const
Returns true if the servlet should process the request.
MapUrl(const std::string &url, Service &s)
Construct with url to map to a service.
Definition Servlet.h:151
MapUrl(const std::string &url, Service &s, Authorizer &a)
Construct with url to map to a service.
Definition Servlet.h:158
HTTP reply message.
Definition Reply.h:64
HTTP request message.
Definition Request.h:65
Listening HTTP server.
Definition Server.h:83
Factory for request responders.
Definition Service.h:77
void setShutdown(bool shutdown=true)
Set shutdown flag.
Authorizer * authorizer()
Returns the authorizer.
Definition Servlet.h:121
Servlet(Service &s)
Construct with service.
bool isIdle()
Returns true if not in use.
bool isMapped(const Request &request) const
Returns true if request is mapped to the service.
Definition Servlet.h:111
Service * service()
Returns the service to map requests to.
Definition Servlet.h:116
void detach()
Detach from server.
virtual bool onRequest(const Request &request) const =0
Returns true if the servlet should process the request.
virtual ~Servlet()
Destructor.
Servlet(Service &s, Authorizer &a)
Construct with service and authorizer.
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
HTTP clients and servers.
Core module.
Definition Allocator.h:33