protected void setupNewConnection(String newURL) throws IOException { HTTPClientPolicy cp = getClient(outMessage); Address address; try { if (defaultAddress.getString().equals(newURL)) { address = defaultAddress; } else { address = new Address(newURL); } } catch (URISyntaxException e) { throw new IOException(e); } setupConnection(outMessage, address, cp); this.url = address.getURI(); connection = (HttpURLConnection)outMessage.get(KEY_HTTP_CONNECTION); }
conduit = new URLConnectionHTTPConduit(bus, endpointInfo, target);
protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { HttpURLConnection connection = createConnection(message, address, csPolicy); connection.setDoOutput(true); int ctimeout = determineConnectionTimeout(message, csPolicy); connection.setConnectTimeout(ctimeout); int rtimeout = determineReceiveTimeout(message, csPolicy); connection.setReadTimeout(rtimeout); } catch (Throwable t) { logStackTrace(t); message.put(HTTPURL_CONNECTION_METHOD_REFLECTION, true); } catch (Throwable t) { logStackTrace(t); throw ex;
protected void setupConnection(Message message, URI currentURL, HTTPClientPolicy csPolicy) throws IOException { HttpURLConnection connection = createConnection(message, currentURL, csPolicy); connection.setDoOutput(true); int ctimeout = determineConnectionTimeout(message, csPolicy); connection.setConnectTimeout(ctimeout); int rtimeout = determineReceiveTimeout(message, csPolicy); connection.setReadTimeout(rtimeout); connection.setUseCaches(false); // We implement redirects in this conduit. We do not // rely on the underlying URLConnection implementation // because of trust issues. connection.setInstanceFollowRedirects(false); // If the HTTP_REQUEST_METHOD is not set, the default is "POST". String httpRequestMethod = (String)message.get(Message.HTTP_REQUEST_METHOD); if (httpRequestMethod == null) { httpRequestMethod = "POST"; message.put(Message.HTTP_REQUEST_METHOD, "POST"); } connection.setRequestMethod(httpRequestMethod); // We place the connection on the message to pick it up // in the WrappedOutputStream. message.put(KEY_HTTP_CONNECTION, connection); }
if (factory.isShutdown()) { message.put(USE_ASYNC, Boolean.FALSE); super.setupConnection(message, address, csPolicy); return; super.setupConnection(message, addressChanged ? new Address(uriString, uri) : address, csPolicy); return;
@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { HttpURLConnection connection = (HttpURLConnection)message.get(KEY_HTTP_CONNECTION); if (isChunking && chunkThreshold <= 0) { chunkThreshold = 0; connection.setChunkedStreamingMode(-1); } try { return new URLConnectionWrappedOutputStream(message, connection, needToCacheRequest, isChunking, chunkThreshold, getConduitName()); } catch (URISyntaxException e) { throw new IOException(e); } }
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { if (Boolean.TRUE.equals(message.get(USE_ASYNC))) { CXFHttpRequest entity = message.get(CXFHttpRequest.class); AsyncWrappedOutputStream out = new AsyncWrappedOutputStream(message, needToCacheRequest, isChunking, chunkThreshold, getConduitName(), entity.getURI()); entity.setOutputStream(out); return out; } return super.createOutputStream(message, needToCacheRequest, isChunking, chunkThreshold); }
super.setupConnection(message, addressChanged ? new Address(uriString, uri) : address, csPolicy); return;
@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { HttpURLConnection connection = (HttpURLConnection)message.get(KEY_HTTP_CONNECTION); if (isChunking && chunkThreshold <= 0) { chunkThreshold = 0; connection.setChunkedStreamingMode(-1); } try { return new URLConnectionWrappedOutputStream(message, connection, needToCacheRequest, isChunking, chunkThreshold, getConduitName()); } catch (URISyntaxException e) { throw new IOException(e); } }
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { if (Boolean.TRUE.equals(message.get(USE_ASYNC))) { NettyHttpClientRequest entity = message.get(NettyHttpClientRequest.class); NettyWrappedOutputStream out = new NettyWrappedOutputStream(message, needToCacheRequest, isChunking, chunkThreshold, getConduitName(), entity.getUri()); entity.createRequest(out.getOutBuffer()); // TODO need to check how to set the Chunked feature //request.getRequest().setChunked(true); entity.getRequest().headers().set(Message.CONTENT_TYPE, message.get(Message.CONTENT_TYPE)); return out; } return super.createOutputStream(message, needToCacheRequest, isChunking, chunkThreshold); }
protected void setupNewConnection(String newURL) throws IOException { HTTPClientPolicy cp = getClient(outMessage); URI nurl; try { nurl = new URI(newURL); } catch (URISyntaxException e) { throw new IOException(e); } setupConnection(outMessage, nurl, cp); try { url = new URI(newURL); } catch (URISyntaxException e) { throw new IOException(e); } connection = (HttpURLConnection)outMessage.get(KEY_HTTP_CONNECTION); }
protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { HttpURLConnection connection = createConnection(message, address, csPolicy); connection.setDoOutput(true); int ctimeout = determineConnectionTimeout(message, csPolicy); connection.setConnectTimeout(ctimeout); int rtimeout = determineReceiveTimeout(message, csPolicy); connection.setReadTimeout(rtimeout); } catch (Throwable t) { logStackTrace(t); message.put(HTTPURL_CONNECTION_METHOD_REFLECTION, true); } catch (Throwable t) { logStackTrace(t); throw ex;
super.setupConnection(message, addressChanged ? new Address(uriString, uri) : address, csPolicy); return;
protected HTTPConduit createNewConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo, EndpointReferenceType target) throws IOException { return new URLConnectionHTTPConduit(b, localInfo, target); }
@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { HttpURLConnection connection = (HttpURLConnection)message.get(KEY_HTTP_CONNECTION); if (isChunking && chunkThreshold <= 0) { chunkThreshold = 0; connection.setChunkedStreamingMode(-1); } try { return new URLConnectionWrappedOutputStream(message, connection, needToCacheRequest, isChunking, chunkThreshold, getConduitName()); } catch (URISyntaxException e) { throw new IOException(e); } }
protected OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException { if (Boolean.TRUE.equals(message.get(USE_ASYNC))) { NettyHttpClientRequest entity = message.get(NettyHttpClientRequest.class); NettyWrappedOutputStream out = new NettyWrappedOutputStream(message, needToCacheRequest, isChunking, chunkThreshold, getConduitName(), entity.getUri()); entity.createRequest(out.getOutBuffer()); // TODO need to check how to set the Chunked feature //request.getRequest().setChunked(true); entity.getRequest().headers().set(Message.CONTENT_TYPE, message.get(Message.CONTENT_TYPE)); return out; } return super.createOutputStream(message, needToCacheRequest, isChunking, chunkThreshold); }
protected void setupNewConnection(String newURL) throws IOException { HTTPClientPolicy cp = getClient(outMessage); Address address; try { if (defaultAddress.getString().equals(newURL)) { address = defaultAddress; } else { address = new Address(newURL); } } catch (URISyntaxException e) { throw new IOException(e); } setupConnection(outMessage, address, cp); this.url = address.getURI(); connection = (HttpURLConnection)outMessage.get(KEY_HTTP_CONNECTION); }