forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGdcService.java
More file actions
59 lines (52 loc) · 1.7 KB
/
Copy pathGdcService.java
File metadata and controls
59 lines (52 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright (C) 2004-2017, GoodData(R) Corporation. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
package com.gooddata.gdc;
import com.gooddata.AbstractService;
import com.gooddata.GoodDataException;
import com.gooddata.GoodDataSettings;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
/**
* Service to work with GoodData API root.
*/
public class GdcService extends AbstractService {
public GdcService(final RestTemplate restTemplate, final GoodDataSettings settings) {
super(restTemplate, settings);
}
/**
* @deprecated use GdcService(RestTemplate, GoodDataSettings) constructor instead
*/
@Deprecated
public GdcService(final RestTemplate restTemplate) {
super(restTemplate);
}
/**
* Obtains GoodData API root links.
*
* @return GoodData API root links
* @deprecated use {@link #getRootLinks()} instead
*/
@Deprecated
public Gdc getGdc() {
try {
return restTemplate.getForObject(Gdc.URI, Gdc.class);
} catch (GoodDataException | RestClientException e) {
throw new GoodDataException("Unable to get gdc about", e);
}
}
/**
* Obtains GoodData API root links.
*
* @return GoodData API root links
*/
public RootLinks getRootLinks() {
try {
return restTemplate.getForObject(RootLinks.URI, RootLinks.class);
} catch (GoodDataException | RestClientException e) {
throw new GoodDataException("Unable to get gdc root links", e);
}
}
}