Package com.isomorphic.maven.util
Class HttpRequestManager
java.lang.Object
com.isomorphic.maven.util.HttpRequestManager
public class HttpRequestManager extends Object
A trivial convenience class, useful for login / logout operations on SmartClient and Reify
sites. Includes support for proxy servers.
-
Constructor Summary
Constructors Constructor Description HttpRequestManager(org.apache.http.HttpHost host, org.apache.http.auth.UsernamePasswordCredentials credentials, org.apache.maven.settings.Proxy proxyConfiguration)Constructor taking the host, login credentials, and any proxy needed to reach the given host. -
Method Summary
Modifier and Type Method Description org.apache.http.HttpResponseexecute(org.apache.http.client.methods.HttpRequestBase request)StringgetHostName()voidlogin()Ifcredentialshave been supplied, uses them to authenticate to the isomorphic web site, allowing download of protected resources.voidlogout()Logs off at smartclient.com.voidsetLoginUrl(String loginUrl)voidsetLogoutUrl(String logoutUrl)
-
Constructor Details
-
HttpRequestManager
public HttpRequestManager(org.apache.http.HttpHost host, org.apache.http.auth.UsernamePasswordCredentials credentials, org.apache.maven.settings.Proxy proxyConfiguration) throws org.apache.maven.plugin.MojoExecutionExceptionConstructor taking the host, login credentials, and any proxy needed to reach the given host.- Parameters:
host- An HttpHost representing the target site.credentials- The credentials needed for authentication on smartclient.com.proxyConfiguration- A Proxy configuration that can be used to set up the httpClient used during all communication to the server by this object- Throws:
org.apache.maven.plugin.MojoExecutionException- if there is any error during the attempt to detect and set up any proxy
-
-
Method Details
-
setLoginUrl
-
setLogoutUrl
-
getHostName
-
login
public void login() throws org.apache.maven.plugin.MojoExecutionExceptionIfcredentialshave been supplied, uses them to authenticate to the isomorphic web site, allowing download of protected resources.- Throws:
org.apache.maven.plugin.MojoExecutionException- on any error during login
-
logout
public void logout()Logs off at smartclient.com. -
execute
public org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpRequestBase request)
-