org.openid4java.util
Interface HttpFetcher

All Known Implementing Classes:
AbstractHttpFetcher, HttpCache

public interface HttpFetcher

Interface for fetching HTTP requests. The default implementation caches responses, but can be replaced by custom implementations.


Method Summary
 HttpResponse get(java.lang.String url)
          GETs a HTTP URL.
 HttpResponse get(java.lang.String url, HttpRequestOptions requestOptions)
          GETs a HTTP URL.
 HttpRequestOptions getDefaultRequestOptions()
          Returns the default HttpRequestOptions.
 HttpRequestOptions getRequestOptions()
          Gets a clone of the default HttpRequestOptions.
 HttpResponse head(java.lang.String url)
           
 HttpResponse head(java.lang.String url, HttpRequestOptions requestOptions)
           
 HttpResponse post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters)
           
 HttpResponse post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> parameters, HttpRequestOptions requestOptions)
           
 void setDefaultRequestOptions(HttpRequestOptions defaultOptions)
           
 

Method Detail

getDefaultRequestOptions

HttpRequestOptions getDefaultRequestOptions()
Returns the default HttpRequestOptions. Note that this does not return a clone, so manipulating the object returned here will manipulate the HttpRequestOptions used by the HttpFetcher.


getRequestOptions

HttpRequestOptions getRequestOptions()
Gets a clone of the default HttpRequestOptions.


setDefaultRequestOptions

void setDefaultRequestOptions(HttpRequestOptions defaultOptions)

get

HttpResponse get(java.lang.String url)
                 throws java.io.IOException
GETs a HTTP URL. A cached copy will be returned if one exists.

Parameters:
url - The HTTP URL to GET.
Returns:
A HttpResponse object containing the fetched data.
Throws:
java.io.IOException
See Also:
HttpResponse

get

HttpResponse get(java.lang.String url,
                 HttpRequestOptions requestOptions)
                 throws java.io.IOException
GETs a HTTP URL. A cached copy will be returned if one exists and the supplied options match it.

Parameters:
url - The HTTP URL to GET.
Returns:
A HttpResponse object containing the fetched data.
Throws:
java.io.IOException
See Also:
HttpRequestOptions, HttpResponse

head

HttpResponse head(java.lang.String url)
                  throws java.io.IOException
Throws:
java.io.IOException

head

HttpResponse head(java.lang.String url,
                  HttpRequestOptions requestOptions)
                  throws java.io.IOException
Throws:
java.io.IOException

post

HttpResponse post(java.lang.String url,
                  java.util.Map<java.lang.String,java.lang.String> parameters)
                  throws java.io.IOException
Throws:
java.io.IOException

post

HttpResponse post(java.lang.String url,
                  java.util.Map<java.lang.String,java.lang.String> parameters,
                  HttpRequestOptions requestOptions)
                  throws java.io.IOException
Throws:
java.io.IOException


Copyright 2006-2008 Sxip Identity Corporation