Class ElytronHttpExchange

  • All Implemented Interfaces:
    org.wildfly.security.http.HttpExchangeSpi, org.wildfly.security.http.HttpServerScopes

    public class ElytronHttpExchange
    extends Object
    implements org.wildfly.security.http.HttpExchangeSpi
    Implementation of HttpExchangeSpi to wrap access to the Undertow specific HttpServerExchange.
    Author:
    Darran Lofthouse
    • Constructor Detail

      • ElytronHttpExchange

        protected ElytronHttpExchange​(io.undertow.server.HttpServerExchange httpServerExchange,
                                      Map<org.wildfly.security.http.Scope,​Function<io.undertow.server.HttpServerExchange,​org.wildfly.security.http.HttpScope>> scopeResolvers,
                                      ScopeSessionListener scopeSessionListener)
      • ElytronHttpExchange

        protected ElytronHttpExchange​(io.undertow.server.HttpServerExchange httpServerExchange)
    • Method Detail

      • getRequestHeaderValues

        public List<String> getRequestHeaderValues​(String headerName)
        Specified by:
        getRequestHeaderValues in interface org.wildfly.security.http.HttpExchangeSpi
        See Also:
        HttpExchangeSpi.getRequestHeaderValues(java.lang.String)
      • addResponseHeader

        public void addResponseHeader​(String headerName,
                                      String headerValue)
        Specified by:
        addResponseHeader in interface org.wildfly.security.http.HttpExchangeSpi
        See Also:
        HttpExchangeSpi.addResponseHeader(java.lang.String, java.lang.String)
      • getSSLSession

        public SSLSession getSSLSession()
        Specified by:
        getSSLSession in interface org.wildfly.security.http.HttpExchangeSpi
        See Also:
        HttpExchangeSpi.getSSLSession()
      • getPeerCertificates

        public Certificate[] getPeerCertificates​(boolean renegotiate)
        Specified by:
        getPeerCertificates in interface org.wildfly.security.http.HttpExchangeSpi
      • authenticationComplete

        public void authenticationComplete​(org.wildfly.security.auth.server.SecurityIdentity securityIdentity,
                                           String mechanismName)
        Specified by:
        authenticationComplete in interface org.wildfly.security.http.HttpExchangeSpi
        See Also:
        HttpExchangeSpi.authenticationComplete(SecurityIdentity, String)
      • authenticationFailed

        public void authenticationFailed​(String message,
                                         String mechanismName)
        Specified by:
        authenticationFailed in interface org.wildfly.security.http.HttpExchangeSpi
        See Also:
        HttpExchangeSpi.authenticationFailed(String, String)
      • badRequest

        public void badRequest​(org.wildfly.security.http.HttpAuthenticationException error,
                               String mechanismName)
        Specified by:
        badRequest in interface org.wildfly.security.http.HttpExchangeSpi
      • getRequestMethod

        public String getRequestMethod()
        Specified by:
        getRequestMethod in interface org.wildfly.security.http.HttpExchangeSpi
      • getRequestURI

        public URI getRequestURI()
        Specified by:
        getRequestURI in interface org.wildfly.security.http.HttpExchangeSpi
      • getRequestPath

        public String getRequestPath()
        Specified by:
        getRequestPath in interface org.wildfly.security.http.HttpExchangeSpi
      • getRequestParameters

        public Map<String,​List<String>> getRequestParameters()
        Specified by:
        getRequestParameters in interface org.wildfly.security.http.HttpExchangeSpi
      • getCookies

        public List<org.wildfly.security.http.HttpServerCookie> getCookies()
        Specified by:
        getCookies in interface org.wildfly.security.http.HttpExchangeSpi
      • getRequestInputStream

        public InputStream getRequestInputStream()
        Specified by:
        getRequestInputStream in interface org.wildfly.security.http.HttpExchangeSpi
      • getSourceAddress

        public InetSocketAddress getSourceAddress()
        Specified by:
        getSourceAddress in interface org.wildfly.security.http.HttpExchangeSpi
      • setResponseCookie

        public void setResponseCookie​(org.wildfly.security.http.HttpServerCookie cookie)
        Specified by:
        setResponseCookie in interface org.wildfly.security.http.HttpExchangeSpi
      • getResponseOutputStream

        public OutputStream getResponseOutputStream()
        Specified by:
        getResponseOutputStream in interface org.wildfly.security.http.HttpExchangeSpi
      • getScope

        public org.wildfly.security.http.HttpScope getScope​(org.wildfly.security.http.Scope scope)
        Specified by:
        getScope in interface org.wildfly.security.http.HttpServerScopes
      • getScopeIds

        public Collection<String> getScopeIds​(org.wildfly.security.http.Scope scope)
        Specified by:
        getScopeIds in interface org.wildfly.security.http.HttpServerScopes
      • getScope

        public org.wildfly.security.http.HttpScope getScope​(org.wildfly.security.http.Scope scope,
                                                            String id)
        Specified by:
        getScope in interface org.wildfly.security.http.HttpServerScopes
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Specified by:
        setStatusCode in interface org.wildfly.security.http.HttpExchangeSpi
      • getRemoteUser

        public String getRemoteUser()
        Specified by:
        getRemoteUser in interface org.wildfly.security.http.HttpExchangeSpi
      • getSessionManager

        protected io.undertow.server.session.SessionManager getSessionManager()
        Sub-types may override this method to define how SessionManager is obtained.
        Returns:
        the SessionManager
      • getSessionConfig

        protected io.undertow.server.session.SessionConfig getSessionConfig()
        Sub-types may override this method to define how SessionConfig is obtained.
        Returns:
        the SessionConfig