java.lang.Object
io.github.tonywasher.joceanus.metis.http.MetisHTTPDataClient
Direct Known Subclasses:
MetisHTTPYQLClient

public abstract class MetisHTTPDataClient extends Object
Http client interface.
Author:
Tony Washer
  • Constructor Details

    • MetisHTTPDataClient

      protected MetisHTTPDataClient(String pBaseAddress)
      Constructor.
      Parameters:
      pBaseAddress - the base address for the client.
    • MetisHTTPDataClient

      protected MetisHTTPDataClient(String pBaseAddress, MetisHTTPDataClient.MetisHTTPAuthType pAuthType, String pAuth)
      Constructor.
      Parameters:
      pBaseAddress - the base address for the client.
      pAuthType - the authorisation type
      pAuth - the authorisation string
  • Method Details

    • getAbsoluteJSONObject

      protected org.json.JSONObject getAbsoluteJSONObject(String pURL) throws OceanusException
      Obtain query results from explicit object as JSON object.
      Parameters:
      pURL - the URL
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • getAbsoluteJSONArray

      protected org.json.JSONArray getAbsoluteJSONArray(String pURL) throws OceanusException
      Obtain query results from explicit object as JSON array.
      Parameters:
      pURL - the URL
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • postRequest

      protected org.json.JSONObject postRequest(String pHeader, org.json.JSONObject pRequest) throws OceanusException
      Post a request.
      Parameters:
      pHeader - the header string
      pRequest - the request
      Returns:
      the resulting object
      Throws:
      OceanusException - on error
    • getJSONObject

      protected org.json.JSONObject getJSONObject(String pHeader) throws OceanusException
      Obtain query results as JSON object.
      Parameters:
      pHeader - the header string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONObject

      protected org.json.JSONObject queryJSONObject(String pQuery) throws OceanusException
      Obtain query results as JSON object.
      Parameters:
      pQuery - the query string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONObjectWithHeader

      protected org.json.JSONObject queryJSONObjectWithHeader(String pHeader, String pQuery) throws OceanusException
      Obtain query results as JSON object.
      Parameters:
      pHeader - the leading details
      pQuery - the query string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONObjectWithTrailer

      protected org.json.JSONObject queryJSONObjectWithTrailer(String pQuery, String pTrailer) throws OceanusException
      Obtain query results as JSON object.
      Parameters:
      pQuery - the query string
      pTrailer - the trailing details
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONObjectWithHeaderAndTrailer

      protected org.json.JSONObject queryJSONObjectWithHeaderAndTrailer(String pHeader, String pQuery, String pTrailer) throws OceanusException
      Obtain query results as JSON object.
      Parameters:
      pHeader - the leading details
      pQuery - the query string
      pTrailer - the trailing details
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • getJSONArray

      protected org.json.JSONArray getJSONArray(String pHeader) throws OceanusException
      Obtain query results as JSON array.
      Parameters:
      pHeader - the header string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONArray

      protected org.json.JSONArray queryJSONArray(String pQuery) throws OceanusException
      Obtain query results as JSON array.
      Parameters:
      pQuery - the query string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONArrayWithHeader

      protected org.json.JSONArray queryJSONArrayWithHeader(String pHeader, String pQuery) throws OceanusException
      Obtain query results as JSON array.
      Parameters:
      pHeader - the leading details
      pQuery - the query string
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONArrayWithTrailer

      protected org.json.JSONArray queryJSONArrayWithTrailer(String pQuery, String pTrailer) throws OceanusException
      Obtain query results as JSON array.
      Parameters:
      pQuery - the query string
      pTrailer - the trailing details
      Returns:
      the query results
      Throws:
      OceanusException - on error
    • queryJSONArrayWithHeaderAndTrailer

      protected org.json.JSONArray queryJSONArrayWithHeaderAndTrailer(String pHeader, String pQuery, String pTrailer) throws OceanusException
      Obtain query results as JSON array.
      Parameters:
      pHeader - the leading details
      pQuery - the query string
      pTrailer - the trailing details
      Returns:
      the query results
      Throws:
      OceanusException - on error