Attachable, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.InterruptibleChannel, org.xnio.channels.BoundChannel, org.xnio.channels.CloseableChannel, org.xnio.channels.Configurable, org.xnio.channels.ConnectedChannelAbstractServerConnection, Http2ServerConnectionpublic abstract class ServerConnection extends AbstractAttachable implements org.xnio.channels.ConnectedChannel
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
ServerConnection.CloseListener |
| Constructor | Description |
|---|---|
ServerConnection() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
addCloseListener(ServerConnection.CloseListener listener) |
Adds a close listener, than will be invoked with the connection is closed
|
abstract void |
close() |
|
protected abstract void |
exchangeComplete(HttpServerExchange exchange) |
Invoked when the exchange is complete.
|
abstract org.xnio.Pool<java.nio.ByteBuffer> |
getBufferPool() |
Deprecated.
|
abstract int |
getBufferSize() |
|
abstract ByteBufferPool |
getByteBufferPool() |
|
abstract org.xnio.XnioIoThread |
getIoThread() |
|
abstract java.net.SocketAddress |
getLocalAddress() |
|
abstract <A extends java.net.SocketAddress> |
getLocalAddress(java.lang.Class<A> type) |
|
abstract <T> T |
getOption(org.xnio.Option<T> option) |
|
abstract java.net.SocketAddress |
getPeerAddress() |
Returns the actual address of the remote connection.
|
abstract <A extends java.net.SocketAddress> |
getPeerAddress(java.lang.Class<A> type) |
Returns the actual address of the remote connection.
|
protected abstract org.xnio.conduits.ConduitStreamSinkChannel |
getSinkChannel() |
|
protected abstract org.xnio.conduits.StreamSinkConduit |
getSinkConduit(HttpServerExchange exchange,
org.xnio.conduits.StreamSinkConduit conduit) |
Gets the sink conduit that should be used for this request.
|
protected abstract org.xnio.conduits.ConduitStreamSourceChannel |
getSourceChannel() |
|
javax.net.ssl.SSLSession |
getSslSession() |
Gets the SSLSession of the underlying connection, or null if SSL is not in use.
|
abstract SSLSessionInfo |
getSslSessionInfo() |
Gets SSL information about the connection.
|
abstract java.lang.String |
getTransportProtocol() |
Returns a string representation describing the protocol used to transmit messages
on this connection.
|
abstract org.xnio.OptionMap |
getUndertowOptions() |
|
abstract org.xnio.XnioWorker |
getWorker() |
|
protected abstract boolean |
isConnectSupported() |
|
abstract boolean |
isContinueResponseSupported() |
|
abstract boolean |
isOpen() |
|
boolean |
isPushSupported() |
|
protected abstract boolean |
isUpgradeSupported() |
|
protected abstract void |
maxEntitySizeUpdated(HttpServerExchange exchange) |
Callback that is invoked if the max entity size is updated.
|
boolean |
pushResource(java.lang.String path,
HttpString method,
HeaderMap requestHeaders) |
Attempts to push a resource if this connection supports server push.
|
boolean |
pushResource(java.lang.String path,
HttpString method,
HeaderMap requestHeaders,
HttpHandler handler) |
Attempts to push a resource if this connection supports server push.
|
abstract HttpServerExchange |
sendOutOfBandResponse(HttpServerExchange exchange) |
Sends an out of band response, such as a HTTP 100-continue response.
|
protected abstract void |
setConnectListener(HttpUpgradeListener connectListener) |
|
abstract <T> T |
setOption(org.xnio.Option<T> option,
T value) |
|
abstract void |
setSslSessionInfo(SSLSessionInfo sessionInfo) |
Sets the current SSL information.
|
protected abstract void |
setUpgradeListener(HttpUpgradeListener upgradeListener) |
|
abstract boolean |
supportsOption(org.xnio.Option<?> option) |
|
abstract void |
terminateRequestChannel(HttpServerExchange exchange) |
Invoked when the exchange is complete, and there is still data in the request channel.
|
protected abstract org.xnio.StreamConnection |
upgradeChannel() |
Upgrade the connection, if allowed
|
addToAttachmentList, createAttachmentMap, getAttachment, getAttachmentList, putAttachment, removeAttachment@Deprecated public abstract org.xnio.Pool<java.nio.ByteBuffer> getBufferPool()
public abstract ByteBufferPool getByteBufferPool()
public abstract org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelpublic abstract org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelpublic abstract HttpServerExchange sendOutOfBandResponse(HttpServerExchange exchange)
exchange - The current exchangepublic abstract boolean isContinueResponseSupported()
true if this connection supports sending a 100-continue responsepublic abstract void terminateRequestChannel(HttpServerExchange exchange)
exchange - The current exchange.public abstract boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic abstract boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.Configurablepublic abstract <T> T getOption(org.xnio.Option<T> option)
throws java.io.IOException
getOption in interface org.xnio.channels.Configurablejava.io.IOExceptionpublic abstract <T> T setOption(org.xnio.Option<T> option,
T value)
throws java.lang.IllegalArgumentException,
java.io.IOException
setOption in interface org.xnio.channels.Configurablejava.lang.IllegalArgumentExceptionjava.io.IOExceptionpublic abstract void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in interface java.io.Closeableclose in interface org.xnio.channels.CloseableChannelclose in interface java.nio.channels.InterruptibleChanneljava.io.IOExceptionpublic javax.net.ssl.SSLSession getSslSession()
getSslSessionInfo() should be used instead, as it
takes into account other information potentially provided by load balancers that terminate SSLpublic abstract java.net.SocketAddress getPeerAddress()
getPeerAddress in interface org.xnio.channels.ConnectedChannelpublic abstract <A extends java.net.SocketAddress> A getPeerAddress(java.lang.Class<A> type)
getPeerAddress in interface org.xnio.channels.ConnectedChannelA - The address typetype - The type of address to returnpublic abstract java.net.SocketAddress getLocalAddress()
getLocalAddress in interface org.xnio.channels.BoundChannelpublic abstract <A extends java.net.SocketAddress> A getLocalAddress(java.lang.Class<A> type)
getLocalAddress in interface org.xnio.channels.BoundChannelpublic abstract org.xnio.OptionMap getUndertowOptions()
public abstract int getBufferSize()
public abstract SSLSessionInfo getSslSessionInfo()
public abstract void setSslSessionInfo(SSLSessionInfo sessionInfo)
sessionInfo - The ssl session informationpublic abstract void addCloseListener(ServerConnection.CloseListener listener)
listener - The close listenerprotected abstract org.xnio.StreamConnection upgradeChannel()
protected abstract org.xnio.conduits.ConduitStreamSinkChannel getSinkChannel()
protected abstract org.xnio.conduits.ConduitStreamSourceChannel getSourceChannel()
protected abstract org.xnio.conduits.StreamSinkConduit getSinkConduit(HttpServerExchange exchange, org.xnio.conduits.StreamSinkConduit conduit)
protected abstract boolean isUpgradeSupported()
protected abstract boolean isConnectSupported()
true if this connection supports the HTTP CONNECT verbprotected abstract void exchangeComplete(HttpServerExchange exchange)
protected abstract void setUpgradeListener(HttpUpgradeListener upgradeListener)
protected abstract void setConnectListener(HttpUpgradeListener connectListener)
protected abstract void maxEntitySizeUpdated(HttpServerExchange exchange)
exchange - The current exchangepublic abstract java.lang.String getTransportProtocol()
public boolean pushResource(java.lang.String path,
HttpString method,
HeaderMap requestHeaders)
path - The path of the resourcemethod - The request methodrequestHeaders - The request headerstrue if the server attempted the push, false otherwisepublic boolean pushResource(java.lang.String path,
HttpString method,
HeaderMap requestHeaders,
HttpHandler handler)
HttpHandler passed in will be used to generate the pushed responsepath - The path of the resourcemethod - The request methodrequestHeaders - The request headerstrue if the server attempted the push, false otherwisepublic boolean isPushSupported()
Copyright © 2018. All rights reserved.