• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpServerConnection.java $
3  * $Revision: 542199 $
4  * $Date: 2007-05-28 04:23:46 -0700 (Mon, 28 May 2007) $
5  *
6  * ====================================================================
7  * Licensed to the Apache Software Foundation (ASF) under one
8  * or more contributor license agreements.  See the NOTICE file
9  * distributed with this work for additional information
10  * regarding copyright ownership.  The ASF licenses this file
11  * to you under the Apache License, Version 2.0 (the
12  * "License"); you may not use this file except in compliance
13  * with the License.  You may obtain a copy of the License at
14  *
15  *   http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing,
18  * software distributed under the License is distributed on an
19  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20  * KIND, either express or implied.  See the License for the
21  * specific language governing permissions and limitations
22  * under the License.
23  * ====================================================================
24  *
25  * This software consists of voluntary contributions made by many
26  * individuals on behalf of the Apache Software Foundation.  For more
27  * information on the Apache Software Foundation, please see
28  * <http://www.apache.org/>.
29  *
30  */
31 
32 package org.apache.http;
33 
34 import java.io.IOException;
35 
36 /**
37  * An HTTP connection for use on the server side.
38  * Requests are received, responses are sent.
39  *
40  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
41  *
42  * @version $Revision: 542199 $
43  *
44  * @since 4.0
45  *
46  * @deprecated Please use {@link java.net.URL#openConnection} instead.
47  *     Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a>
48  *     for further details.
49  */
50 @Deprecated
51 public interface HttpServerConnection extends HttpConnection {
52 
53     /**
54      * Receives the request line and all headers available from this connection.
55      * The caller should examine the returned request and decide if to receive a
56      * request entity as well.
57      *
58      * @return a new HttpRequest object whose request line and headers are
59      *         initialized.
60      * @throws HttpException
61      * @throws IOException
62      */
receiveRequestHeader()63     HttpRequest receiveRequestHeader()
64         throws HttpException, IOException;
65 
66     /**
67      * Receives the next request entity available from this connection and attaches it to
68      * an existing request.
69      * @param request the request to attach the entity to.
70      * @throws HttpException
71      * @throws IOException
72      */
receiveRequestEntity(HttpEntityEnclosingRequest request)73     void receiveRequestEntity(HttpEntityEnclosingRequest request)
74         throws HttpException, IOException;
75 
76     /**
77      * Sends the response line and headers of a response over this connection.
78      * @param response the response whose headers to send.
79      * @throws HttpException
80      * @throws IOException
81      */
sendResponseHeader(HttpResponse response)82     void sendResponseHeader(HttpResponse response)
83         throws HttpException, IOException;
84 
85     /**
86      * Sends the response entity of a response over this connection.
87      * @param response the response whose entity to send.
88      * @throws HttpException
89      * @throws IOException
90      */
sendResponseEntity(HttpResponse response)91     void sendResponseEntity(HttpResponse response)
92         throws HttpException, IOException;
93 
94     /**
95      * Sends all pending buffered data over this connection.
96      * @throws IOException
97      */
flush()98     void flush()
99         throws IOException;
100 
101 }
102