@SuppressWarnings("unchecked") private void writeRequestInfoToLog(ClientResource clientResource) { ConcurrentMap<String, Object> attrs = clientResource.getRequest().getAttributes(); Series<Header> headers = (Series<Header>) attrs.get(HeaderConstants.ATTRIBUTE_HEADERS); logger.info("Request to Poulpe: requested URI - {}, request headers - {}, request body - {}", new Object[]{clientResource.getRequest().getResourceRef(), headers, clientResource.getRequest()}); }
/** * Returns the callback invoked on response reception. If the value is not * null, then the associated request will be executed asynchronously. * * @return The callback invoked on response reception. */ public Uniform getOnResponse() { return getRequest().getOnResponse(); }
/** * Creates a new request by cloning the one wrapped by this class. * * @return The new response. * @see #getRequest() */ public Request createRequest() { return new Request(getRequest()); }
/** * Sets the cookies provided by the client. * * @param cookies * The cookies provided by the client. * @see Request#setCookies(Series) */ public void setCookies(Series<Cookie> cookies) { getRequest().setCookies(cookies); }
/** * Sets the host reference. * * @param hostRef * The host reference. * @see Request#setHostRef(Reference) */ public void setHostRef(Reference hostRef) { getRequest().setHostRef(hostRef); }
/** * Sets the referrer reference if available using an URI string. * * @param referrerUri * The referrer URI. * @see Request#setReferrerRef(String) */ public void setReferrerRef(String referrerUri) { getRequest().setReferrerRef(referrerUri); }
/** * Sets the method called. * * @param method * The method called. * @see Request#setMethod(Method) */ public void setMethod(Method method) { getRequest().setMethod(method); }
/** * Sets the callback invoked on response reception. If the value is not * null, then the associated request will be executed asynchronously. * * @param onResponseCallback * The callback invoked on response reception. */ public void setOnResponse(Uniform onResponseCallback) { getRequest().setOnResponse(onResponseCallback); }
/** * Sets the callback invoked after sending the request. * * @param onSentCallback * The callback invoked after sending the request. */ public void setOnSent(Uniform onSentCallback) { getRequest().setOnSent(onSentCallback); }
/** * Sets the original reference requested by the client. * * @param originalRef * The original reference. * @see Request#setOriginalRef(Reference) */ public void setOriginalRef(Reference originalRef) { getRequest().setOriginalRef(originalRef); }
/** * Sets the authentication response sent by a client to an origin server. * * @param challengeResponse * The authentication response sent by a client to an origin * server. * @see Request#setChallengeResponse(ChallengeResponse) */ public void setChallengeResponse(ChallengeResponse challengeResponse) { getRequest().setChallengeResponse(challengeResponse); }
/** * Sets the conditions applying to this request. * * @param conditions * The conditions applying to this request. * @see Request#setConditions(Conditions) */ public void setConditions(Conditions conditions) { getRequest().setConditions(conditions); }
/** * Sets the host reference using an URI string. * * @param hostUri * The host URI. * @see Request#setHostRef(String) */ public void setHostRef(String hostUri) { getRequest().setHostRef(hostUri); }
/** * Sets the ranges to return from the target resource's representation. * * @param ranges * The ranges. * @see Request#setRanges(List) */ public void setRanges(List<Range> ranges) { getRequest().setRanges(ranges); }
/** * Sets the referrer reference if available. * * @param referrerRef * The referrer reference. * @see Request#setReferrerRef(Reference) */ public void setReferrerRef(Reference referrerRef) { getRequest().setReferrerRef(referrerRef); }
/** * Returns the callback invoked after sending the request. * * @return The callback invoked after sending the request. */ public Uniform getOnSent() { return getRequest().getOnSent(); }
/** * Sets the client-specific information. * * @param clientInfo * The client-specific information. * @see Request#setClientInfo(ClientInfo) */ public void setClientInfo(ClientInfo clientInfo) { getRequest().setClientInfo(clientInfo); }
/** * Indicates if the call is loggable * * @param loggable * True if the call is loggable */ public void setLoggable(boolean loggable) { getRequest().setLoggable(loggable); }
/** * Sets the protocol used or to be used. * * @param protocol * The protocol used or to be used. */ public void setProtocol(Protocol protocol) { getRequest().setProtocol(protocol); }
/** * Sets the resource's reference using an URI string. Note that the URI can * be either absolute or relative to the context's base reference. * * @param uri * The resource URI. * @see Request#setResourceRef(String) */ public void setReference(String uri) { getRequest().setResourceRef(uri); }