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

Field Summary
private  int _connTimeout
          HTTP connect timeout, in milliseconds.
private static org.apache.commons.logging.Log _log
           
private  int _maxHtmlSize
          Maximum length (in bytes) to read when parsing a HTML response.
private  int _maxRedirects
          Maximum number of redirects to be followed for the HTTP calls.
private  int _socketTimeout
          HTTP socket (read) timeout, in milliseconds.
private static boolean DEBUG
           
 
Constructor Summary
HtmlResolver()
           
 
Method Summary
private  java.lang.String call(java.net.URL url, HtmlResult result)
          Performs a HTTP call on the provided URL identifier.
 HtmlResult discover(UrlIdentifier identifier)
          Performs HTML discovery on the supplied URL identifier.
 int getConnTimeout()
          Gets the HTTP connect timeout, in milliseconds.
 int getMaxHtmlSize()
          Gets the aximum length (in bytes) to read when parsing a HTML response.
 int getMaxRedirects()
          Gets the internal limit configured for the maximum number of redirects to be followed for the HTTP calls.
 int getSocketTimeout()
          Gets the HTTP socket (read) timeout, in milliseconds.
private  void parseHtml(java.lang.String htmlData, HtmlResult result)
          Parses the HTML data and stores in the result the discovered openid information.
 void setConnTimeout(int connTimeout)
          Sets the HTTP connect timeout, in milliseconds.
 void setMaxHtmlSize(int maxHtmlSize)
          Sets maximum length (in bytes) to read when parsing a HTML response.
 void setMaxRedirects(int maxRedirects)
          Sets the maximum number of redirects to be followed for the HTTP calls.
 void setSocketTimeout(int socketTimeout)
          Sets HTTP socket (read) timeout, in milliseconds.
 
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

_maxRedirects

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


_maxHtmlSize

private int _maxHtmlSize
Maximum length (in bytes) to read when parsing a HTML response.


_connTimeout

private int _connTimeout
HTTP connect timeout, in milliseconds.


_socketTimeout

private int _socketTimeout
HTTP socket (read) timeout, in milliseconds.

Constructor Detail

HtmlResolver

public HtmlResolver()
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.


getMaxHtmlSize

public int getMaxHtmlSize()
Gets the aximum length (in bytes) to read when parsing a HTML response.


setMaxHtmlSize

public void setMaxHtmlSize(int maxHtmlSize)
Sets maximum length (in bytes) to read when parsing a HTML response.


getConnTimeout

public int getConnTimeout()
Gets the HTTP connect timeout, in milliseconds.


setConnTimeout

public void setConnTimeout(int connTimeout)
Sets the HTTP connect timeout, in milliseconds.


getSocketTimeout

public int getSocketTimeout()
Gets the HTTP socket (read) timeout, in milliseconds.


setSocketTimeout

public void setSocketTimeout(int socketTimeout)
Sets HTTP socket (read) timeout, in milliseconds.


discover

public HtmlResult discover(UrlIdentifier identifier)
                    throws DiscoveryException
Performs HTML discovery on the supplied URL identifier.

Parameters:
identifier - The URL identifier.
Returns:
HTML discovery data obtained from the URL.
Throws:
DiscoveryException

call

private java.lang.String call(java.net.URL url,
                              HtmlResult result)
                       throws DiscoveryException
Performs a HTTP call on the provided URL identifier.

Parameters:
url - The URL identifier.
result - The HTML discovery result, in which the claimed identifier is set to the input URL after following redirects.
Returns:
The retrieved HTML data.
Throws:
DiscoveryException

parseHtml

private void parseHtml(java.lang.String htmlData,
                       HtmlResult result)
                throws DiscoveryException
Parses the HTML data and stores in the result the discovered openid information.

Parameters:
htmlData - HTML data obtained from the URL identifier.
result - The HTML result.
Throws:
DiscoveryException


Copyright 2006-2007 Sxip Identity Corporation