public class

DefaultClientConnectionOperator

extends Object
implements ClientConnectionOperator
java.lang.Object
   ↳ org.apache.http.impl.conn.DefaultClientConnectionOperator

Class Overview

Default implementation of a ClientConnectionOperator. It uses a SchemeRegistry to look up SocketFactory objects.

Summary

Fields
protected SchemeRegistry schemeRegistry The scheme registry for looking up socket factories.
Public Constructors
DefaultClientConnectionOperator(SchemeRegistry schemes)
Creates a new client connection operator for the given scheme registry.
Public Methods
OperatedClientConnection createConnection()
Creates a new connection that can be operated.
void openConnection(OperatedClientConnection conn, HttpHost target, InetAddress local, HttpContext context, HttpParams params)
Opens a connection to the given target host.
void updateSecureConnection(OperatedClientConnection conn, HttpHost target, HttpContext context, HttpParams params)
Updates a connection with a layered secure connection.
Protected Methods
void prepareSocket(Socket sock, HttpContext context, HttpParams params)
Performs standard initializations on a newly created socket.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.conn.ClientConnectionOperator

Fields

protected SchemeRegistry schemeRegistry

Since: API Level 1

The scheme registry for looking up socket factories.

Public Constructors

public DefaultClientConnectionOperator (SchemeRegistry schemes)

Since: API Level 1

Creates a new client connection operator for the given scheme registry.

Parameters
schemes the scheme registry

Public Methods

public OperatedClientConnection createConnection ()

Since: API Level 1

Creates a new connection that can be operated.

Returns
  • a new, unopened connection for use with this operator

public void openConnection (OperatedClientConnection conn, HttpHost target, InetAddress local, HttpContext context, HttpParams params)

Since: API Level 1

Opens a connection to the given target host.

Parameters
conn the connection to open
target the target host to connect to
local the local address to route from, or null for the default
context the context for the connection
params the parameters for the connection
Throws
IOException

public void updateSecureConnection (OperatedClientConnection conn, HttpHost target, HttpContext context, HttpParams params)

Since: API Level 1

Updates a connection with a layered secure connection. The typical use of this method is to update a tunnelled plain connection (HTTP) to a secure TLS/SSL connection (HTTPS).

Parameters
conn the open connection to update
target the target host for the updated connection. The connection must already be open or tunnelled to the host and port, but the scheme of the target will be used to create a layered connection.
context the context for the connection
params the parameters for the updated connection
Throws
IOException

Protected Methods

protected void prepareSocket (Socket sock, HttpContext context, HttpParams params)

Since: API Level 1

Performs standard initializations on a newly created socket.

Parameters
sock the socket to prepare
context the context for the connection
params the parameters from which to prepare the socket
Throws
IOException in case of an IO problem