org.openid4java.infocard.rp
Class InfocardInvocation

java.lang.Object
  extended by org.openid4java.infocard.rp.InfocardInvocation

public class InfocardInvocation
extends java.lang.Object

Utility class to generate HTML or XHTLM snippets that express Relying Parties' requirements and invoke Infocard Selectors, requesting login with an OpenID Infocard.

Attribute Exchange Fetch Requests can be mapped to Infocard claim URIs.

Author:
Johnny Bufu

Field Summary
private  java.lang.String _issuer
          The issuer's URL for the accepted claims.
private  java.lang.String _issuerPolicy
          The issuer's WS-SecurityPolicy URL, if different than "/mex".
private static org.apache.commons.logging.Log _log
           
private  java.util.List _optionalClaims
          List of optional claim URIs.
private  java.lang.String _privacyUrl
          Relying Party's privacy URL.
private  int _privacyVersion
          Relying Party's privacy document version.
private  java.util.List _requiredClaims
          List of required claim URIs.
private  OpenIDTokenType _tokenType
          The requested token type (OpenID 1.1 or 2.0)
private static boolean DEBUG
           
 
Constructor Summary
InfocardInvocation(FetchRequest fetch)
          Creates an InfocardInvocation object from an Attribute Exchange Fetch Request.
InfocardInvocation(OpenIDTokenType tokenType)
          Creates a new InfocardInvocation object, describing Relying Party's requirements.
 
Method Summary
 void addClaim(java.lang.String claim, boolean required)
          Adds a claim URI to the required or optional claim list.
 java.lang.String arrayToString(java.util.List list)
          Converts a List of Strings to a space-separated string.
 java.util.List getClaims(boolean required)
          Gets required or optional claim URIs.
 java.lang.String getHtmlObject()
          Generates the HTML element used to describe the Relying Party's requirements and invoke the infocard selectors.
 java.lang.String getIssuer()
          Gets the issuer URL.
 java.lang.String getIssuerPolicy()
          Gets the issuer policy URL, if different than "/mex".
 java.lang.String getObjectParam(java.lang.String paramName, java.lang.String paramValue)
          Generates an HTML snippet for an parameter from a name-value pair.
 java.lang.String getPrivacyUrl()
          Gets the Relyin Party's privacy policy URL.
 int getPrivacyVersion()
          Gets the Relying Party's privacy document's version.
 OpenIDTokenType getTokenType()
          Gets the token type.
 java.lang.String getXhtml()
          Generates the XHTML snippet element used to describe the Relying Party's requirements and invoke the infocard selectors.
 void setClaims(java.util.List claims, boolean required)
          Sets the list of required or optional claim URIs.
 void setIssuer(java.lang.String issuer)
          Sets the issuer URL.
 void setIssuerPolicy(java.lang.String issuerPolicy)
          Sets the issuer policy URL, if different than "/mex".
 void setPrivacyData(java.lang.String url, int version)
          Sets the Relyin Party's privacy policy URL and version.
 void setTokenType(OpenIDTokenType tokenType)
          Sets the token type.
 
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

_tokenType

private OpenIDTokenType _tokenType
The requested token type (OpenID 1.1 or 2.0)


_requiredClaims

private java.util.List _requiredClaims
List of required claim URIs. The OpenID Identifier claim is always part of the list.


_optionalClaims

private java.util.List _optionalClaims
List of optional claim URIs.


_issuer

private java.lang.String _issuer
The issuer's URL for the accepted claims.


_issuerPolicy

private java.lang.String _issuerPolicy
The issuer's WS-SecurityPolicy URL, if different than "/mex".


_privacyUrl

private java.lang.String _privacyUrl
Relying Party's privacy URL.


_privacyVersion

private int _privacyVersion
Relying Party's privacy document version. When selectors notice a change in this value, users are prompted with the privacy policy document retrieved from the privacyUrl.

Constructor Detail

InfocardInvocation

public InfocardInvocation(OpenIDTokenType tokenType)
Creates a new InfocardInvocation object, describing Relying Party's requirements.

Parameters:
tokenType - The required token type.

InfocardInvocation

public InfocardInvocation(FetchRequest fetch)
Creates an InfocardInvocation object from an Attribute Exchange Fetch Request.

Attriute type URIs are mapped to Infocard claim URIs. Attribute value count and update_url features are cannot be expressed in InfocardInvocation data structures.

Parameters:
fetch - The Fetch Request.
Method Detail

getTokenType

public OpenIDTokenType getTokenType()
Gets the token type.


setTokenType

public void setTokenType(OpenIDTokenType tokenType)
Sets the token type.

Parameters:
tokenType -

getClaims

public java.util.List getClaims(boolean required)
Gets required or optional claim URIs.

The OpenID Identifier claim is always part of the required claims list.

Parameters:
required - If true, the required claims are returned; optional claims are returned otherwise.
Returns:
The list of configured required/optional claims.

addClaim

public void addClaim(java.lang.String claim,
                     boolean required)
Adds a claim URI to the required or optional claim list.

Parameters:
claim - The claim URI to be added.
required - If true, the clai is added to the required claims list, otherwise it is added to the optional claims list.

setClaims

public void setClaims(java.util.List claims,
                      boolean required)
Sets the list of required or optional claim URIs.

If the required claim list is set, and the OpenID Identifier claim is not part of the provided list, it is added transparently to the list.

Parameters:
claims - List of claim URIs.
required - If true, the required claims list is set, otherwise the optional claims list is set.

getIssuer

public java.lang.String getIssuer()
Gets the issuer URL.


setIssuer

public void setIssuer(java.lang.String issuer)
Sets the issuer URL.

Parameters:
issuer -

getIssuerPolicy

public java.lang.String getIssuerPolicy()
Gets the issuer policy URL, if different than "/mex".


setIssuerPolicy

public void setIssuerPolicy(java.lang.String issuerPolicy)
Sets the issuer policy URL, if different than "/mex".


getPrivacyUrl

public java.lang.String getPrivacyUrl()
Gets the Relyin Party's privacy policy URL.


getPrivacyVersion

public int getPrivacyVersion()
Gets the Relying Party's privacy document's version.


setPrivacyData

public void setPrivacyData(java.lang.String url,
                           int version)
Sets the Relyin Party's privacy policy URL and version.

When selectors notice a change in this value, users are prompted with the privacy policy document retrieved from the privacyUrl.


getHtmlObject

public java.lang.String getHtmlObject()
Generates the HTML element used to describe the Relying Party's requirements and invoke the infocard selectors.


getXhtml

public java.lang.String getXhtml()
Generates the XHTML snippet element used to describe the Relying Party's requirements and invoke the infocard selectors.


getObjectParam

public java.lang.String getObjectParam(java.lang.String paramName,
                                       java.lang.String paramValue)
Generates an HTML snippet for an parameter from a name-value pair.


arrayToString

public java.lang.String arrayToString(java.util.List list)
Converts a List of Strings to a space-separated string.



Copyright 2006-2008 Sxip Identity Corporation