org.openid4java.message.ax
Class AxPayload

java.lang.Object
  extended by org.openid4java.message.ax.AxMessage
      extended by org.openid4java.message.ax.AxPayload
All Implemented Interfaces:
MessageExtension, MessageExtensionFactory
Direct Known Subclasses:
FetchResponse, StoreRequest

public abstract class AxPayload
extends AxMessage

Author:
jbufu

Field Summary
 
Fields inherited from class org.openid4java.message.ax.AxMessage
_parameters, OPENID_NS_AX
 
Constructor Summary
AxPayload()
           
 
Method Summary
 java.lang.String addAttribute(java.lang.String typeUri, java.lang.String value)
          Adds an attribute to the attribute payload, without the caller having to specify an alias.
 void addAttribute(java.lang.String alias, java.lang.String typeUri, java.lang.String value)
          Adds an attribute to the attribute payload.
 void addAttributes(java.util.Map attributes)
          Adds the attributes in the supplied Map to the attribute payload.
 java.lang.String getAttributeAlias(java.lang.String typeUri)
          Gets the alias for an attribute type URI, if present.
 java.util.List getAttributeAliases()
          Gets a list of attribute aliases.
 java.util.Map getAttributes()
          Gets a map with attribute aliases -> list of values.
 java.util.Map getAttributeTypes()
          Gets a map with attribute aliases -> attribute type URI.
 java.lang.String getAttributeTypeUri(java.lang.String alias)
          Get typeURI value for the specified attribute alias.
 java.lang.String getAttributeValue(java.lang.String alias)
          Gets the (first) value for the specified attribute alias.
 java.lang.String getAttributeValueByTypeUri(java.lang.String typeUri)
          Gets the (first) value for the specified attribute type URI.
 java.util.List getAttributeValues(java.lang.String alias)
          Returns a list with the attribute value(s) associated for the specified attribute alias.
 java.util.List getAttributeValuesByTypeUri(java.lang.String typeUri)
          Returns a list with the attribute value(s) associated for the specified attribute type URI.
 int getCount(java.lang.String alias)
          Gets the number of values provided in the attribute payload for the specified attribute alias.
protected  boolean isValid()
           
 
Methods inherited from class org.openid4java.message.ax.AxMessage
getExtension, getParameters, getParameterValue, getTypeUri, providesIdentifier, setParameters, signRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxPayload

public AxPayload()
Method Detail

addAttribute

public void addAttribute(java.lang.String alias,
                         java.lang.String typeUri,
                         java.lang.String value)
                  throws MessageException
Adds an attribute to the attribute payload.

Parameters:
alias - The alias identifier that will be associated with the attribute type URI.
typeUri - The attribute type URI.
value - The value of the attribute.
Throws:
MessageException

addAttribute

public java.lang.String addAttribute(java.lang.String typeUri,
                                     java.lang.String value)
Adds an attribute to the attribute payload, without the caller having to specify an alias. An alias in the form "attrNN" will be automatically generated.

Parameters:
typeUri - The attribute type URI.
value - The attribute value.
Returns:
The generated attribute alias.

addAttributes

public void addAttributes(java.util.Map attributes)
Adds the attributes in the supplied Map to the attribute payload. A requested count of 1 is assumed for each attribute in the map.

Parameters:
attributes - Map.

getAttributeValues

public java.util.List getAttributeValues(java.lang.String alias)
Returns a list with the attribute value(s) associated for the specified attribute alias.

Parameters:
alias - The attribute alias.
Returns:
List of attribute values.

getAttributeTypeUri

public java.lang.String getAttributeTypeUri(java.lang.String alias)
Get typeURI value for the specified attribute alias.


getAttributeAlias

public java.lang.String getAttributeAlias(java.lang.String typeUri)
Gets the alias for an attribute type URI, if present.

Parameters:
typeUri - the attribyte type URI for which the alias is looked up
Returns:
the attribute alias if present in the message, or null otherwise

getAttributeValueByTypeUri

public java.lang.String getAttributeValueByTypeUri(java.lang.String typeUri)
Gets the (first) value for the specified attribute type URI.

Parameters:
typeUri -
Returns:

getAttributeValuesByTypeUri

public java.util.List getAttributeValuesByTypeUri(java.lang.String typeUri)
Returns a list with the attribute value(s) associated for the specified attribute type URI.

Parameters:
typeUri - The attribute type URI.
Returns:
List of attribute values.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String alias)
Gets the (first) value for the specified attribute alias.


getAttributeAliases

public java.util.List getAttributeAliases()
Gets a list of attribute aliases.


getAttributes

public java.util.Map getAttributes()
Gets a map with attribute aliases -> list of values.


getAttributeTypes

public java.util.Map getAttributeTypes()
Gets a map with attribute aliases -> attribute type URI.


getCount

public int getCount(java.lang.String alias)
Gets the number of values provided in the attribute payload for the specified attribute alias.

Parameters:
alias - The attribute alias.

isValid

protected boolean isValid()


Copyright © 2011 Sxip. All Rights Reserved.