1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 package org.apache.commons.httpclient.server;
33
34 import java.io.IOException;
35
36 /***
37 * Defines an HTTP request handler for the SimpleHttpServer
38 *
39 * @author Christian Kohlschuetter
40 * @author Oleg Kalnichevski
41 */
42 public interface HttpRequestHandler {
43 /***
44 * The request handler is asked to process this request.
45 *
46 * If it is not capable/interested in processing it, this call should
47 * be simply ignored.
48 *
49 * Any modification of the output stream (via <code>conn.getWriter()</code>)
50 * by this request handler will stop the execution chain and return the output
51 * to the client.
52 *
53 * The handler may also rewrite the request parameters (this is useful in
54 * {@link HttpRequestHandlerChain} structures).
55 *
56 * @param conn The Connection object to which this request belongs to.
57 * @param request The request object.
58 * @return true if this handler handled the request and no other handlers in the
59 * chain should be called, false otherwise.
60 * @throws IOException
61 */
62 public boolean processRequest(
63 final SimpleHttpServerConnection conn,
64 final SimpleRequest request) throws IOException;
65 }