org.openid4java.message.ax
Class StoreRequest

java.lang.Object
  extended by org.openid4java.message.ax.AxMessage
      extended by org.openid4java.message.ax.StoreRequest
All Implemented Interfaces:
MessageExtension, MessageExtensionFactory

public class StoreRequest
extends AxMessage

Implements the extension for Attribute Exchange store requests.

Author:
Marius Scurtescu, Johnny Bufu

Field Summary
private static org.apache.commons.logging.Log _log
           
private static boolean DEBUG
           
 
Fields inherited from class org.openid4java.message.ax.AxMessage
_parameters, OPENID_NS_AX
 
Constructor Summary
protected StoreRequest()
          Constructs a Store Request with an empty parameter list.
protected StoreRequest(ParameterList params)
          Constructs a StoreRequest from a parameter list.
 
Method Summary
 void addAttribute(java.lang.String alias, java.lang.String typeUri, java.lang.String value)
          Adds an attribute to the store request.
private  boolean checkAttributes()
           
static StoreRequest createStoreRequest()
          Constructs a Store Request with an empty parameter list.
static StoreRequest createStoreRequest(ParameterList params)
          Constructs a StoreRequest from a parameter list.
 java.util.List getAttributeAliases()
          Gets a list of attribute aliases.
 java.util.Map getAttributes()
          Gets a map with attribute aliases -> list of values.
 java.lang.String getAttributeValue(java.lang.String alias)
          Gets the (first) for the specified attribute alias.
 java.util.List getAttributeValues(java.lang.String alias)
          Returns a list with the attribute value(s) associated with the specified alias.
 int getCount(java.lang.String alias)
          Gets the number of values provided in the fetch response for the specified attribute alias.
 boolean isValid()
          Checks the validity of the extension.
private  void setCount(java.lang.String alias, int count)
          Sets the number of values provided in the fetch response for the specified attribute alias.
 
Methods inherited from class org.openid4java.message.ax.AxMessage
getExtension, getParameters, getParameterValue, getTypeUri, providesIdentifier, setParameters
 
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
Constructor Detail

StoreRequest

protected StoreRequest()
Constructs a Store Request with an empty parameter list.


StoreRequest

protected StoreRequest(ParameterList params)
Constructs a StoreRequest from a parameter list.

The parameter list can be extracted from a received message with the getExtensionParams method of the Message class, and MUST NOT contain the "openid.." prefix.

Method Detail

createStoreRequest

public static StoreRequest createStoreRequest()
Constructs a Store Request with an empty parameter list.


createStoreRequest

public static StoreRequest createStoreRequest(ParameterList params)
                                       throws MessageException
Constructs a StoreRequest from a parameter list.

The parameter list can be extracted from a received message with the getExtensionParams method of the Message class, and MUST NOT contain the "openid.." prefix.

Throws:
MessageException

addAttribute

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

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

getAttributeValues

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

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

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String alias)
Gets the (first) 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.


getCount

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

Parameters:
alias - The attribute alias.

setCount

private void setCount(java.lang.String alias,
                      int count)
Sets the number of values provided in the fetch response for the specified attribute alias. The value must be greater than 1.

Parameters:
alias - The attribute alias.
count - The number of values.

isValid

public boolean isValid()
Checks the validity of the extension.

Used when constructing a extension from a parameter list.

Returns:
True if the extension is valid, false otherwise.

checkAttributes

private boolean checkAttributes()


Copyright 2006-2007 Sxip Identity Corporation