Search in sources :

Example 11 with ContentProvider

use of org.eclipse.jetty.client.api.ContentProvider in project camel by apache.

the class DefaultCompositeApiClient method submitCompositeBatch.

@Override
public void submitCompositeBatch(final SObjectBatch batch, final ResponseCallback<SObjectBatchResponse> callback) throws SalesforceException {
    checkCompositeBatchVersion(version, batch.getVersion());
    final String url = versionUrl() + "composite/batch";
    final Request post = createRequest(HttpMethod.POST, url);
    final ContentProvider content = serialize(batch, batch.objectTypes());
    post.content(content);
    doHttpRequest(post, (response, exception) -> callback.onResponse(tryToReadResponse(SObjectBatchResponse.class, response), exception));
}
Also used : InputStreamContentProvider(org.eclipse.jetty.client.util.InputStreamContentProvider) ContentProvider(org.eclipse.jetty.client.api.ContentProvider) Request(org.eclipse.jetty.client.api.Request)

Aggregations

ContentProvider (org.eclipse.jetty.client.api.ContentProvider)11 Request (org.eclipse.jetty.client.api.Request)8 ContentResponse (org.eclipse.jetty.client.api.ContentResponse)5 BytesContentProvider (org.eclipse.jetty.client.util.BytesContentProvider)5 IOException (java.io.IOException)4 ByteBuffer (java.nio.ByteBuffer)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 DeferredContentProvider (org.eclipse.jetty.client.util.DeferredContentProvider)4 InputStreamContentProvider (org.eclipse.jetty.client.util.InputStreamContentProvider)4 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 Response (org.eclipse.jetty.client.api.Response)3 Result (org.eclipse.jetty.client.api.Result)3 CancellationException (java.util.concurrent.CancellationException)2 ServletException (javax.servlet.ServletException)2 ProcessingException (javax.ws.rs.ProcessingException)2 BufferingResponseListener (org.eclipse.jetty.client.util.BufferingResponseListener)2 OutputStreamContentProvider (org.eclipse.jetty.client.util.OutputStreamContentProvider)2 ClientRequest (org.glassfish.jersey.client.ClientRequest)2 ClientResponse (org.glassfish.jersey.client.ClientResponse)2 Test (org.junit.Test)2