Skip to content
Martin Caslavsky edited this page Oct 26, 2016 · 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.

How to extend GoodData Java SDK

Lets create a generic REST service able to perform an HTTP get request to GoodData REST API and return the response as a string.

Note: this functionality has been available since version 0.10.1-SNAPSHOT.

Create a new Service

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);
    }
}

Extend GoodData client

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;
    }
}

Clone this wiki locally