org.openid4java.discovery.html
Class HtmlResolver

java.lang.Object
  extended by org.openid4java.discovery.html.HtmlResolver

public class HtmlResolver
extends java.lang.Object

Author:
Marius Scurtescu, Johnny Bufu, Sutra Zhou

Field Summary
private  HttpFetcher _httpFetcher
           
private static org.apache.commons.logging.Log _log
           
private  int _maxRedirects
          Maximum number of redirects to be followed for the HTTP calls.
private static boolean DEBUG
           
private static HtmlParser HTML_PARSER
           
private static java.lang.String HTML_PARSER_CLASS_NAME_KEY
           
 
Constructor Summary
HtmlResolver(HttpFetcherFactory httpFetcherFactory)
           
 
Method Summary
 java.util.List discoverHtml(UrlIdentifier identifier)
          Performs HTML discovery on the supplied URL identifier.
 java.util.List discoverHtml(UrlIdentifier identifier, HttpFetcher httpFetcher)
          Performs HTML discovery on the supplied URL identifier.
private  java.util.List extractDiscoveryInformation(HtmlResult htmlResult)
          Extracts OpenID discovery endpoints from a HTML discovery result.
 int getMaxRedirects()
          Gets the internal limit configured for the maximum number of redirects to be followed for the HTTP calls.
 void setMaxRedirects(int maxRedirects)
          Sets the maximum number of redirects to be followed for the HTTP calls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private static org.apache.commons.logging.Log _log

DEBUG

private static final boolean DEBUG

HTML_PARSER_CLASS_NAME_KEY

private static final java.lang.String HTML_PARSER_CLASS_NAME_KEY
See Also:
Constant Field Values

HTML_PARSER

private static final HtmlParser HTML_PARSER

_httpFetcher

private final HttpFetcher _httpFetcher

_maxRedirects

private int _maxRedirects
Maximum number of redirects to be followed for the HTTP calls.

Constructor Detail

HtmlResolver

@Inject
public HtmlResolver(HttpFetcherFactory httpFetcherFactory)
Method Detail

getMaxRedirects

public int getMaxRedirects()
Gets the internal limit configured for the maximum number of redirects to be followed for the HTTP calls.


setMaxRedirects

public void setMaxRedirects(int maxRedirects)
Sets the maximum number of redirects to be followed for the HTTP calls.


discoverHtml

public java.util.List discoverHtml(UrlIdentifier identifier)
                            throws DiscoveryException
Performs HTML discovery on the supplied URL identifier.

Parameters:
identifier - The URL identifier.
Returns:
List of DiscoveryInformation entries discovered obtained from the URL Identifier.
Throws:
DiscoveryException

discoverHtml

public java.util.List discoverHtml(UrlIdentifier identifier,
                                   HttpFetcher httpFetcher)
                            throws DiscoveryException
Performs HTML discovery on the supplied URL identifier.

Parameters:
identifier - The URL identifier.
httpFetcher - HttpFetcher object to use for placing the call.
Returns:
List of DiscoveryInformation entries discovered obtained from the URL Identifier.
Throws:
DiscoveryException

extractDiscoveryInformation

private java.util.List extractDiscoveryInformation(HtmlResult htmlResult)
                                            throws DiscoveryException
Extracts OpenID discovery endpoints from a HTML discovery result.

Parameters:
htmlResult - HTML discovery result.
Returns:
List of DiscoveryInformation endpoints.
Throws:
DiscoveryException - when invalid information is discovered.


Copyright 2006-2008 Sxip Identity Corporation