mymobilesite.communication
Class ResourceOffering

java.lang.Object
  extended by mymobilesite.communication.ResourceOffering

public class ResourceOffering
extends java.lang.Object

This class is responsible for parsing the contents of a ResourceOffering element and storing the relevant information so that it can be used to contact the service provider.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  java.lang.String credentialReference
           
private  java.lang.String name
           
private  Element resourceid
           
private  java.lang.String saml
           
private  java.lang.String soapaction
           
private  Element token
           
private  java.lang.String url
           
 
Constructor Summary
ResourceOffering(Element offering, Element credentials)
          The constructor starts the process of parsing the request and retrieving the appropriate token from the credentials.
 
Method Summary
 java.lang.String getName()
           
 Element getResourceId()
           
 java.lang.String getSoapAction()
           
 Element getToken()
           
 java.lang.String getUrl()
           
private  void processCredentials(Element credentials)
          This method goes through the credentials and stores the appropriate one, so that it can be used to access the service it is supposed to be used for.
private  void processOffering(Element offering)
          Processes the Element containing the resource offering and stores the values that are needed to contact the service provider later.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceid

private Element resourceid

name

private java.lang.String name

url

private java.lang.String url

token

private Element token

credentialReference

private java.lang.String credentialReference

saml

private java.lang.String saml

soapaction

private java.lang.String soapaction
Constructor Detail

ResourceOffering

public ResourceOffering(Element offering,
                        Element credentials)
                 throws MessageException
The constructor starts the process of parsing the request and retrieving the appropriate token from the credentials.

Parameters:
offering - Element An Element containing the resource offering.
credentials - Element An element containing a lot of tokens as its subelements.
Throws:
MessageException - If any of the parameters are invalid.
Method Detail

processOffering

private void processOffering(Element offering)
Processes the Element containing the resource offering and stores the values that are needed to contact the service provider later.

Parameters:
offering - Element An Element containing the resource offering.

processCredentials

private void processCredentials(Element credentials)
                         throws MessageException
This method goes through the credentials and stores the appropriate one, so that it can be used to access the service it is supposed to be used for.

Parameters:
credentials - Element An element containing a lot of tokens as its subelements.
Throws:
MessageException - If there is something wrong with the credentials.

getName

public java.lang.String getName()
Returns:
String The name of the service provider.

getUrl

public java.lang.String getUrl()
Returns:
String The url pointing to the service provider.

getToken

public Element getToken()
Returns:
Element The token that can be used to access the service provider.

getResourceId

public Element getResourceId()
Returns:
String The ResourceID or EncryptedResourceID of this offering

getSoapAction

public java.lang.String getSoapAction()
Returns:
String The SoapAction of this offering