Android APIs
public abstract class

AbstractHttpServerConnection

extends Object
implements HttpServerConnection
java.lang.Object
   ↳ org.apache.http.impl.AbstractHttpServerConnection
Known Direct Subclasses
Known Indirect Subclasses

This class is deprecated.
Please use openConnection() instead. Please visit this webpage for further details.

Class Overview

Abstract server-side HTTP connection capable of transmitting and receiving data using arbitrary SessionInputBuffer and SessionOutputBuffer

Summary

Public Constructors
AbstractHttpServerConnection()
Public Methods
void flush()
Sends all pending buffered data over this connection.
HttpConnectionMetrics getMetrics()
Returns a collection of connection metrcis
boolean isStale()
Checks whether this connection has gone down.
void receiveRequestEntity(HttpEntityEnclosingRequest request)
Receives the next request entity available from this connection and attaches it to an existing request.
HttpRequest receiveRequestHeader()
Receives the request line and all headers available from this connection.
void sendResponseEntity(HttpResponse response)
Sends the response entity of a response over this connection.
void sendResponseHeader(HttpResponse response)
Sends the response line and headers of a response over this connection.
Protected Methods
abstract void assertOpen()
EntityDeserializer createEntityDeserializer()
EntitySerializer createEntitySerializer()
HttpRequestFactory createHttpRequestFactory()
HttpMessageParser createRequestParser(SessionInputBuffer buffer, HttpRequestFactory requestFactory, HttpParams params)
HttpMessageWriter createResponseWriter(SessionOutputBuffer buffer, HttpParams params)
void doFlush()
void init(SessionInputBuffer inbuffer, SessionOutputBuffer outbuffer, HttpParams params)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.HttpServerConnection
From interface org.apache.http.HttpConnection

Public Constructors

public AbstractHttpServerConnection ()

Added in API level 1

Public Methods

public void flush ()

Added in API level 1

Sends all pending buffered data over this connection.

Throws
IOException

public HttpConnectionMetrics getMetrics ()

Added in API level 1

Returns a collection of connection metrcis

Returns
  • HttpConnectionMetrics

public boolean isStale ()

Added in API level 1

Checks whether this connection has gone down. Network connections may get closed during some time of inactivity for several reasons. The next time a read is attempted on such a connection it will throw an IOException. This method tries to alleviate this inconvenience by trying to find out if a connection is still usable. Implementations may do that by attempting a read with a very small timeout. Thus this method may block for a small amount of time before returning a result. It is therefore an expensive operation.

Returns
  • true if attempts to use this connection are likely to succeed, or false if they are likely to fail and this connection should be closed

public void receiveRequestEntity (HttpEntityEnclosingRequest request)

Added in API level 1

Receives the next request entity available from this connection and attaches it to an existing request.

Parameters
request the request to attach the entity to.

public HttpRequest receiveRequestHeader ()

Added in API level 1

Receives the request line and all headers available from this connection. The caller should examine the returned request and decide if to receive a request entity as well.

Returns
  • a new HttpRequest object whose request line and headers are initialized.

public void sendResponseEntity (HttpResponse response)

Added in API level 1

Sends the response entity of a response over this connection.

Parameters
response the response whose entity to send.

public void sendResponseHeader (HttpResponse response)

Added in API level 1

Sends the response line and headers of a response over this connection.

Parameters
response the response whose headers to send.

Protected Methods

protected abstract void assertOpen ()

Added in API level 1

protected EntityDeserializer createEntityDeserializer ()

Added in API level 1

protected EntitySerializer createEntitySerializer ()

Added in API level 1

protected HttpRequestFactory createHttpRequestFactory ()

Added in API level 1

protected HttpMessageParser createRequestParser (SessionInputBuffer buffer, HttpRequestFactory requestFactory, HttpParams params)

Added in API level 1

protected HttpMessageWriter createResponseWriter (SessionOutputBuffer buffer, HttpParams params)

Added in API level 1

protected void doFlush ()

Added in API level 1

Throws
IOException

protected void init (SessionInputBuffer inbuffer, SessionOutputBuffer outbuffer, HttpParams params)

Added in API level 1