29 #ifndef Pt_Http_Servlet_h
30 #define Pt_Http_Servlet_h
32 #include <Pt/Http/Api.h>
33 #include <Pt/NonCopyable.h>
85 {
return this->onRequest(request); }
104 void registerServer(
Server& server);
107 void unregisterServer(
Server& server);
166 #endif // Pt_Http_Servlet_h
Core module.
Definition: pt-gfx-images.dox:14
Authorizer * authorizer()
Returns the authorizer.
Definition: Servlet.h:94
bool isMapped(const Request &request) const
Returns true if request is mapped to the service.
Definition: Servlet.h:84
Server side authorization.
Definition: Authorizer.h:92
HTTP request message.
Definition: Request.h:44
Maps requests to a service by URL.
Definition: Servlet.h:118
void setShutdown(bool shutdown=true)
Set shutdown flag.
bool isIdle()
Returns true if not in use.
Service * service()
Returns the service to map requests to.
Definition: Servlet.h:89
Maps any request to a service.
Definition: Servlet.h:144
HTTP service.
Definition: Service.h:47
Servlet(Service &s)
Construct with service.
virtual bool onRequest(const Request &request) const =0
Returns true if the servlet should process the request.
Servlet for HTTP services.
Definition: Servlet.h:53
MapAny(Service &s, Authorizer &a)
Construct with service and authorizer.
Definition: Servlet.h:154
MapUrl(const std::string &url, Service &s)
Construct with url to map to a service.
Definition: Servlet.h:122
MapUrl(const std::string &url, Service &s, Authorizer &a)
Construct with url to map to a service.
Definition: Servlet.h:129
An HTTP server.
Definition: Server.h:59
Protects derived classes from being copied.
Definition: NonCopyable.h:54
virtual ~Servlet()
Destructor.
MapAny(Service &s)
Construct with service.
Definition: Servlet.h:148
bool onRequest(const Request &request) const
Returns true if the servlet should process the request.
void detach()
Detach from server.
bool onRequest(const Request &request) const
Returns true if the servlet should process the request.
Servlet(Service &s, Authorizer &a)
Construct with service and authorizer.