|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetapp.manage.http.HTTPClient
An HTTP client implements the client portion of RFC2616.
| Field Summary | |
static int |
snoop
The debug level. |
| Constructor Summary | |
HTTPClient(boolean ssl,
java.net.InetAddress host,
int port)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut,
AuthInfo authInfo)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut,
AuthInfo authInfo,
boolean useTLS)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.lang.String host,
int port)
Constructs a HTTPClient. |
|
HTTPClient(boolean ssl,
java.lang.String host,
int port,
boolean reservedPort)
Constructs a HTTPClient. |
|
| Method Summary | |
void |
close()
Close this HTTP client's connections. |
void |
disableTLS()
Disables TLSv1 protocol for use over HTTPS Transport. |
HTTPResponse |
doRequest(HTTPRequest request)
Send a HTTPRequest and receive the corresponding
HTTPResponse. |
void |
enableTLS()
Enables TLSv1 protocol for use on connection over HTTPS Transport. |
int |
getUseCount()
Get the number of requests that have been processed by this HTTPClient. |
boolean |
isCompatible(boolean ssl,
java.net.InetAddress host,
int port,
AuthInfo authInfo,
boolean useTLS)
Test whether this HTTPClient was created with some
particular paramters. |
boolean |
isCompatible(boolean ssl,
java.lang.String host,
int port,
AuthInfo authInfo)
Test whether this HTTPClient was created with some
particular paramters. |
boolean |
isTimedOut()
Test whether the connection has been idle for too long. |
boolean |
isTLSEnabled()
Determines whether TLSv1 protocol is enabled for use over HTTPS Transport. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int snoop
System.err.
| Constructor Detail |
public HTTPClient(boolean ssl,
java.lang.String host,
int port)
throws java.io.IOException,
java.net.UnknownHostException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server hostname.port - the server TCP port.
java.io.IOException - if the connection cannot be established.
java.net.UnknownHostException - if the hostname is not known.
public HTTPClient(boolean ssl,
java.lang.String host,
int port,
boolean reservedPort)
throws java.io.IOException,
java.net.UnknownHostException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server hostname.port - the server TCP port.reservedPort - flag indicating to bind to a reserved port.
java.io.IOException - if the connection cannot be established.
java.net.UnknownHostException - if the hostname is not known.
public HTTPClient(boolean ssl,
java.net.InetAddress host,
int port)
throws java.io.IOException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.
java.io.IOException - if the connection cannot be established.
public HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort)
throws java.io.IOException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.reservedPort - flag indicating to bind to a reserved port.
java.io.IOException - if the connection cannot be established.
public HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut)
throws java.io.IOException,
java.net.SocketTimeoutException,
java.lang.IllegalArgumentException,
java.nio.channels.IllegalBlockingModeException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.timeOut - the connection timeout value.reservedPort - flag indicating to bind to a reserved port.
java.io.IOException - if the connection cannot be established.
java.net.SocketTimeoutException - if timeout expires before
connecting.
java.lang.IllegalArgumentException - if endpoint is null or
is a SocketAddress subclass
not supported by this socket.
java.nio.channels.IllegalBlockingModeException - if this socket has an
associated channel, and the channel is
in non-blocking mode.
public HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut,
AuthInfo authInfo)
throws java.io.IOException,
java.net.SocketTimeoutException,
java.lang.IllegalArgumentException,
java.nio.channels.IllegalBlockingModeException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.reservedPort - flag indicating to bind to a reserved port.timeOut - the connection timeout value.authInfo - certificate bsed authentication info structure.
java.io.IOException - if the connection cannot be established.
java.net.SocketTimeoutException - if timeout expires before
connecting.
java.lang.IllegalArgumentException - if endpoint is null or
is a SocketAddress subclass
not supported by this socket.
java.nio.channels.IllegalBlockingModeException - if this socket has an
associated channel, and the channel is
in non-blocking mode.
public HTTPClient(boolean ssl,
java.net.InetAddress host,
int port,
boolean reservedPort,
int timeOut,
AuthInfo authInfo,
boolean useTLS)
throws java.io.IOException,
java.net.SocketTimeoutException,
java.lang.IllegalArgumentException,
java.nio.channels.IllegalBlockingModeException
HTTPClient. A single socket
connection is made to the HTTP server,
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.reservedPort - flag indicating to bind to a reserved port.timeOut - the connection timeout value.authInfo - certificate bsed authentication info structure.useTLS - flag to enable TLSv1 protocol during SSL communication.
java.io.IOException - if the connection cannot be established.
java.net.SocketTimeoutException - if timeout expires before
connecting.
java.lang.IllegalArgumentException - if endpoint is null or
is a SocketAddress subclass
not supported by this socket.
java.nio.channels.IllegalBlockingModeException - if this socket has an
associated channel, and the channel is
in non-blocking mode.| Method Detail |
public void close()
HTTPClient.
public boolean isCompatible(boolean ssl,
java.lang.String host,
int port,
AuthInfo authInfo)
HTTPClient was created with some
particular paramters.
ssl - flag to use HTTPS instead of HTTP.host - the server hostname.port - the server TCP port.authInfo - certificate bsed authentication info structure.
true if all the parameters are the
same as when the object was created, otherwise
false.
public boolean isCompatible(boolean ssl,
java.net.InetAddress host,
int port,
AuthInfo authInfo,
boolean useTLS)
HTTPClient was created with some
particular paramters.
ssl - flag to use HTTPS instead of HTTP.host - the server address.port - the server TCP port.authInfo - certificate bsed authentication info structure.useTLS - flag to enable TLSv1 protocol during SSL communication.
true if all the parameters are the
same as when the object was created, otherwise
false.public boolean isTimedOut()
true if the connection was idle for
too long, otherwise false.public int getUseCount()
HTTPClient.
public void enableTLS()
public void disableTLS()
public boolean isTLSEnabled()
public HTTPResponse doRequest(HTTPRequest request)
throws java.io.IOException,
HTTPException
HTTPRequest and receive the corresponding
HTTPResponse. This function will automatically
set the "Host" header in the request based on the parameters
of this HTTPClient.
request - the request to send.
java.io.IOException - if there is a communication error.
HTTPException - if there is a HTTP protocol error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||