@Override public void delete(String apiKey, String table, String blobId) { checkNotNull(table, "table"); checkNotNull(blobId, "blobId"); try { _client.resource(toUri(table, blobId)) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .delete(); } catch (EmoClientException e) { throw convertException(e); } }
@Override public void delete(String apiKey, String table, String blobId) { checkNotNull(table, "table"); checkNotNull(blobId, "blobId"); try { _client.resource(toUri(table, blobId)) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .delete(); } catch (EmoClientException e) { throw convertException(e); } }
protected void doUnclaimAll(String apiKey, String queue) { checkNotNull(queue, "queue"); try { URI uri = _queueService.clone() .segment(queue, "unclaimall") .queryParam("partitioned", _partitionSafe) .build(); _client.resource(uri) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .post(); } catch (EmoClientException e) { throw convertException(e); } }
@Override public Map<String, Object> getTableTemplate(String apiKey, String table) { checkNotNull(table, "table"); try { URI uri = _dataStore.clone() .segment("_table", table) .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(new TypeReference<Map<String,Object>>(){}); } catch (EmoClientException e) { throw convertException(e); } }
@Override public TableOptions getTableOptions(String apiKey, String table) throws UnknownTableException { checkNotNull(table, "table"); try { URI uri = _blobStore.clone() .segment("_table", table, "options") .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(TableOptions.class); } catch (EmoClientException e) { throw convertException(e); } }
@Override public TableOptions getTableOptions(String apiKey, String table) { checkNotNull(table, "table"); try { URI uri = _dataStore.clone() .segment("_table", table, "options") .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(TableOptions.class); } catch (EmoClientException e) { throw convertException(e); } }
@Override public long getTableApproximateSize(String apiKey, String table) { checkNotNull(table, "table"); try { URI uri = _dataStore.clone() .segment("_table", table, "size") .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(Long.class); } catch (EmoClientException e) { throw convertException(e); } }
@Override public Table getTableMetadata(String apiKey, String table) { checkNotNull(table, "table"); try { URI uri = _dataStore.clone() .segment("_table", table, "metadata") .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(Table.class); } catch (EmoClientException e) { throw convertException(e); } }
@Override public EmoApiKey getApiKey(String apiKey, String id) { checkNotNull(id, "id"); URI uri = _uac.clone() .segment("api-key") .segment(id) .build(); EmoResponse response = _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(EmoResponse.class); return getApiKeyFromResponse(response); }
@Override public Map<StashTimeKey, StashRunTimeInfo> getAllStashTimes() { try { URI uri = _compactionControlSource.clone() .segment("_compcontrol", "stash-time") .build(); return _client.resource(uri) .type(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, _apiKey) .get(Map.class); } catch (UniformInterfaceException e) { throw convertException(e); } }
@Override public Map<StashTimeKey, StashRunTimeInfo> getAllStashTimes() { try { URI uri = _compactionControlSource.clone() .segment("_compcontrol", "stash-time") .build(); return _client.resource(uri) .type(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, _apiKey) .get(Map.class); } catch (UniformInterfaceException e) { throw convertException(e); } }
@Override public Iterator<EmoRole> getAllRoles(String apiKey) { try { URI uri = _uac.clone() .segment("role") .build(); return _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(new TypeReference<Iterator<EmoRole>>(){}); } catch (EmoClientException e) { throw convertException(e); } }
@Override public EmoApiKey getApiKeyByKey(String apiKey, String key) { checkNotNull(key, "key"); URI uri = _uac.clone() .segment("api-key") .segment("_key") .segment(key) .build(); EmoResponse response = _client.resource(uri) .accept(MediaType.APPLICATION_JSON_TYPE) .header(ApiKeyRequest.AUTHENTICATION_HEADER, apiKey) .get(EmoResponse.class); return getApiKeyFromResponse(response); }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; } }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; } }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; } }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; }
@Override public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); return _client.resource(adminUrl).path("/healthcheck") .header(HttpHeaders.CONNECTION, "close") .head().getStatus() == 200; }