Class MetisHTTPDataClient
java.lang.Object
io.github.tonywasher.joceanus.metis.http.MetisHTTPDataClient
- Direct Known Subclasses:
MetisHTTPYQLClient
Http client interface.
- Author:
- Tony Washer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAuthorizationType. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetisHTTPDataClient(String pBaseAddress) Constructor.protectedMetisHTTPDataClient(String pBaseAddress, MetisHTTPDataClient.MetisHTTPAuthType pAuthType, String pAuth) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.json.JSONArraygetAbsoluteJSONArray(String pURL) Obtain query results from explicit object as JSON array.protected org.json.JSONObjectgetAbsoluteJSONObject(String pURL) Obtain query results from explicit object as JSON object.protected org.json.JSONArraygetJSONArray(String pHeader) Obtain query results as JSON array.protected org.json.JSONObjectgetJSONObject(String pHeader) Obtain query results as JSON object.protected org.json.JSONObjectpostRequest(String pHeader, org.json.JSONObject pRequest) Post a request.protected org.json.JSONArrayqueryJSONArray(String pQuery) Obtain query results as JSON array.protected org.json.JSONArrayqueryJSONArrayWithHeader(String pHeader, String pQuery) Obtain query results as JSON array.protected org.json.JSONArrayqueryJSONArrayWithHeaderAndTrailer(String pHeader, String pQuery, String pTrailer) Obtain query results as JSON array.protected org.json.JSONArrayqueryJSONArrayWithTrailer(String pQuery, String pTrailer) Obtain query results as JSON array.protected org.json.JSONObjectqueryJSONObject(String pQuery) Obtain query results as JSON object.protected org.json.JSONObjectqueryJSONObjectWithHeader(String pHeader, String pQuery) Obtain query results as JSON object.protected org.json.JSONObjectqueryJSONObjectWithHeaderAndTrailer(String pHeader, String pQuery, String pTrailer) Obtain query results as JSON object.protected org.json.JSONObjectqueryJSONObjectWithTrailer(String pQuery, String pTrailer) Obtain query results as JSON object.
-
Constructor Details
-
MetisHTTPDataClient
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 typepAuth- the authorisation string
-
-
Method Details
-
getAbsoluteJSONObject
Obtain query results from explicit object as JSON object.- Parameters:
pURL- the URL- Returns:
- the query results
- Throws:
OceanusException- on error
-
getAbsoluteJSONArray
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 stringpRequest- the request- Returns:
- the resulting object
- Throws:
OceanusException- on error
-
getJSONObject
Obtain query results as JSON object.- Parameters:
pHeader- the header string- Returns:
- the query results
- Throws:
OceanusException- on error
-
queryJSONObject
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 detailspQuery- 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 stringpTrailer- 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 detailspQuery- the query stringpTrailer- the trailing details- Returns:
- the query results
- Throws:
OceanusException- on error
-
getJSONArray
Obtain query results as JSON array.- Parameters:
pHeader- the header string- Returns:
- the query results
- Throws:
OceanusException- on error
-
queryJSONArray
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 detailspQuery- 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 stringpTrailer- 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 detailspQuery- the query stringpTrailer- the trailing details- Returns:
- the query results
- Throws:
OceanusException- on error
-