org.openid4java.message
Class AssociationRequest

java.lang.Object
  extended by org.openid4java.message.Message
      extended by org.openid4java.message.AssociationRequest

public class AssociationRequest
extends Message

The OpenID Association Request message.

Handles OpenID 2.0 and OpenID 1.x messages.

Author:
Marius Scurtescu, Johnny Bufu
See Also:
AssociationSessionType

Field Summary
static java.lang.String MODE_ASSOC
           
protected static java.util.List optionalFields
           
protected static java.util.List requiredFields
           
 
Fields inherited from class org.openid4java.message.Message
_destinationUrl, MODE_CANCEL, MODE_IDRES, MODE_SETUP_NEEDED, OPENID2_NS
 
Constructor Summary
protected AssociationRequest(AssociationSessionType type)
          Creates an Association Request message with the specified association type and "no-encryption" session.
protected AssociationRequest(AssociationSessionType type, DiffieHellmanSession dhSess)
          Constructs an AssociationRequest message with the specified association type and Diffie-Hellman session.
protected AssociationRequest(ParameterList params)
          Constructs an AssociationRequest message from a parameter list.
 
Method Summary
static AssociationRequest createAssociationRequest(AssociationSessionType type)
           
static AssociationRequest createAssociationRequest(AssociationSessionType type, DiffieHellmanSession dhSess)
           
static AssociationRequest createAssociationRequest(ParameterList params)
           
 java.lang.String getDhGen()
          Gets the Diffie-Hellman generator parameter of the message, or null for messages with no-encryption sessions.
 java.lang.String getDhModulus()
          Gets the Diffie-Hellman modulus parameter of the message, or null for messages with no-encryption sessions.
 java.lang.String getDhPublicKey()
          Gets the Relying Party's (consumer) Diffie-Hellman public key, or null for messages with no-encryption sessions.
 DiffieHellmanSession getDHSess()
          Gets the Diffie-Hellman session Null for no-encryption association requests.
 java.util.List getRequiredFields()
           
 AssociationSessionType getType()
          Gets the association / session type of the association request.
 boolean isVersion2()
          Returns true for OpenID 2.0 messages, false otherwise.
 void validate()
          Checks if the message is a valid OpenID Association Request.
 
Methods inherited from class org.openid4java.message.Message
addExtension, addExtensionFactory, createMessage, createMessage, getDestinationUrl, getExtension, getExtensionAlias, getExtensionFactory, getExtensions, getParameter, getParameterMap, getParameters, getParameterValue, hasExtension, hasExtensionFactory, hasParameter, keyValueFormEncoding, set, wwwFormEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_ASSOC

public static final java.lang.String MODE_ASSOC
See Also:
Constant Field Values

requiredFields

protected static final java.util.List requiredFields

optionalFields

protected static final java.util.List optionalFields
Constructor Detail

AssociationRequest

protected AssociationRequest(AssociationSessionType type)
Creates an Association Request message with the specified association type and "no-encryption" session.

The supplied type must be one of the "no-encryption" types, otherwise a DiffieHellman session is required.

See Also:
AssociationRequest(AssociationSessionType, DiffieHellmanSession)

AssociationRequest

protected AssociationRequest(AssociationSessionType type,
                             DiffieHellmanSession dhSess)
Constructs an AssociationRequest message with the specified association type and Diffie-Hellman session.

Parameters:
dhSess - Diffie-Hellman session to be used for this association; if null, a "no-encryption" session is created.

AssociationRequest

protected AssociationRequest(ParameterList params)
Constructs an AssociationRequest message from a parameter list.

Useful for processing incoming messages.

Method Detail

createAssociationRequest

public static AssociationRequest createAssociationRequest(AssociationSessionType type)
                                                   throws MessageException
Throws:
MessageException

createAssociationRequest

public static AssociationRequest createAssociationRequest(AssociationSessionType type,
                                                          DiffieHellmanSession dhSess)
                                                   throws MessageException
Throws:
MessageException

createAssociationRequest

public static AssociationRequest createAssociationRequest(ParameterList params)
                                                   throws MessageException
Throws:
MessageException

getRequiredFields

public java.util.List getRequiredFields()
Overrides:
getRequiredFields in class Message

isVersion2

public boolean isVersion2()
Returns true for OpenID 2.0 messages, false otherwise.


getType

public AssociationSessionType getType()
                               throws AssociationException
Gets the association / session type of the association request.

Throws:
AssociationException

getDHSess

public DiffieHellmanSession getDHSess()
Gets the Diffie-Hellman session Null for no-encryption association requests.


getDhModulus

public java.lang.String getDhModulus()
Gets the Diffie-Hellman modulus parameter of the message, or null for messages with no-encryption sessions.


getDhGen

public java.lang.String getDhGen()
Gets the Diffie-Hellman generator parameter of the message, or null for messages with no-encryption sessions.


getDhPublicKey

public java.lang.String getDhPublicKey()
Gets the Relying Party's (consumer) Diffie-Hellman public key, or null for messages with no-encryption sessions.


validate

public void validate()
              throws MessageException
Checks if the message is a valid OpenID Association Request.

Overrides:
validate in class Message
Throws:
MessageException - if message validation failed.


Copyright © 2011 Sxip. All Rights Reserved.