| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.5.0_22) on Sun Oct 21 11:03:14 GMT+01:00 2012 --> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <TITLE> |
| SocketFactory (HttpComponents Client 4.2.2 API) |
| </TITLE> |
| |
| <META NAME="keywords" CONTENT="org.apache.http.conn.scheme.SocketFactory interface"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| parent.document.title="SocketFactory (HttpComponents Client 4.2.2 API)"; |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../org/apache/http/conn/scheme/SchemeSocketFactory.html" title="interface in org.apache.http.conn.scheme"><B>PREV CLASS</B></A> |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../index.html?org/apache/http/conn/scheme/SocketFactory.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="SocketFactory.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.apache.http.conn.scheme</FONT> |
| <BR> |
| Interface SocketFactory</H2> |
| <DL> |
| <DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../../org/apache/http/conn/scheme/LayeredSocketFactory.html" title="interface in org.apache.http.conn.scheme">LayeredSocketFactory</A></DD> |
| </DL> |
| <DL> |
| <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../org/apache/http/conn/MultihomePlainSocketFactory.html" title="class in org.apache.http.conn">MultihomePlainSocketFactory</A>, <A HREF="../../../../../org/apache/http/conn/scheme/PlainSocketFactory.html" title="class in org.apache.http.conn.scheme">PlainSocketFactory</A>, <A HREF="../../../../../org/apache/http/conn/ssl/SSLSocketFactory.html" title="class in org.apache.http.conn.ssl">SSLSocketFactory</A></DD> |
| </DL> |
| <HR> |
| <B>Deprecated.</B> <I>(4.1) use <A HREF="../../../../../org/apache/http/conn/scheme/SchemeSocketFactory.html" title="interface in org.apache.http.conn.scheme"><CODE>SchemeSocketFactory</CODE></A></I> |
| <P> |
| <DL> |
| <DT><PRE><FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Deprecated.html" title="class or interface in java.lang">@Deprecated</A> |
| </FONT>public interface <B>SocketFactory</B></DL> |
| </PRE> |
| |
| <P> |
| A factory for creating, initializing and connecting sockets. |
| The factory encapsulates the logic for establishing a socket connection. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Since:</B></DT> |
| <DD>4.0</DD> |
| </DL> |
| <HR> |
| |
| <P> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams)">connectSocket</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> sock, |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host, |
| int port, |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/InetAddress.html" title="class or interface in java.net">InetAddress</A> localAddress, |
| int localPort, |
| <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/params/HttpParams.html" title="class or interface in org.apache.http.params">HttpParams</A> params)</CODE> |
| |
| <BR> |
| <B>Deprecated.</B> Connects a socket to the given host.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#createSocket()">createSocket</A></B>()</CODE> |
| |
| <BR> |
| <B>Deprecated.</B> Creates a new, unconnected socket.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#isSecure(java.net.Socket)">isSecure</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> sock)</CODE> |
| |
| <BR> |
| <B>Deprecated.</B> Checks whether a socket provides a secure connection.</TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="createSocket()"><!-- --></A><H3> |
| createSocket</H3> |
| <PRE> |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> <B>createSocket</B>() |
| throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE> |
| <DL> |
| <DD><B>Deprecated.</B> <DD>Creates a new, unconnected socket. |
| The socket should subsequently be passed to |
| <A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams)"><CODE>connectSocket</CODE></A>. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a new socket |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs while creating the socket</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams)"><!-- --></A><H3> |
| connectSocket</H3> |
| <PRE> |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> <B>connectSocket</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> sock, |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host, |
| int port, |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/InetAddress.html" title="class or interface in java.net">InetAddress</A> localAddress, |
| int localPort, |
| <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/params/HttpParams.html" title="class or interface in org.apache.http.params">HttpParams</A> params) |
| throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>, |
| <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A>, |
| <A HREF="../../../../../org/apache/http/conn/ConnectTimeoutException.html" title="class in org.apache.http.conn">ConnectTimeoutException</A></PRE> |
| <DL> |
| <DD><B>Deprecated.</B> <DD>Connects a socket to the given host. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>sock</CODE> - the socket to connect, as obtained from |
| <A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#createSocket()"><CODE>createSocket</CODE></A>. |
| <code>null</code> indicates that a new socket |
| should be created and connected.<DD><CODE>host</CODE> - the host to connect to<DD><CODE>port</CODE> - the port to connect to on the host<DD><CODE>localAddress</CODE> - the local address to bind the socket to, or |
| <code>null</code> for any<DD><CODE>localPort</CODE> - the port on the local machine, |
| 0 or a negative number for any<DD><CODE>params</CODE> - additional <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/params/HttpParams.html" title="class or interface in org.apache.http.params"><CODE>parameters</CODE></A> for connecting |
| <DT><B>Returns:</B><DD>the connected socket. The returned object may be different |
| from the <code>sock</code> argument if this factory supports |
| a layered protocol. |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs |
| <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if the IP address of the target host |
| can not be determined |
| <DD><CODE><A HREF="../../../../../org/apache/http/conn/ConnectTimeoutException.html" title="class in org.apache.http.conn">ConnectTimeoutException</A></CODE> - if the socket cannot be connected |
| within the time limit defined in the <code>params</code></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="isSecure(java.net.Socket)"><!-- --></A><H3> |
| isSecure</H3> |
| <PRE> |
| boolean <B>isSecure</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> sock) |
| throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE> |
| <DL> |
| <DD><B>Deprecated.</B> <DD>Checks whether a socket provides a secure connection. |
| The socket must be <A HREF="../../../../../org/apache/http/conn/scheme/SocketFactory.html#connectSocket(java.net.Socket, java.lang.String, int, java.net.InetAddress, int, org.apache.http.params.HttpParams)"><CODE>connected</CODE></A> |
| by this factory. |
| The factory will <i>not</i> perform I/O operations |
| in this method. |
| <br/> |
| As a rule of thumb, plain sockets are not secure and |
| TLS/SSL sockets are secure. However, there may be |
| application specific deviations. For example, a plain |
| socket to a host in the same intranet ("trusted zone") |
| could be considered secure. On the other hand, a |
| TLS/SSL socket could be considered insecure based on |
| the cipher suite chosen for the connection. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>sock</CODE> - the connected socket to check |
| <DT><B>Returns:</B><DD><code>true</code> if the connection of the socket |
| should be considered secure, or |
| <code>false</code> if it should not |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the argument is invalid, for example because it is |
| not a connected socket or was created by a different |
| socket factory. |
| Note that socket factories are <i>not</i> required to |
| check these conditions, they may simply return a default |
| value when called with an invalid socket argument.</DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../org/apache/http/conn/scheme/SchemeSocketFactory.html" title="interface in org.apache.http.conn.scheme"><B>PREV CLASS</B></A> |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../index.html?org/apache/http/conn/scheme/SocketFactory.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="SocketFactory.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| Copyright © 1999-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. |
| </BODY> |
| </HTML> |