Package io.undertow.client

Examples of io.undertow.client.ClientResponse


                        buffer.clear();
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                //check if an updated worked
                if (anyAreSet(AjpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    String connectionString = response.getResponseHeaders().getFirst(CONNECTION);
                    if (!UPGRADE.equalToString(connectionString)) {
                        //just unset the upgrade requested flag
                        AjpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here


                        pushBackStreamSourceConduit.pushBack(pooled);
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                String connectionString = response.getResponseHeaders().getFirst(CONNECTION);

                //check if an upgrade worked
                if (anyAreSet(HttpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    if ((connectionString == null || !UPGRADE.equalToString(connectionString)) && !response.getResponseHeaders().contains(UPGRADE)) {
                        //just unset the upgrade requested flag
                        HttpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here

            ClientRequest request = new ClientRequest().setPath("/1324").setMethod(Methods.GET);
            final List<ClientResponse> responses = new CopyOnWriteArrayList<ClientResponse>();
            request.getRequestHeaders().add(Headers.CONNECTION, Headers.CLOSE.toString());
            connection.sendRequest(request, createClientCallback(responses, latch));
            latch.await();
            final ClientResponse response = responses.iterator().next();
            Assert.assertEquals(message, response.getAttachment(RESPONSE_BODY));
            Assert.assertEquals(false, connection.isOpen());
        } finally {
            IoUtils.safeClose(connection);
        }
View Full Code Here

        }

        @Override
        public void completed(final ClientExchange result) {
            HttpServerExchange exchange = result.getAttachment(EXCHANGE);
            final ClientResponse response = result.getResponse();
            final HeaderMap inboundResponseHeaders = response.getResponseHeaders();
            final HeaderMap outboundResponseHeaders = exchange.getResponseHeaders();
            exchange.setResponseCode(response.getResponseCode());
            copyHeaders(outboundResponseHeaders, inboundResponseHeaders);
            if (exchange.isPersistent() && !result.getConnection().isOpen()) {
                //just because the client side is non-persistent it does not mean we want to close the connection to
                //the backend
                outboundResponseHeaders.put(Headers.CONNECTION, "keep-alive");
View Full Code Here

                        buffer.clear();
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                //check if an updated worked
                if (anyAreSet(AjpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    String connectionString = response.getResponseHeaders().getFirst(CONNECTION);
                    if (!UPGRADE.equalToString(connectionString)) {
                        //just unset the upgrade requested flag
                        AjpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here

                        pushBackStreamSourceConduit.pushBack(pooled);
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                String connectionString = response.getResponseHeaders().getFirst(CONNECTION);

                //check if an upgrade worked
                if (anyAreSet(HttpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    if ((connectionString == null || !UPGRADE.equalToString(connectionString)) && !response.getResponseHeaders().contains(UPGRADE)) {
                        //just unset the upgrade requested flag
                        HttpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here

        }

        @Override
        public void completed(final ClientExchange result) {
            HttpServerExchange exchange = result.getAttachment(EXCHANGE);
            final ClientResponse response = result.getResponse();
            final HeaderMap inboundResponseHeaders = response.getResponseHeaders();
            final HeaderMap outboundResponseHeaders = exchange.getResponseHeaders();
            exchange.setResponseCode(response.getResponseCode());
            copyHeaders(outboundResponseHeaders, inboundResponseHeaders);
            if (!exchange.isPersistent()) {
                //just because the client side is non-persistent it does not mean we want to close the connection to
                //the backend
                outboundResponseHeaders.put(Headers.CONNECTION, "keep-alive");
View Full Code Here

                        pushBackStreamSourceConduit.pushBack(pooled);
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                String connectionString = response.getResponseHeaders().getFirst(CONNECTION);

                //check if an upgrade worked
                if (anyAreSet(HttpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    if ((connectionString == null || !UPGRADE.equalToString(connectionString)) && !response.getResponseHeaders().contains(UPGRADE)) {
                        //just unset the upgrade requested flag
                        HttpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here

        }

        @Override
        public void completed(final ClientExchange result) {
            HttpServerExchange exchange = result.getAttachment(EXCHANGE);
            final ClientResponse response = result.getResponse();
            final HeaderMap inboundResponseHeaders = response.getResponseHeaders();
            final HeaderMap outboundResponseHeaders = exchange.getResponseHeaders();
            exchange.setResponseCode(response.getResponseCode());
            copyHeaders(outboundResponseHeaders, inboundResponseHeaders);
            if (exchange.isPersistent() && !result.getConnection().isOpen()) {
                //just because the client side is non-persistent it does not mean we want to close the connection to
                //the backend
                outboundResponseHeaders.put(Headers.CONNECTION, "keep-alive");
View Full Code Here

                        buffer.clear();
                    }

                } while (!state.isComplete());

                final ClientResponse response = builder.build();

                //check if an updated worked
                if (anyAreSet(AjpClientConnection.this.state, UPGRADE_REQUESTED)) {
                    String connectionString = response.getResponseHeaders().getFirst(CONNECTION);
                    if (connectionString == null || !UPGRADE.equalToString(connectionString)) {
                        //just unset the upgrade requested flag
                        AjpClientConnection.this.state &= ~UPGRADE_REQUESTED;
                    }
                }
View Full Code Here

TOP

Related Classes of io.undertow.client.ClientResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.