-
Notifications
You must be signed in to change notification settings - Fork 62
Extending
Martin Caslavsky edited this page Jan 10, 2017
·
2 revisions
If you run into an GoodData REST API area which is not covered by the current GoodData Java SDK functionality, please let us know using the Issue Tracker, we will try to cooperate with you to fill the missing pieces.
However there may be a situation you need to extend GoodData Java SDK on your own.
Lets create a generic REST service able to perform an HTTP get request to GoodData REST API and return the response as a string.
public class RestService extends AbstractService {
public RestService(final RestTemplate restTemplate) {
super(restTemplate);
}
public String get(final String uri) {
notNull(uri, "uri");
return restTemplate.getForObject(uri, String.class);
}
}
public class MyGoodData extends GoodData {
private final RestService service;
public MyGoodData(final String login, final String password) {
super(login, password);
service = new RestService(getRestTemplate());
}
public RestService getRestService() {
return service;
}
}
Note: this functionality has been available since version 0.10.1-SNAPSHOT.