StreamingResponseConsumer(final ClientInvocation request, final ResultExtractor<T> extractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.extractor = extractor; }
BufferingResponseConsumer(final ClientInvocation request, final ResultExtractor<T> responseExtractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.responseExtractor = responseExtractor; }
@Override public <T extends RxInvoker> T rx(Class<T> clazz) { RxInvokerProvider<T> provider = invocation.getClientConfiguration().getRxInvokerProvider(clazz); if (provider == null) { throw new IllegalStateException(Messages.MESSAGES.unableToInstantiate(clazz)); } return provider.getRxInvoker(this, invocation.getClient().asyncInvocationExecutor()); }
@Override public void onHeaders(Response response) { cr = new JettyClientResponse(invocation.getClientConfiguration(), stream, () -> { if (!completing.get()) { future.cancel(true); } }); cr.setProperties(invocation.getMutableProperties()); cr.setStatus(response.getStatus()); cr.setHeaders(extract(response.getHeaders())); if (!buffered) { complete(); } }
@Override protected ClientInvocation apply(ClientInvocation invocation, Object object) { Form form = null; Object entity = invocation.getEntity(); if (entity != null) { if (entity instanceof Form) { form = (Form) entity; } else { throw new RuntimeException(Messages.MESSAGES.cannotSetFormParameter()); } } else { form = new Form(); invocation.setEntity(Entity.form(form)); } String value = invocation.getClientConfiguration().toString(object); form.param(paramName, value); return invocation; }
ClientResponse response = new ClientResponse(request.getClientConfiguration())
@Override public void process(ClientInvocation invocation, Object object) { if (object == null) return; // don't set a null value if (object instanceof Cookie) { Cookie cookie = (Cookie) object; invocation.getHeaders().cookie(cookie); } else { ClientConfiguration cc = invocation.getClientConfiguration(); String s = (annotations != null && type != null) ? cc.toString(object, type, annotations) : cc.toString(object); invocation.getHeaders().cookie(new Cookie(cookieName, s)); } } }
ClientResponse response = new ClientResponse(request.getClientConfiguration(), request.getTracingLogger()) response.setReasonPhrase(res.getStatusLine().getReasonPhrase()); response.setHeaders(extractHeaders(res)); response.setClientConfiguration(request.getClientConfiguration()); return response;
public JavaNetConnectionClientResponse(ClientInvocation request, HttpURLConnection connection) { super(request.getClientConfiguration()); this.connection = connection; }
public JavaNetConnectionClientResponse(ClientInvocation request, HttpURLConnection connection) { super(request.getClientConfiguration()); this.connection = connection; }
StreamingResponseConsumer(ClientInvocation request, ResultExtractor<T> extractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.extractor = extractor; }
public StreamingResponseConsumer(ClientInvocation request, ResultExtractor<T> extractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.extractor = extractor; }
BufferingResponseConsumer(ClientInvocation request, ResultExtractor<T> responseExtractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.responseExtractor = responseExtractor; }
public BufferingResponseConsumer(ClientInvocation request, ResultExtractor<T> responseExtractor) { this.configuration = request.getClientConfiguration(); this.properties = request.getMutableProperties(); this.responseExtractor = responseExtractor; }
@Override public <T extends RxInvoker> T rx(Class<T> clazz) { RxInvokerProvider<T> provider = invocation.getClientConfiguration().getRxInvokerProvider(clazz); if (provider == null) { throw new IllegalStateException(Messages.MESSAGES.unableToInstantiate(clazz)); } return provider.getRxInvoker(this, invocation.getClient().asyncInvocationExecutor()); }
private ClientResponse createResponse(ClientInvocation request, final Response response) { ClientResponse clientResponse = new ClientResponse(request.getClientConfiguration()) { private InputStream stream;
@Override public void process(ClientInvocationBuilder request, Object object) { if (object == null) return; // don't set a null value if (object instanceof Cookie) { Cookie cookie = (Cookie) object; request.cookie(cookie); } else { request.cookie(new Cookie(cookieName, request.getInvocation().getClientConfiguration().toString(object))); } } }
@Override public void process(ClientInvocationBuilderInterface request, Object object) { if (object == null) return; // don't set a null value if (object instanceof Cookie) { Cookie cookie = (Cookie) object; request.cookie(cookie); } else { request.cookie(new Cookie(cookieName, request.getInvocation().getClientConfiguration().toString(object))); } } }
@Override protected ClientInvocationBuilder apply(ClientInvocationBuilder target, Object object) { Form form = null; Object entity = target.getInvocation().getEntity(); if (entity != null) { if (entity instanceof Form) { form = (Form) entity; } else { throw new RuntimeException(Messages.MESSAGES.cannotSetFormParameter()); } } else { form = new Form(); target.getInvocation().setEntity(Entity.form(form)); } String value = target.getInvocation().getClientConfiguration().toString(object); form.param(paramName, value); return target; }
@Override protected ClientInvocationBuilderInterface apply(ClientInvocationBuilderInterface target, Object object) { Form form = null; Object entity = target.getInvocation().getEntity(); if (entity != null) { if (entity instanceof Form) { form = (Form) entity; } else { throw new RuntimeException(Messages.MESSAGES.cannotSetFormParameter()); } } else { form = new Form(); target.getInvocation().setEntity(Entity.form(form)); } String value = target.getInvocation().getClientConfiguration().toString(object); form.param(paramName, value); return target; }