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.HttpResponse execute​(org.apache.http.client.methods.HttpRequestBase request)  
    String getHostName()  
    void login()
    If credentials have been supplied, uses them to authenticate to the isomorphic web site, allowing download of protected resources.
    void logout()
    Logs off at smartclient.com.
    void setLoginUrl​(String loginUrl)  
    void setLogoutUrl​(String logoutUrl)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.MojoExecutionException
      Constructor 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

      public void setLoginUrl​(String loginUrl)
    • setLogoutUrl

      public void setLogoutUrl​(String logoutUrl)
    • getHostName

      public String getHostName()
    • login

      public void login() throws org.apache.maven.plugin.MojoExecutionException
      If credentials have 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)