info.sswap.api.http
Interface HTTPClient

All Known Implementing Classes:
HTTPAPIImpl

public interface HTTPClient

Access the HTTP API within the Java API. Useful for sending JSON data to the HTTP API to make SSWAP models such as:

To create an HTTPClient, use HTTPAPI.getClient().

Note: Implementation may make a runtime network call to http://sswap.info/api to perform conversions.

Author:
Damian Gessler
See Also:
RIG, RQG, HTTPProvider, HTTPAPI

Nested Class Summary
static interface HTTPClient.RIGResponse
          Access to get an RIG on success or a network response object (via the superinterface) on failure.
static interface HTTPClient.RQGResponse
          Access to get an RQG on success or a network response object (via the superinterface) on failure.
 
Method Summary
 HTTPClient.RIGResponse makeRIG(java.io.InputStream jsonStream)
          Make a Response Invocation Graph (RIG) from a JSON (JavaScript Object Notation) specification.
 HTTPClient.RIGResponse makeRIG(java.lang.String jsonString)
          Convenience method to makeRIG(InputStream) with input as single JSON string.
 HTTPClient.RQGResponse makeRQG(java.io.InputStream jsonStream)
          Make a Response Query Graph (RQG) from a JSON (JavaScript Object Notation) specification.
 HTTPClient.RQGResponse makeRQG(java.lang.String jsonString)
          Convenience method to makeRQG(InputStream) with input as single JSON string.
 

Method Detail

makeRIG

HTTPClient.RIGResponse makeRIG(java.io.InputStream jsonStream)
                               throws java.io.IOException
Make a Response Invocation Graph (RIG) from a JSON (JavaScript Object Notation) specification. For the specification, see http://sswap.info/api/makeRIG.

Parameters:
jsonStream - a stream, for example from a file, of JSON input
Returns:
a compound object that allows one to get the RIG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
RIG, HTTPClient.RIGResponse.getRIG()

makeRIG

HTTPClient.RIGResponse makeRIG(java.lang.String jsonString)
                               throws java.io.IOException
Convenience method to makeRIG(InputStream) with input as single JSON string.

Parameters:
jsonString - a string, for example from local variables and validated user input, of JSON input
Returns:
a compound object that allows one to get the RIG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
makeRIG(InputStream)

makeRQG

HTTPClient.RQGResponse makeRQG(java.io.InputStream jsonStream)
                               throws java.io.IOException
Make a Response Query Graph (RQG) from a JSON (JavaScript Object Notation) specification. For the specification, see http://sswap.info/api/makeRQG.

Parameters:
jsonStream - a stream, for example from a file, of JSON input
Returns:
a compound object that allows one to get the RQG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
RQG, HTTPClient.RQGResponse.getRQG()

makeRQG

HTTPClient.RQGResponse makeRQG(java.lang.String jsonString)
                               throws java.io.IOException
Convenience method to makeRQG(InputStream) with input as single JSON string.

Parameters:
jsonString - a string, for example from local variables and validated user input, of JSON input
Returns:
a compound object that allows one to get the RQG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
makeRQG(InputStream)


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.