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.protocol;
33
34 import java.io.IOException;
35 import java.net.Socket;
36 import java.net.UnknownHostException;
37
38 /***
39 * A ProtocolSocketFactory that is secure.
40 *
41 * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory
42 *
43 * @author Michael Becke
44 * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
45 * @since 2.0
46 */
47 public interface SecureProtocolSocketFactory extends ProtocolSocketFactory {
48
49 /***
50 * Returns a socket connected to the given host that is layered over an
51 * existing socket. Used primarily for creating secure sockets through
52 * proxies.
53 *
54 * @param socket the existing socket
55 * @param host the host name/IP
56 * @param port the port on the host
57 * @param autoClose a flag for closing the underling socket when the created
58 * socket is closed
59 *
60 * @return Socket a new socket
61 *
62 * @throws IOException if an I/O error occurs while creating the socket
63 * @throws UnknownHostException if the IP address of the host cannot be
64 * determined
65 */
66 Socket createSocket(
67 Socket socket,
68 String host,
69 int port,
70 boolean autoClose
71 ) throws IOException, UnknownHostException;
72
73 }