Part of lp.services.webapp.servers View In Hierarchy
Known subclasses: lp.services.webapp.servers.VHostWebServiceRequestPublicationFactory, lp.services.webapp.servers.WebServiceRequestPublicationFactory, lp.services.webapp.servers.XMLRPCRequestPublicationFactory
IRequestPublicationFactory
handling request to a Launchpad vhost.
This factory will accepts requests to a particular Launchpad virtual host that matches a particular port and set of HTTP methods.
Method | __init__ | Creates a new factory. |
Method | canHandle | See IRequestPublicationFactory . |
Method | __call__ | See IRequestPublicationFactory . |
Method | getRequestAndPublicationFactories | Return the request and publication factories to use. |
Method | getAcceptableMethods | Return the HTTP methods acceptable in this particular environment. |
Method | checkRequest | Makes sure that the incoming HTTP request is of an expected type. |
Parameters | vhost_name | The config section defining the virtual host handled by this factory. |
request_factory | The request factory to use for this virtual host's requests. | |
publication_factory | The publication factory to use for this virtual host's requests. | |
port | The port which is handled by this factory. If this is None, this factory will handle requests that originate on any port. | |
methods | A sequence of HTTP methods that this factory handles. | |
handle_default_host | Whether or not this factory is capable of handling requests that specify no hostname. |
IRequestPublicationFactory
.
Returns true if the HTTP host and port of the incoming request match the ones this factory is equipped to handle.
IRequestPublicationFactory
.
We know that this factory is the right one for the given host and port. But there might be something else wrong with the request. For instance, it might have the wrong HTTP method.
You can override this method if the request and publication can vary based on the environment.
This is different from canHandle() because we know the request went to the right place. It's just that it might be an invalid request for this handler.
Returns | An appropriate ProtocolErrorPublicationFactory if the HTTP request doesn't comply with the expected protocol. If the request does comply, (None, None). |