| Method from org.apache.commons.httpclient.HttpClient Detail: |
public int executeMethod(HttpMethod method) throws IOException, HttpException {
LOG.trace("enter HttpClient.executeMethod(HttpMethod)");
// execute this method and use its host configuration, if it has one
return executeMethod(null, method, null);
}
|
public int executeMethod(HostConfiguration hostConfiguration,
HttpMethod method) throws IOException, HttpException {
LOG.trace("enter HttpClient.executeMethod(HostConfiguration,HttpMethod)");
return executeMethod(hostConfiguration, method, null);
}
|
public int executeMethod(HostConfiguration hostconfig,
HttpMethod method,
HttpState state) throws IOException, HttpException {
LOG.trace("enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)");
if (method == null) {
throw new IllegalArgumentException("HttpMethod parameter may not be null");
}
HostConfiguration defaulthostconfig = getHostConfiguration();
if (hostconfig == null) {
hostconfig = defaulthostconfig;
}
URI uri = method.getURI();
if (hostconfig == defaulthostconfig || uri.isAbsoluteURI()) {
// make a deep copy of the host defaults
hostconfig = (HostConfiguration) hostconfig.clone();
if (uri.isAbsoluteURI()) {
hostconfig.setHost(uri);
}
}
HttpMethodDirector methodDirector = new HttpMethodDirector(
getHttpConnectionManager(),
hostconfig,
this.params,
(state == null ? getState() : state));
methodDirector.executeMethod(method);
return method.getStatusCode();
}
|
public String getHost() {
return hostConfiguration.getHost();
} Deprecated! use - #getHostConfiguration()
Returns the default host. |
public synchronized HostConfiguration getHostConfiguration() {
return hostConfiguration;
}
|
public synchronized HttpConnectionManager getHttpConnectionManager() {
return httpConnectionManager;
}
|
public HttpClientParams getParams() {
return this.params;
}
|
public int getPort() {
return hostConfiguration.getPort();
} Deprecated! use - #getHostConfiguration()
Returns the default port. |
public synchronized HttpState getState() {
// ------------------------------------------------------------- Properties
return state;
}
Returns HTTP state associated with the HttpClient. |
public synchronized boolean isStrictMode() {
return false;
} Deprecated! Use -
org.apache.commons.httpclient.params.HttpClientParams#getParameter(String)
to exercise a more granular control over HTTP protocol strictness.
Returns the value of the strict mode flag. |
public synchronized void setConnectionTimeout(int newTimeoutInMilliseconds) {
this.httpConnectionManager.getParams().setConnectionTimeout(newTimeoutInMilliseconds);
} Deprecated! Use -
org.apache.commons.httpclient.params.HttpConnectionManagerParams#setConnectionTimeout(int) ,
HttpConnectionManager#getParams() .
Sets the timeout until a connection is etablished. A value of zero
means the timeout is not used. The default value is zero. |
public synchronized void setHostConfiguration(HostConfiguration hostConfiguration) {
this.hostConfiguration = hostConfiguration;
}
|
public synchronized void setHttpConnectionFactoryTimeout(long timeout) {
this.params.setConnectionManagerTimeout(timeout);
} Deprecated! Use -
org.apache.commons.httpclient.params.HttpClientParams#setConnectionManagerTimeout(long) ,
HttpClient#getParams()
|
public synchronized void setHttpConnectionManager(HttpConnectionManager httpConnectionManager) {
this.httpConnectionManager = httpConnectionManager;
if (this.httpConnectionManager != null) {
this.httpConnectionManager.getParams().setDefaults(this.params);
}
}
|
public void setParams(HttpClientParams params) {
if (params == null) {
throw new IllegalArgumentException("Parameters may not be null");
}
this.params = params;
}
|
public synchronized void setState(HttpState state) {
this.state = state;
}
|
public synchronized void setStrictMode(boolean strictMode) {
if (strictMode) {
this.params.makeStrict();
} else {
this.params.makeLenient();
}
} Deprecated! Use - HttpClientParams#setParameter(String, Object)
to exercise a more granular control over HTTP protocol strictness.
Defines how strictly the method follows the HTTP protocol specification
(see RFC 2616 and other relevant RFCs).
In the strict mode the method precisely
implements the requirements of the specification, whereas in non-strict mode
it attempts to mimic the exact behaviour of commonly used HTTP agents,
which many HTTP servers expect. |
public synchronized void setTimeout(int newTimeoutInMilliseconds) {
this.params.setSoTimeout(newTimeoutInMilliseconds);
} Deprecated! Use -
org.apache.commons.httpclient.params.HttpConnectionManagerParams#setSoTimeout(int) ,
HttpConnectionManager#getParams() .
Sets the socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. A timeout value of zero is interpreted as an
infinite timeout. |