private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
getLogger().debug("Sending metrics {} to Ambari", new Object[]{entity.getEntity()});
public void setEntity(Entity<?> entity) { if (entity == null) { this.entity = null; this.entityAnnotations = null; this.entityClass = null; this.entityGenericType = null; } else { Object ent = entity.getEntity(); setEntityObject(ent); this.entityAnnotations = entity.getAnnotations(); Variant v = entity.getVariant(); headers.setMediaType(v.getMediaType()); headers.setLanguage(v.getLanguage()); headers.header("Content-Encoding", null); headers.header("Content-Encoding", v.getEncoding()); } }
@Override public <T> Future<T> method(String name, Entity<?> entity, Class<T> responseType) { WebClient.this.setEntityHeaders(entity); return doInvokeAsync(name, entity == null ? null : entity.getEntity(), entity == null ? null : entity.getEntity().getClass(), null, responseType, responseType, null); }
@Override public <T> T method(String method, Entity<?> entity, GenericType<T> genericType) { WebClient.this.setEntityHeaders(entity); return invoke(method, entity.getEntity(), genericType); } }
@Override public <T> T method(String method, Entity<?> entity, Class<T> cls) { WebClient.this.setEntityHeaders(entity); return invoke(method, entity.getEntity(), cls); }
private boolean isInputStreamEntity() { return (hasEntity() && InputStream.class.isAssignableFrom(entity.getEntity().getClass())); }
@Override public <T> Future<T> method(String name, Entity<?> entity, GenericType<T> responseType) { WebClient.this.setEntityHeaders(entity); return doInvokeAsync(name, entity == null ? null : entity.getEntity(), entity == null ? null : entity.getEntity().getClass(), null, responseType.getRawType(), responseType.getType(), null); }
/** * Builds, signs and executes a request to an API endpoint using the provided credentials. * Signs the request using the Amazon Signature 4 algorithm and returns the response. * @param accessKey access key * @param secretKey secret key * @param httpMethod the method (GET, POST...) * @param endpointURL protocol://host:port * @param reqPath the API resource path relative to the endpointURL * @param headers headers map * @param params parameters map * @param entity an entity containing any Java object (payload), could be null * @return a response object */ public static Response invokeSignedRequest(String accessKey, String secretKey, String httpMethod, String endpointURL, String reqPath, Map<String, String> headers, MultivaluedMap<String, String> params, Entity<?> entity) { byte[] jsonEntity = null; if (entity != null) { try { jsonEntity = Utils.getJsonWriter().writeValueAsBytes(entity.getEntity()); } catch (JsonProcessingException ex) { jsonEntity = null; logger.error(null, ex); } } return invokeSignedRequest(accessKey, secretKey, httpMethod, endpointURL, reqPath, headers, params, jsonEntity); }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
private void storeEntity(final Entity<?> entity) { if (entity != null) { requestContext.variant(entity.getVariant()); requestContext.setEntity(entity.getEntity()); requestContext.setEntityAnnotations(entity.getAnnotations()); } }
Entity<?> entity = (Entity<?>)body; setEntityHeaders(entity); body = entity.getEntity(); requestClass = body.getClass(); inType = body.getClass();
public void setEntity(Entity<?> entity) { if (entity == null) { this.entity = null; this.entityAnnotations = null; this.entityClass = null; this.entityGenericType = null; } else { Object ent = entity.getEntity(); setEntityObject(ent); this.entityAnnotations = entity.getAnnotations(); Variant v = entity.getVariant(); headers.setMediaType(v.getMediaType()); headers.setLanguage(v.getLanguage()); headers.header("Content-Encoding", null); headers.header("Content-Encoding", v.getEncoding()); } }
public void setEntity(Entity<?> entity) { if (entity == null) { this.entity = null; this.entityAnnotations = null; this.entityClass = null; this.entityGenericType = null; } else { Object ent = entity.getEntity(); setEntityObject(ent); this.entityAnnotations = entity.getAnnotations(); Variant v = entity.getVariant(); headers.setMediaType(v.getMediaType()); headers.setLanguage(v.getLanguage()); headers.header("Content-Encoding", null); headers.header("Content-Encoding", v.getEncoding()); } }