29 #ifndef Pt_Http_Servlet_h
30 #define Pt_Http_Servlet_h
32 #include <Pt/Http/Api.h>
33 #include <Pt/NonCopyable.h>
72 void setShutdown(
bool shutdown =
true);
85 {
return this->onRequest(request); }
100 virtual bool onRequest(
const Request& request)
const = 0;
104 void registerServer(
Server& server);
107 void unregisterServer(
Server& server);
135 bool onRequest(
const Request& request)
const;
159 bool onRequest(
const Request& request)
const;
166 #endif // Pt_Http_Servlet_h
Server side authorization.
Definition: Authorizer.h:91
HTTP request message.
Definition: Request.h:43
MapUrl(const std::string &url, Service &s)
Construct with url to map to a service.
Definition: Servlet.h:122
Authorizer * authorizer()
Returns the authorizer.
Definition: Servlet.h:94
Protects derived classes from being copied.
Definition: NonCopyable.h:54
An HTTP server.
Definition: Server.h:56
MapAny(Service &s, Authorizer &a)
Construct with service and authorizer.
Definition: Servlet.h:154
HTTP service.
Definition: Service.h:46
MapUrl(const std::string &url, Service &s, Authorizer &a)
Construct with url to map to a service.
Definition: Servlet.h:129
MapAny(Service &s)
Construct with service.
Definition: Servlet.h:148
Servlet for HTTP services.
Definition: Servlet.h:52
bool isMapped(const Request &request) const
Returns true if request is mapped to the service.
Definition: Servlet.h:84
Maps requests to a service by URL.
Definition: Servlet.h:117
Service * service()
Returns the service to map requests to.
Definition: Servlet.h:89
Maps any request to a service.
Definition: Servlet.h:143