public String getServiceUrl() { return config.protocol() + "://" + config.host() + ":" + Integer.toString(config.port()) + "/v2.0"; }
private <T> T sendGetRequest(WebResource resource, Class<T> clazz) throws KeystoneServerException, KeystoneConnectionException { try { return resource .accept(MediaType.APPLICATION_JSON) .header(KEYSTONE_TOKEN_HEADER_KEY, config.adminToken()) .get(clazz); } catch (UniformInterfaceException e) { throw new KeystoneServerException("Keystone server error.", e, e.getResponse().getStatus()); } catch (ClientHandlerException e) { throw new KeystoneConnectionException( "Could not connect to Keystone server " + resource.getURI(), e); } }