mymobilesite.communication
Class AuthTransport

java.lang.Object
  extended by org.ksoap2.transport.Transport
      extended by mymobilesite.communication.AuthTransport

public class AuthTransport
extends Transport

This class is responsible for establishing the session with the Identity Provider and sending the SaslMessages over this connection.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  java.io.InputStream in
           
private  java.io.OutputStream out
           
private  javax.microedition.io.HttpsConnection session
           
 
Fields inherited from class org.ksoap2.transport.Transport
debug, requestDump, responseDump, url
 
Constructor Summary
AuthTransport()
          Opens the session with the Identity Provider.
 
Method Summary
 void call(SaslMessage request)
          Sends the message and receives the response.
 void disconnect()
          Closes the session with the authentication service at the Identity Provider
 java.lang.String getIdpName()
          Retrieves the server certificate and extracts the name of the Identity Provider from it.
private  java.lang.String getName(java.lang.String subject)
           
 void reset()
          Closes the input and output streams, but keeps the session
 
Methods inherited from class org.ksoap2.transport.Transport
createRequestData, parseResponse, setUrl, setXmlVersionTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

private javax.microedition.io.HttpsConnection session

out

private java.io.OutputStream out

in

private java.io.InputStream in
Constructor Detail

AuthTransport

public AuthTransport()
              throws MessageException
Opens the session with the Identity Provider.

Throws:
MessageException - If the Identity Provider cannot be found or its certificate cannot be trusted.
Method Detail

getIdpName

public java.lang.String getIdpName()
                            throws MessageException
Retrieves the server certificate and extracts the name of the Identity Provider from it.

Returns:
String The name of the Identity Provider.
Throws:
MessageException - If the communication was disrupted.

getName

private java.lang.String getName(java.lang.String subject)
Returns:
String Gets the part of the subject that we want the user to see.

call

public void call(SaslMessage request)
          throws SoapFault,
                 java.io.IOException,
                 XmlPullParserException
Sends the message and receives the response.

Parameters:
request - SaslMessage The SaslRequest that is to be sent and the message in which the response should be stored.
Throws:
SoapFault - If the server returned a message indicating a fault.
java.io.IOException - If the communication was disrupted.
XmlPullParserException - If the response could not be parsed as XML.

reset

public void reset()
Closes the input and output streams, but keeps the session


disconnect

public void disconnect()
Closes the session with the authentication service at the Identity Provider