public class Message
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_destinationUrl |
private java.util.Map |
_extAliases |
private int |
_extCounter |
private static java.util.Map |
_extensionFactories |
private java.util.Map |
_extesion |
private static org.apache.commons.logging.Log |
_log |
private ParameterList |
_params |
private static boolean |
DEBUG |
static java.lang.String |
MODE_CANCEL |
static java.lang.String |
MODE_IDRES |
static java.lang.String |
MODE_SETUP_NEEDED |
static java.lang.String |
OPENID2_NS |
Modifier | Constructor and Description |
---|---|
protected |
Message() |
protected |
Message(ParameterList params) |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(MessageExtension extension)
Adds a set of extension-specific parameters to a message.
|
static void |
addExtensionFactory(java.lang.Class clazz)
Adds a new extension factory.
|
static Message |
createMessage() |
static Message |
createMessage(ParameterList params) |
java.lang.String |
getDestinationUrl(boolean httpGet)
Gets the URL where the message should be sent, where applicable.
|
MessageExtension |
getExtension(java.lang.String typeUri)
Gets a MessageExtension for the specified Type URI if an implementation
is available, or null otherwise.
|
java.lang.String |
getExtensionAlias(java.lang.String extensionTypeUri)
Retrieves the extension alias that will be used for the extension
identified by the supplied extension type URI.
|
static MessageExtensionFactory |
getExtensionFactory(java.lang.String typeUri)
Gets a MessageExtensionFactory for the specified Type URI
if an implementation is available, or null otherwise.
|
private ParameterList |
getExtensionParams(java.lang.String extensionTypeUri)
Retrieves the parameters associated with a protocol extension,
specified by the given extension type URI.
|
java.util.Set |
getExtensions()
Gets a set of extension Type URIs that are present in the message.
|
protected Parameter |
getParameter(java.lang.String name) |
java.util.Map |
getParameterMap() |
protected java.util.List |
getParameters() |
java.lang.String |
getParameterValue(java.lang.String name) |
java.util.List |
getRequiredFields() |
boolean |
hasExtension(java.lang.String typeUri)
Returns true if the message has parameters for the specified
extension type URI.
|
static boolean |
hasExtensionFactory(java.lang.String typeUri)
Returns true if there is an extension factory available for extension
identified by the specified Type URI, or false otherwise.
|
boolean |
hasParameter(java.lang.String name) |
java.lang.String |
keyValueFormEncoding() |
protected void |
set(java.lang.String name,
java.lang.String value) |
void |
validate()
Checks that all required parameters are present
|
java.lang.String |
wwwFormEncoding() |
private static org.apache.commons.logging.Log _log
private static final boolean DEBUG
public static final java.lang.String MODE_IDRES
public static final java.lang.String MODE_CANCEL
public static final java.lang.String MODE_SETUP_NEEDED
public static final java.lang.String OPENID2_NS
private ParameterList _params
private int _extCounter
private java.util.Map _extAliases
private java.util.Map _extesion
protected java.lang.String _destinationUrl
private static java.util.Map _extensionFactories
protected Message()
protected Message(ParameterList params)
public static Message createMessage() throws MessageException
MessageException
public static Message createMessage(ParameterList params) throws MessageException
MessageException
protected Parameter getParameter(java.lang.String name)
public java.lang.String getParameterValue(java.lang.String name)
public boolean hasParameter(java.lang.String name)
protected void set(java.lang.String name, java.lang.String value)
protected java.util.List getParameters()
public java.util.Map getParameterMap()
public void validate() throws MessageException
MessageException
public java.util.List getRequiredFields()
public java.lang.String keyValueFormEncoding()
public java.lang.String wwwFormEncoding()
public java.lang.String getDestinationUrl(boolean httpGet)
httpGet
- If true, the wwwFormEncoding() is appended to the
destination URL; the return value should be used
with a GET-redirect.
If false, the verbatim destination URL is returned,
which should be used with a FORM POST redirect.wwwFormEncoding()
public static void addExtensionFactory(java.lang.Class clazz) throws MessageException
clazz
- The implementation class for the extension factory,
must implement MessageExtensionFactory
.MessageException
public static boolean hasExtensionFactory(java.lang.String typeUri)
typeUri
- The Type URI that identifies an extension.public static MessageExtensionFactory getExtensionFactory(java.lang.String typeUri)
typeUri
- The Type URI that identifies a extension.Message
public boolean hasExtension(java.lang.String typeUri)
typeUri
- The URI that identifies the extension.public java.util.Set getExtensions()
public java.lang.String getExtensionAlias(java.lang.String extensionTypeUri)
If the message contains no parameters for the specified extension, null will be returned.
extensionTypeUri
- The URI that identifies the extensionpublic void addExtension(MessageExtension extension) throws MessageException
The parameter names must NOT contain the "openid.
extension
- A MessageExtension containing parameters
to be added to the messageMessageException
private ParameterList getExtensionParams(java.lang.String extensionTypeUri)
The "openid.ns.
extensionTypeUri
- The type URI that identifies the extensionpublic MessageExtension getExtension(java.lang.String typeUri) throws MessageException
The returned object will contain the parameters from the message belonging to the specified extension.
typeUri
- The Type URI that identifies a extension.MessageException
Copyright 2006-2008 Sxip Identity Corporation