public class BaseResource extends Object
login(String), which can be
called by any child class (rather than creating a BaseResource instance).| Modifier and Type | Field and Description |
|---|---|
protected GroupsIOApiClient |
apiClient |
protected String |
baseUrl |
protected static String |
MAX_RESULTS |
static com.fasterxml.jackson.databind.ObjectMapper |
OM |
| Constructor and Description |
|---|
BaseResource(GroupsIOApiClient client,
String baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
callApi(org.apache.http.client.methods.HttpUriRequest request,
Class<T> type)
Main API call method.
|
protected <T> T |
callApi(org.apache.http.client.methods.HttpUriRequest request,
Class<T> type,
Boolean login)
Main API call method.
|
String |
login(String password)
Carry out initial login to the Groups.io API and set the API token.
|
protected final GroupsIOApiClient apiClient
protected final String baseUrl
protected static final String MAX_RESULTS
public static final com.fasterxml.jackson.databind.ObjectMapper OM
public BaseResource(GroupsIOApiClient client, String baseUrl)
public String login(String password) throws URISyntaxException, GroupsIOApiException, IOException
StringURISyntaxExceptionGroupsIOApiExceptionIOExceptionprotected <T> T callApi(org.apache.http.client.methods.HttpUriRequest request,
Class<T> type)
throws IOException,
GroupsIOApiException
HttpUriRequest comprising of a
URI and methodrequest - with the relevant URI and method (with associated data is
appropriate)type - IOException - if it's not possible to get a valid response from the APIGroupsIOApiException - if the API returns an error, or an error is experienced
during deserialisationprotected <T> T callApi(org.apache.http.client.methods.HttpUriRequest request,
Class<T> type,
Boolean login)
throws IOException,
GroupsIOApiException
HttpUriRequest comprising of a
URI and methodrequest - with the relevant URI and method (with associated data is
appropriate)type - what the response should interpreted aslogin - whether this is a call specifically to loginIOException - if it's not possible to get a valid response from the APIGroupsIOApiException - if the API returns an error, or an error is experienced
during deserialisationCopyright © 2017–2019. All rights reserved.