/** * @return the default target URL */ protected URI getURI() throws URISyntaxException { return setAndGetDefaultAddress().getURI(); }
private static URI computeURI(Message message, HttpURLConnection connection) throws URISyntaxException { Address address = (Address)message.get(KEY_HTTP_CONNECTION_ADDRESS); return address != null ? address.getURI() : connection.getURL().toURI(); }
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); }
private HttpURLConnection createConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URL url = address.getURL(); URI uri = address.getURI(); Proxy proxy = proxyFactory.createProxy(csPolicy, uri); message.put("http.scheme", uri.getScheme()); // check tlsClientParameters from message header TLSClientParameters clientParameters = message.get(TLSClientParameters.class); if (clientParameters == null) { clientParameters = tlsClientParameters; } return connectionFactory.createConnection(clientParameters, proxy != null ? proxy : address.getDefaultProxy(), url); } protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException {
FromHeader fromHeader = (FromHeader) req.getHeader("From"); Address fromAddress = fromHeader.getAddress(); URI fromURI = fromAddress.getURI(); if (fromURI.isSipURI()) { SipURI fromSipURI = (SipURI) fromURI; extension = fromSipURI.getUser(); }
setHeadersByAuthorizationPolicy(message, currentAddress.getURI()); new Headers(message).setFromClientPolicy(getClient(message));
private static URI computeURI(Message message, HttpURLConnection connection) throws URISyntaxException { Address address = (Address)message.get(KEY_HTTP_CONNECTION_ADDRESS); return address != null ? address.getURI() : connection.getURL().toURI(); }
/** * @return the default target URL */ protected URI getURI() throws URISyntaxException { return setAndGetDefaultAddress().getURI(); }
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); }
@Override protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URI currentURL = address.getURI(); String s = currentURL.getScheme(); if (!"ws".equals(s) && !"wss".equals(s)) { throw new MalformedURLException("unknown protocol: " + s); } message.put("http.scheme", currentURL.getScheme()); String httpRequestMethod = (String)message.get(Message.HTTP_REQUEST_METHOD); if (httpRequestMethod == null) { httpRequestMethod = "POST"; message.put(Message.HTTP_REQUEST_METHOD, httpRequestMethod); } final AhcWebSocketConduitRequest request = new AhcWebSocketConduitRequest(currentURL, httpRequestMethod); final int rtimeout = determineReceiveTimeout(message, csPolicy); request.setReceiveTimeout(rtimeout); message.put(AhcWebSocketConduitRequest.class, request); }
@Override protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URI currentURL = address.getURI(); String s = currentURL.getScheme(); if (!"ws".equals(s) && !"wss".equals(s)) { throw new MalformedURLException("unknown protocol: " + s); } message.put("http.scheme", currentURL.getScheme()); String httpRequestMethod = (String)message.get(Message.HTTP_REQUEST_METHOD); if (httpRequestMethod == null) { httpRequestMethod = "POST"; message.put(Message.HTTP_REQUEST_METHOD, httpRequestMethod); } final AhcWebSocketConduitRequest request = new AhcWebSocketConduitRequest(currentURL, httpRequestMethod); final int rtimeout = determineReceiveTimeout(message, csPolicy); request.setReceiveTimeout(rtimeout); message.put(AhcWebSocketConduitRequest.class, request); }
@Override protected void setupNewConnection(String newURL) throws IOException { httpResponse = null; isAsync = false; exception = null; if (channel != null) { channel.close(); channel = null; } try { Address address; if (defaultAddress.getString().equals(newURL)) { address = defaultAddress; this.url = defaultAddress.getURI(); } else { this.url = new URI(newURL); address = new Address(newURL, this.url); } setupConnection(outMessage, address, csPolicy); entity = outMessage.get(NettyHttpClientRequest.class); //reset the buffers outBuffer.clear(); outputStream = new ByteBufOutputStream(outBuffer); } catch (URISyntaxException e) { throw new IOException(e); } }
@Override protected void setupNewConnection(String newURL) throws IOException { httpResponse = null; isAsync = false; exception = null; if (channel != null) { channel.close(); channel = null; } try { Address address; if (defaultAddress.getString().equals(newURL)) { address = defaultAddress; this.url = defaultAddress.getURI(); } else { this.url = new URI(newURL); address = new Address(newURL, this.url); } setupConnection(outMessage, address, csPolicy); entity = outMessage.get(NettyHttpClientRequest.class); //reset the buffers outBuffer.clear(); outputStream = new ByteBufOutputStream(outBuffer); } catch (URISyntaxException e) { throw new IOException(e); } }
private HttpURLConnection createConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URL url = address.getURL(); URI uri = address.getURI(); Proxy proxy = proxyFactory.createProxy(csPolicy, uri); message.put("http.scheme", uri.getScheme()); // check tlsClientParameters from message header TLSClientParameters clientParameters = message.get(TLSClientParameters.class); if (clientParameters == null) { clientParameters = tlsClientParameters; } return connectionFactory.createConnection(clientParameters, proxy != null ? proxy : address.getDefaultProxy(), url); } protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException {
protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URI uri = address.getURI(); boolean addressChanged = false;
URI uri = address.getURI(); String uriString = uri.toString(); if (uriString.startsWith("hc://")) {
protected void setupConnection(Message message, Address address, HTTPClientPolicy csPolicy) throws IOException { URI uri = address.getURI(); boolean addressChanged = false;
protected void setupNewConnection(String newURL) throws IOException { httpResponse = null; isAsync = outMessage != null && outMessage.getExchange() != null && !outMessage.getExchange().isSynchronous(); exception = null; connectionFuture = null; session = null; sslState = null; sslURL = null; //reset the buffers HeapByteBufferAllocator allocator = new HeapByteBufferAllocator(); int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320; inbuf = new SharedInputBuffer(bufSize, allocator); outbuf = new SharedOutputBuffer(bufSize, allocator); try { if (defaultAddress.getString().equals(newURL)) { setupConnection(outMessage, defaultAddress, csPolicy); } else { Address address = new Address(newURL); this.url = address.getURI(); setupConnection(outMessage, address, csPolicy); } entity = outMessage.get(CXFHttpRequest.class); basicEntity = (BasicHttpEntity)entity.getEntity(); entity.setOutputStream(this); } catch (URISyntaxException e) { throw new IOException(e); } }
setHeadersByAuthorizationPolicy(message, currentAddress.getURI()); new Headers(message).setFromClientPolicy(getClient(message));