mymobilesite.communication
Class DiscoveryQuery
java.lang.Object
org.ksoap2.SoapEnvelope
mymobilesite.communication.LibertyMessage
mymobilesite.communication.DiscoveryQuery
public class DiscoveryQuery
- extends LibertyMessage
This class is responsible for constructing and sending the discovery queries. Furthermore,
it processes the query responses and stores the ResourceOfferings retrieved.
- Author:
- Gunn Olaussen & Kirsti N. Torgersen
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 |
Method Summary |
private void |
createBody()
Creates the query to be sent to the Discovery Service. |
HttpTransport |
createTransport()
This method creates the transport that will be used in the communication with the
Discovery Service. |
protected void |
processResponse(Element current)
This method processes the current element and stores the resource offerings so that they
can be returned to the LibertyProtocol later. |
ResourceOffering[] |
sendQuery()
This method constructs the query, sends it and processes the response. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
private HttpTransport session
providers
private ResourceOffering[] providers
DiscoveryQuery
public DiscoveryQuery(ResourceOffering offering)
- The constructor creates a DiscoveryQuery object based on the ResourceOffering.
- Parameters:
offering
- ResourceOffering The ResouceOffering containing the url and token for
the Discovery Service.
createTransport
public HttpTransport createTransport()
- This method creates the transport that will be used in the communication with the
Discovery Service.
- Returns:
- HttpTransport The transport that will be used by this class to send the query
and receive the response.
sendQuery
public ResourceOffering[] sendQuery()
throws MessageException
- This method constructs the query, sends it and processes the response.
- Returns:
- ResourceOffering[] A list of the ResourceOfferings and the corresponding tokens
returned by the Discovery Service.
- Throws:
MessageException
- If something wrong happens, an exception with the appropriate
error code is thrown.
createBody
private void createBody()
- Creates the query to be sent to the Discovery Service.
processResponse
protected void processResponse(Element current)
throws MessageException
- This method processes the current element and stores the resource offerings so that they
can be returned to the LibertyProtocol later.
- Specified by:
processResponse
in class LibertyMessage
- Parameters:
current
- Element The element that is to be processed.
- Throws:
MessageException
- If there are no results or the message is invalid.