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