public interface WebSocketHttpExchange extends Closeable
- async - blocking - servlet
This class provides a way to operate on the underling exchange while providing the correct semantics regardless of the underlying exchange type.
The main use case for this is web sockets. Web sockets should be able to perform a handshake regardless of the nature of the underlying request, while still respecting servlet filters, security etc.
Modifier and Type | Method and Description |
---|---|
void | close() Forcibly close the exchange. |
void | endExchange() End the exchange normally. |
<T> T | getAttachment(AttachmentKey<T> key) |
ByteBufferPool | getBufferPool() |
org.xnio.OptionMap | getOptions() |
Set<WebSocketChannel> | getPeerConnections() |
String | getQueryString() |
String | getRequestHeader(String headerName) gets the first request header with the specified name |
Map<String,List<String>> | getRequestHeaders() |
Map<String,List<String>> | getRequestParameters() |
String | getRequestScheme() Get the request scheme, usually http or https |
String | getRequestURI() |
String | getResponseHeader(String headerName) get a response header |
Map<String,List<String>> | getResponseHeaders() |
Object | getSession() Gets the session, if any |
Principal | getUserPrincipal() |
boolean | isUserInRole(String role) |
<T> void | putAttachment(AttachmentKey<T> key, T value) |
org.xnio.IoFuture<byte[]> | readRequestData() Gets the body of the request. |
org.xnio.IoFuture<Void> | sendData(ByteBuffer data) Send some data |
void | setResponseHeader(String headerName, String headerValue) Set a response header |
void | setResponseHeaders(Map<String,List<String>> headers) Sets the response headers |
void | upgradeChannel(HttpUpgradeListener upgradeCallback) Upgrade the underlying channel |
<T> void putAttachment(AttachmentKey<T> key, T value)
<T> T getAttachment(AttachmentKey<T> key)
String getRequestHeader(String headerName)
headerName
- The header nameMap<String,List<String>> getRequestHeaders()
String getResponseHeader(String headerName)
headerName
- The header nameMap<String,List<String>> getResponseHeaders()
void setResponseHeaders(Map<String,List<String>> headers)
void setResponseHeader(String headerName, String headerValue)
headerName
- The header nameheaderValue
- The header valuevoid upgradeChannel(HttpUpgradeListener upgradeCallback)
upgradeCallback
- org.xnio.IoFuture<Void> sendData(ByteBuffer data)
data
- The dataorg.xnio.IoFuture<byte[]> readRequestData()
void endExchange()
void close()
close
in interface AutoCloseable
close
in interface Closeable
String getRequestScheme()
String getRequestURI()
ByteBufferPool getBufferPool()
String getQueryString()
Object getSession()
Principal getUserPrincipal()
boolean isUserInRole(String role)
Set<WebSocketChannel> getPeerConnections()
org.xnio.OptionMap getOptions()
Copyright © 2020 JBoss by Red Hat. All rights reserved.