Exemplo n.º 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;
 }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 public void ping() throws IOException, UnauthorizedException {
   restClient.execute(HttpMethod.GET, config.resolveURLNoVersion("ping"), config.getAccessToken());
 }