authentication
Class ResourceOffering

java.lang.Object
  extended by authentication.ResourceOffering

public class ResourceOffering
extends java.lang.Object

This class parses a resource offering from an XML node and holds it for other classes to use.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  org.w3c.dom.Node offering
           
private  java.lang.String offeringid
           
private  java.lang.String resourceid
           
private  java.lang.String securityMechId
           
 
Constructor Summary
ResourceOffering(org.w3c.dom.Node offering)
          This constructor stores the input XML node and retrieves a few useful values from it.
 
Method Summary
private  org.w3c.dom.Node findNode(java.lang.String withName, org.w3c.dom.Node parent)
          This method looks for a node with the name withName that is a children of the Node parent.
 java.lang.String getMessageAuthMethod()
           
 void getOffering(javax.xml.soap.SOAPElement appendto)
          This method appends the resource offering node to the input SOAPElement, after converting the resource offering to a SOAPElement.
 java.lang.String getOfferingId()
           
 java.lang.String getResourceId()
           
private  void turnToSoap(org.w3c.dom.Node notSoap, javax.xml.soap.SOAPElement parent)
          This method turns the XML node notSoap into a SOAPElement by creating new SOAPElements and giving them the same properties as the XML node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offeringid

private java.lang.String offeringid

resourceid

private java.lang.String resourceid

offering

private org.w3c.dom.Node offering

securityMechId

private java.lang.String securityMechId
Constructor Detail

ResourceOffering

public ResourceOffering(org.w3c.dom.Node offering)
This constructor stores the input XML node and retrieves a few useful values from it. It also creates the offering identifier by a call to Randomizer.nextID().

Parameters:
offering - Node The XML node containing the resource offering.
Method Detail

findNode

private org.w3c.dom.Node findNode(java.lang.String withName,
                                  org.w3c.dom.Node parent)
This method looks for a node with the name withName that is a children of the Node parent. It will return the first matching Node it finds or null if it could not find any.

Parameters:
withName - String The local name of the node to look for.
parent - Node The parent of the node to look for.
Returns:
Node The wanted node or null if it could not be found.

getOffering

public void getOffering(javax.xml.soap.SOAPElement appendto)
                 throws javax.xml.soap.SOAPException
This method appends the resource offering node to the input SOAPElement, after converting the resource offering to a SOAPElement.

Parameters:
appendto - SOAPElement The element to append this resource offering to.
Throws:
javax.xml.soap.SOAPException - If something is wrong with the offering a SOAPException is thrown.

turnToSoap

private void turnToSoap(org.w3c.dom.Node notSoap,
                        javax.xml.soap.SOAPElement parent)
                 throws javax.xml.soap.SOAPException
This method turns the XML node notSoap into a SOAPElement by creating new SOAPElements and giving them the same properties as the XML node. Then it uses recursivity to do the same to notSoap's children.

Throws:
javax.xml.soap.SOAPException

getOfferingId

public java.lang.String getOfferingId()
Returns:
String The unique identifier of this resource offering.

getResourceId

public java.lang.String getResourceId()
Returns:
String The resource identifier contained in this resource offering.

getMessageAuthMethod

public java.lang.String getMessageAuthMethod()
Returns:
String The message authentication method.