edu.wisc.my.webproxy.beans.http
Class HttpManager

java.lang.Object
  extended by edu.wisc.my.webproxy.beans.http.HttpManager
All Implemented Interfaces:
ProxyComponent
Direct Known Subclasses:
HttpManagerImpl

public abstract class HttpManager
extends Object
implements ProxyComponent

This interface is what the portlet uses to make requests. The implementation will be responsible for using the data provided in the Request interface to make the remote request and construct a Response object with the results.

Version:
Author:
nramzan

Constructor Summary
HttpManager()
           
 
Method Summary
abstract  void addCookie(org.apache.http.cookie.Cookie cookie)
          Add a cookie to the HttpManager.
abstract  void addCookies(org.apache.http.cookie.Cookie[] cookie)
          Add an array of cookies to the HttpManager.
abstract  void clearCookies()
          Clear all cookies currently available in the HttpManager.
abstract  Request createRequest()
          Creates an empty request object.
abstract  Response doRequest(Request request)
          Performs the request with the given request object.
 ReadWriteLock getCookieLock()
           
abstract  List<org.apache.http.cookie.Cookie> getCookies()
          Return a list of all currently set cookies in the HttpManager.
abstract  org.apache.http.auth.Credentials getCredentials()
          Return the user authentication credentials.
 void setActionData(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          This method is called on a component that is being used by the portlet at the begining of the action request it will be used in.
abstract  void setCredentials(org.apache.http.auth.Credentials credentials)
          Set the user authentication credentials.
 void setRenderData(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          This method is called on a component that is being used by the portlet at the begining of the render request it will be used in.
abstract  void setup(javax.portlet.PortletRequest request)
          Responsible for setting up the HttpManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.wisc.my.webproxy.beans.config.ProxyComponent
clearData, getName
 

Constructor Detail

HttpManager

public HttpManager()
Method Detail

doRequest

public abstract Response doRequest(Request request)
                            throws HttpTimeoutException,
                                   IOException
Performs the request with the given request object.

Parameters:
request - the (@link Request) object that contains all the necessary data to make the remote request.
Returns:
response the (@link Response) object that contains the result/content of the the request made.
Throws:
HttpTimeoutException
IOException

createRequest

public abstract Request createRequest()
Creates an empty request object.

Returns:
request the (@link Request) object with no attributes set on it

setup

public abstract void setup(javax.portlet.PortletRequest request)
Responsible for setting up the HttpManager. This component must be callable from a servlet as well so the portlet request and response methods are not available. This method *must* be called prior to attempting to use the HttpManager.

Parameters:
prefs - The preferences to use for configuration.

setCredentials

public abstract void setCredentials(org.apache.http.auth.Credentials credentials)
Set the user authentication credentials.

Parameters:
credentials -

getCredentials

public abstract org.apache.http.auth.Credentials getCredentials()
Return the user authentication credentials.

Returns:

addCookie

public abstract void addCookie(org.apache.http.cookie.Cookie cookie)
Add a cookie to the HttpManager.

Parameters:
cookie -

addCookies

public abstract void addCookies(org.apache.http.cookie.Cookie[] cookie)
Add an array of cookies to the HttpManager.

Parameters:
cookie -

clearCookies

public abstract void clearCookies()
Clear all cookies currently available in the HttpManager.


getCookies

public abstract List<org.apache.http.cookie.Cookie> getCookies()
Return a list of all currently set cookies in the HttpManager.

Returns:

setRenderData

public final void setRenderData(javax.portlet.RenderRequest request,
                                javax.portlet.RenderResponse response)
Description copied from interface: ProxyComponent
This method is called on a component that is being used by the portlet at the begining of the render request it will be used in. It provides the component with a reference to the request and response objects to use.

Specified by:
setRenderData in interface ProxyComponent

setActionData

public final void setActionData(javax.portlet.ActionRequest request,
                                javax.portlet.ActionResponse response)
Description copied from interface: ProxyComponent
This method is called on a component that is being used by the portlet at the begining of the action request it will be used in. It provides the component with a reference to the request and response objects to use.

Specified by:
setActionData in interface ProxyComponent

getCookieLock

public final ReadWriteLock getCookieLock()


Copyright © 2010 Jasig. All Rights Reserved.