Package io.undertow.server

Examples of io.undertow.server.HttpServerExchange$WriteDispatchChannel


    }

    @Override
    public void close() {
        HttpServletRequestImpl impl = HttpServletRequestImpl.getRequestImpl(request);
        HttpServerExchange exchange = impl.getExchange();
        IoUtils.safeClose(exchange.getConnection());
    }
View Full Code Here


    }

    @Override
    public Pool<ByteBuffer> getBufferPool() {
        HttpServletRequestImpl impl = HttpServletRequestImpl.getRequestImpl(request);
        HttpServerExchange exchange = impl.getExchange();
        return exchange.getConnection().getBufferPool();
    }
View Full Code Here

    }

    public void newRequest() {
        state.reset();
        read = 0;
        httpServerExchange = new HttpServerExchange(connection, maxEntitySize);
    }
View Full Code Here

                    IoUtils.safeClose(connection);
                    return;
                }
            } while (!state.isComplete());

            final HttpServerExchange httpServerExchange = this.httpServerExchange;
            httpServerExchange.setRequestScheme(connection.getSslSession() != null ? "https" : "http");
            this.httpServerExchange = null;
            requestStateUpdater.set(this, 1);
            HttpTransferEncoding.setupRequest(httpServerExchange);
            if (recordRequestStartTime) {
                Connectors.setRequestStartTime(httpServerExchange);
View Full Code Here

                //we have a request
                final SpdySynStreamStreamSourceChannel dataChannel = (SpdySynStreamStreamSourceChannel) frame;
                final SpdyServerConnection connection = new SpdyServerConnection(channel, dataChannel, undertowOptions, bufferSize);


                final HttpServerExchange exchange = new HttpServerExchange(connection, dataChannel.getHeaders(), dataChannel.getResponseChannel().getHeaders(), maxEntitySize);
                dataChannel.setMaxStreamSize(maxEntitySize);
                exchange.setRequestScheme(exchange.getRequestHeaders().getFirst(SCHEME));
                exchange.setProtocol(new HttpString(exchange.getRequestHeaders().getFirst(VERSION)));
                exchange.setRequestMethod(new HttpString(exchange.getRequestHeaders().getFirst(METHOD)));
                exchange.getRequestHeaders().put(Headers.HOST, exchange.getRequestHeaders().getFirst(HOST));
                final String path = exchange.getRequestHeaders().getFirst(PATH);
                setRequestPath(exchange, path, encoding, allowEncodingSlash, decodeBuffer);

                SSLSession session = channel.getSslSession();
                if(session != null) {
                    connection.setSslSessionInfo(new SpdySslSessionInfo(channel));
View Full Code Here

    }

    @Override
    public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject)
            throws AuthException {
        HttpServerExchange exchange = (HttpServerExchange) messageInfo.getMap().get(JASPIAuthenticationMechanism.HTTP_SERVER_EXCHANGE_ATTACHMENT_KEY);
        SecurityContext securityContext = (SecurityContext) messageInfo.getMap().get(JASPIAuthenticationMechanism.SECURITY_CONTEXT_ATTACHMENT_KEY);
        ServletRequestContext src = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
        List<AuthenticationMechanism> mechanisms = src.getDeployment().getAuthenticationMechanisms();

        try {
            boolean success = false;
            for (AuthenticationMechanism mechanism : mechanisms) {
                AuthenticationMechanism.AuthenticationMechanismOutcome result = mechanism.authenticate(exchange, securityContext);
                if (result == AUTHENTICATED) {
                    success = true;
                    break;
                } else if (result == NOT_AUTHENTICATED) {
                    break;
                }
            }
            if (!success) {
                for (AuthenticationMechanism mechanism : mechanisms) {
                    AuthenticationMechanism.ChallengeResult challengeResult = mechanism.sendChallenge(exchange, securityContext);
                    if (challengeResult.getDesiredResponseCode() != null) {
                        exchange.setResponseCode(challengeResult.getDesiredResponseCode());
                    }
                    if(exchange.isResponseComplete()) {
                        break;
                    }
                }
                return SEND_CONTINUE;
            }
View Full Code Here

    private final SessionConfig subject = new CodecSessionConfig(this.config, this.codec);

    @Test
    public void findSessionId() {
        HttpServerExchange exchange = new HttpServerExchange(null);

        when(this.config.findSessionId(exchange)).thenReturn(null);

        String result = this.subject.findSessionId(exchange);
View Full Code Here

        verify(this.config).setSessionId(exchange, reencodedSessionId);
    }

    @Test
    public void setSessionId() {
        HttpServerExchange exchange = new HttpServerExchange(null);
        String encodedSessionId = "session.route";
        String sessionId = "session";

        when(this.codec.encode(sessionId)).thenReturn(encodedSessionId);
View Full Code Here

        verify(this.config).setSessionId(exchange, encodedSessionId);
    }

    @Test
    public void clearSession() {
        HttpServerExchange exchange = new HttpServerExchange(null);
        String encodedSessionId = "session.route";
        String sessionId = "session";

        when(this.codec.encode(sessionId)).thenReturn(encodedSessionId);
View Full Code Here

        assertSame(encodedUrl, result);
    }

    @Test
    public void sessionCookieSource() {
        HttpServerExchange exchange = new HttpServerExchange(null);
        SessionConfig.SessionCookieSource expected = SessionConfig.SessionCookieSource.OTHER;

        when(this.config.sessionCookieSource(exchange)).thenReturn(expected);

        SessionConfig.SessionCookieSource result = this.subject.sessionCookieSource(exchange);
View Full Code Here

TOP

Related Classes of io.undertow.server.HttpServerExchange$WriteDispatchChannel

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.