Example #1
0
 private Map<String, ConfigEntry> getConfig(String url) throws IOException, UnauthorizedException {
   HttpResponse response =
       restClient.execute(HttpMethod.GET, config.resolveURL(url), config.getAccessToken());
   List<ConfigEntry> responseObject =
       ObjectResponse.fromJsonBody(response, new TypeToken<List<ConfigEntry>>() {})
           .getResponseObject();
   Map<String, ConfigEntry> config = Maps.newHashMap();
   for (ConfigEntry configEntry : responseObject) {
     config.put(configEntry.getName(), configEntry);
   }
   return config;
 }
Example #2
0
 public Version getVersion() throws IOException, UnauthorizedException {
   HttpResponse response =
       restClient.execute(HttpMethod.GET, config.resolveURL("version"), config.getAccessToken());
   return ObjectResponse.fromJsonBody(response, Version.class).getResponseObject();
 }
Example #3
0
 public void ping() throws IOException, UnauthorizedException {
   restClient.execute(HttpMethod.GET, config.resolveURLNoVersion("ping"), config.getAccessToken());
 }