mymobilesite.communication
Class LibertyMessage

java.lang.Object
  extended by org.ksoap2.SoapEnvelope
      extended by mymobilesite.communication.LibertyMessage
Direct Known Subclasses:
DiscoveryQuery, SaslMessage, WspRequest

public abstract class LibertyMessage
extends SoapEnvelope

This abstract class is the general purpose superclass of the specific Liberty messages sent from the mobile phone to the Identity Provider, Discovery Service and Web Service Provider.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
protected  Element correlationHeader
           
protected static java.lang.String disco
          The namespace for the Liberty Discovery Service.
protected  ResourceOffering offering
           
protected  java.lang.String receivedMessageID
           
protected static java.lang.String sa
          The namespace for the Liberty Authentication Service.
protected static java.lang.String sb
          The namespace for the Liberty SOAP Binding.
protected  Element securityHeader
           
protected  java.lang.String sentMessageID
           
protected static java.lang.String wsse
          The namespace for the WS-Security header.
 
Fields inherited from class org.ksoap2.SoapEnvelope
bodyIn, bodyOut, enc, ENC, ENC2001, encodingStyle, env, ENV, ENV2001, headerIn, headerOut, VER10, VER11, VER12, version, xsd, XSD, XSD1999, xsi, XSI, XSI1999
 
Constructor Summary
protected LibertyMessage()
          The constructor creates the SoapEnvelope with the correct SOAP version.
 
Method Summary
protected  void createCorrelationHeader(boolean second)
          Creates the Liberty SOAP Binding correlation header.
protected  void createSecurityHeader()
          Creates the WS-Security security header that contains the token specified in the ResourceOffering.
protected  void processCorrelationHeader()
          This method checks that the received message's correlation header is valid and throws MessageException if there is something wrong with the header.
protected abstract  void processResponse(Element current)
          This method processes the current element according to the rules of the implementing subclass.
protected  void processResponseBody(java.lang.String lookFor)
          This method looks for an Element in the response body and starts the subclass' specific response processing if the Element is found.
 
Methods inherited from class org.ksoap2.SoapEnvelope
parse, parseBody, parseHeader, setOutputSoapObject, stringToBoolean, write, writeBody, writeHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sb

protected static final java.lang.String sb
The namespace for the Liberty SOAP Binding.

See Also:
Constant Field Values

sa

protected static final java.lang.String sa
The namespace for the Liberty Authentication Service.

See Also:
Constant Field Values

wsse

protected static final java.lang.String wsse
The namespace for the WS-Security header.

See Also:
Constant Field Values

disco

protected static final java.lang.String disco
The namespace for the Liberty Discovery Service.

See Also:
Constant Field Values

sentMessageID

protected java.lang.String sentMessageID

receivedMessageID

protected java.lang.String receivedMessageID

correlationHeader

protected Element correlationHeader

securityHeader

protected Element securityHeader

offering

protected ResourceOffering offering
Constructor Detail

LibertyMessage

protected LibertyMessage()
The constructor creates the SoapEnvelope with the correct SOAP version.

Method Detail

createCorrelationHeader

protected void createCorrelationHeader(boolean second)
Creates the Liberty SOAP Binding correlation header.

Parameters:
second - boolean If this parameter is true it means that this message is sent in response to a previously received message.

createSecurityHeader

protected void createSecurityHeader()
Creates the WS-Security security header that contains the token specified in the ResourceOffering. This method is not used by the SaslMessage class.


processCorrelationHeader

protected void processCorrelationHeader()
                                 throws MessageException
This method checks that the received message's correlation header is valid and throws MessageException if there is something wrong with the header.

Throws:
MessageException

processResponseBody

protected void processResponseBody(java.lang.String lookFor)
                            throws MessageException
This method looks for an Element in the response body and starts the subclass' specific response processing if the Element is found. If it cannot find the Element, an exception is thrown.

Parameters:
lookFor - String The local name of the Element to look for.
Throws:
MessageException - If the Element couldn't be found or if the response body is invalid.

processResponse

protected abstract void processResponse(Element current)
                                 throws MessageException
This method processes the current element according to the rules of the implementing subclass.

Parameters:
current - Element The element that is to be processed.
Throws:
MessageException - If something wrong happens.