org.openid4java.message.sreg
Class SRegRequest

java.lang.Object
  extended by org.openid4java.message.sreg.SRegMessage
      extended by org.openid4java.message.sreg.SRegRequest
All Implemented Interfaces:
MessageExtension, MessageExtensionFactory

public class SRegRequest
extends SRegMessage

Implements the extension for Simple Registration fetch requests.

Author:
Marius Scurtescu, Johnny Bufu
See Also:
Message

Field Summary
 
Fields inherited from class org.openid4java.message.sreg.SRegMessage
_parameters, OPENID_NS_SREG, OPENID_NS_SREG11
 
Constructor Summary
protected SRegRequest()
          Constructs a SReg Request with an empty parameter list.
protected SRegRequest(ParameterList params)
          Constructs a SRegRequest from a parameter list.
 
Method Summary
 void addAttribute(java.lang.String attr, boolean required)
          Adds an attribute to the SReg request.
static SRegRequest createFetchRequest()
          Constructs a SReg Request with an empty parameter list.
static SRegRequest createSRegRequest(ParameterList params)
          Constructs a SRegRequest from a parameter list.
 java.util.List getAttributes()
          Gets all requested attributes (required and optional).
 java.util.List getAttributes(boolean required)
          Returns a map with the requested attributes.
 java.lang.String getUpdateUrl()
          Gets the optional policy URL parameter if available, or null otherwise.
 boolean isValid()
          Checks the validity of the extension.
 void setPolicyUrl(java.lang.String policyUrl)
          Sets the optional policy URL.
 
Methods inherited from class org.openid4java.message.sreg.SRegMessage
getExtension, getParameters, getParameterValue, getTypeUri, multivalDecode, multivalEncode, providesIdentifier, setParameters, setTypeUri, signRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRegRequest

protected SRegRequest()
Constructs a SReg Request with an empty parameter list.


SRegRequest

protected SRegRequest(ParameterList params)
Constructs a SRegRequest 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

createFetchRequest

public static SRegRequest createFetchRequest()
Constructs a SReg Request with an empty parameter list.


createSRegRequest

public static SRegRequest createSRegRequest(ParameterList params)
                                     throws MessageException
Constructs a SRegRequest 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 attr,
                         boolean required)
Adds an attribute to the SReg request.

Parameters:
attr - A requested attribute name.
required - If true, marks the attribute as 'required'; 'if_available' otherwise.

getAttributes

public java.util.List getAttributes(boolean required)
Returns a map with the requested attributes.

Parameters:
required - If set to true the list of 'required' attributes is returned, otherwise the list of 'optional' attributes.
Returns:
List of attribute names.

getAttributes

public java.util.List getAttributes()
Gets all requested attributes (required and optional).

Returns:
List of attribute names.

setPolicyUrl

public void setPolicyUrl(java.lang.String policyUrl)
                  throws MessageException
Sets the optional policy URL.

Parameters:
policyUrl - A URL which the Consumer provides to give the End User a place to read about the how the profile data will be used. The Identity Provider SHOULD display this URL to the End User if it is given.
Throws:
MessageException

getUpdateUrl

public java.lang.String getUpdateUrl()
Gets the optional policy URL parameter if available, or null otherwise.


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.


Copyright © 2011 Sxip. All Rights Reserved.