Package com.aquima.web.communication
Class BasicHttpConnection
java.lang.Object
com.aquima.web.communication.BasicHttpConnection
- All Implemented Interfaces:
com.aquima.interactions.foundation.connectivity.IConnection
,com.aquima.interactions.foundation.connectivity.IHttpConnection
Http connection implementation that uses apache commons classes to provide a basic connection.
- Since:
- 9.7
- Author:
- Radu Batori
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicHttpConnection
(String name, String url, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.http.client.HttpClient
com.aquima.interactions.foundation.connectivity.IHttpConnectionFiller
fill()
protected void
fillDomain
(String domain) protected void
fillPassword
(String password) protected void
fillTimeout
(int timeout) protected void
protected void
fillUsername
(String username) getName()
com.aquima.interactions.foundation.connectivity.ConnectionType
getType()
getUrl()
void
invoke
(com.aquima.interactions.foundation.connectivity.IHttpRequest request, com.aquima.interactions.foundation.connectivity.IHttpResponseHandler handler) void
An authentication domain (not used when no username is provided).void
setPassword
(String password) A secret to prove the identity of the supplied user.void
setTimeout
(int timeout) Sets the read timeout to a specified timeout, in milliseconds.void
setUserName
(String username) A user identifier used for authentication purposes.
-
Field Details
-
Constructor Details
-
Method Details
-
fill
public com.aquima.interactions.foundation.connectivity.IHttpConnectionFiller fill() -
createHttpClient
protected org.apache.http.client.HttpClient createHttpClient() -
setTimeout
public void setTimeout(int timeout) Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from Input stream when a connection is established to a resource. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout. Some non-standard implementation of this method ignores the specified timeout.- Parameters:
timeout
- the timeout
-
setUserName
A user identifier used for authentication purposes. When no username is set, this implementation will not attempt to authenticate.- Parameters:
username
- the username
-
setPassword
A secret to prove the identity of the supplied user. Not used when no username is provided.- Parameters:
password
- the password
-
setDomain
An authentication domain (not used when no username is provided).- Parameters:
domain
- the domain
-
getName
- Specified by:
getName
in interfacecom.aquima.interactions.foundation.connectivity.IConnection
-
getType
public com.aquima.interactions.foundation.connectivity.ConnectionType getType()- Specified by:
getType
in interfacecom.aquima.interactions.foundation.connectivity.IConnection
-
getUrl
- Specified by:
getUrl
in interfacecom.aquima.interactions.foundation.connectivity.IHttpConnection
-
invoke
public void invoke(com.aquima.interactions.foundation.connectivity.IHttpRequest request, com.aquima.interactions.foundation.connectivity.IHttpResponseHandler handler) throws IOException - Specified by:
invoke
in interfacecom.aquima.interactions.foundation.connectivity.IHttpConnection
- Throws:
IOException
-
fillUrl
-
fillTimeout
protected void fillTimeout(int timeout) -
fillDomain
-
fillUsername
-
fillPassword
-