|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jakewharton.apibuilder.ApiService
com.jakewharton.pingdom.PingdomApiService
public abstract class PingdomApiService
Pingdom-specific API service extension which facilitates provides helper methods for performing remote method calls as well as deserializing the corresponding JSON responses.
| Field Summary |
|---|
| Fields inherited from class com.jakewharton.apibuilder.ApiService |
|---|
CONTENT_ENCODING |
| Constructor Summary | |
|---|---|
PingdomApiService()
Create a new Pingdom service with our proper default values. |
|
| Method Summary | ||
|---|---|---|
com.google.gson.JsonObject |
delete(String url)
Execute request using HTTP DELETE. |
|
com.google.gson.JsonObject |
get(String url)
Execute request using HTTP GET. |
|
com.google.gson.JsonObject |
post(String url,
Map<String,String> parameters)
Execute request using HTTP POST. |
|
com.google.gson.JsonObject |
put(String url,
Map<String,String> parameters)
Execute request using HTTP PUT. |
|
void |
setApiVersion(double apiVersion)
Set the API version. |
|
void |
setAppKey(String value)
Set API key to use for client authentication by Pingdom. |
|
void |
setAuthentication(String email,
String password)
Set email and password to use for HTTP basic authentication. |
|
protected com.google.gson.JsonObject |
unmarshall(InputStream jsonContent)
Read the entirety of an input stream and parse to a JSON object. |
|
protected
|
unmarshall(com.google.gson.reflect.TypeToken<T> typeToken,
com.google.gson.JsonElement response)
Use GSON to deserialize a JSON object to a native class representation. |
|
| Methods inherited from class com.jakewharton.apibuilder.ApiService |
|---|
acceptGzip, addRequestHeader, closeConnection, closeStream, convertStreamToString, executeDelete, executeDelete, executeGet, executeGet, executeMethod, executePost, executePost, getConnectTimeout, getParametersString, getReadTimeout, getWrappedInputStream, removeRequestHeader, setConnectTimeout, setReadTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PingdomApiService()
| Method Detail |
|---|
public com.google.gson.JsonObject get(String url)
url - URL to request.
public com.google.gson.JsonObject post(String url,
Map<String,String> parameters)
url - URL to request.parameters - Parameters to place in the request body.
public com.google.gson.JsonObject delete(String url)
url - URL to request.
public com.google.gson.JsonObject put(String url,
Map<String,String> parameters)
url - URL to request.parameters - Parameters to place in request body.
public void setAuthentication(String email,
String password)
email - Email.password - Password.public void setAppKey(String value)
value - API key.public void setApiVersion(double apiVersion)
apiVersion - API version.
protected <T> T unmarshall(com.google.gson.reflect.TypeToken<T> typeToken,
com.google.gson.JsonElement response)
T - Native class type.typeToken - Native class type wrapper.response - Serialized JSON object.
protected com.google.gson.JsonObject unmarshall(InputStream jsonContent)
jsonContent - JSON content input stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||