info.sswap.api.http
Interface HTTPProvider


public interface HTTPProvider

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 HTTPProvider, use HTTPAPI.getProvider().

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

Author:
Damian Gessler
See Also:
PDG, RDG, RRG, HTTPClient, HTTPAPI

Nested Class Summary
static interface HTTPProvider.PDGResponse
          Exposes access to both a ready-to-use Provider Description Graph (PDG) on success or a network response object on failure.
static interface HTTPProvider.RDGResponse
          Exposes access to both a ready-to-use Resource Description Graph (RDG) on success or a network response object on failure.
static interface HTTPProvider.RRGResponse
          Exposes access to both a ready-to-use Resource Response Graph (RRG) on success or a network response object on failure.
 
Method Summary
 HTTPProvider.PDGResponse makePDG(java.io.InputStream jsonStream)
          Make a Provider Description Graph (PDG) from a JSON (JavaScript Object Notation) specification.
 HTTPProvider.PDGResponse makePDG(java.lang.String jsonString)
          Convenience method to makePDG(InputStream) with input as single JSON string.
 HTTPProvider.RDGResponse makeRDG(java.io.InputStream jsonStream)
          Make a Resource Description Graph (RDG) from a JSON (JavaScript Object Notation) specification.
 HTTPProvider.RDGResponse makeRDG(java.lang.String jsonString)
          Convenience method to makeRDG(InputStream) with input as single JSON string.
 HTTPProvider.RRGResponse makeRRG(java.io.InputStream jsonStream)
          Make a Resource Response Graph (RRG) from a JSON (JavaScript Object Notation) specification.
 HTTPProvider.RRGResponse makeRRG(java.lang.String jsonString)
          Convenience method to makeRRG(InputStream) with input as single JSON string.
 

Method Detail

makePDG

HTTPProvider.PDGResponse makePDG(java.io.InputStream jsonStream)
                                 throws java.io.IOException
Make a Provider Description Graph (PDG) from a JSON (JavaScript Object Notation) specification. For the specification, see http://sswap.info/api/makePDG.

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

makePDG

HTTPProvider.PDGResponse makePDG(java.lang.String jsonString)
                                 throws java.io.IOException
Convenience method to makePDG(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 PDG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
makePDG(InputStream)

makeRDG

HTTPProvider.RDGResponse makeRDG(java.io.InputStream jsonStream)
                                 throws java.io.IOException
Make a Resource Description Graph (RDG) from a JSON (JavaScript Object Notation) specification. For the specification, see http://sswap.info/api/makeRDG.

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

makeRDG

HTTPProvider.RDGResponse makeRDG(java.lang.String jsonString)
                                 throws java.io.IOException
Convenience method to makeRDG(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 RDG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
makeRDG(InputStream)

makeRRG

HTTPProvider.RRGResponse makeRRG(java.io.InputStream jsonStream)
                                 throws java.io.IOException
Make a Resource Response Graph (RRG) from a JSON (JavaScript Object Notation) specification. For the specification, see http://sswap.info/api/makeRRG.

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

makeRRG

HTTPProvider.RRGResponse makeRRG(java.lang.String jsonString)
                                 throws java.io.IOException
Convenience method to makeRRG(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 RRG on success, or examine the connection response on error
Throws:
java.io.IOException - on network or parsing error
See Also:
makeRRG(InputStream)


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