public class Http2ServerConnection extends ServerConnection
ServerConnection.CloseListener| Constructor and Description |
|---|
Http2ServerConnection(Http2Channel channel, Http2DataStreamSinkChannel sinkChannel, org.xnio.OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler) Channel that is used when the request is already half closed |
Http2ServerConnection(Http2Channel channel, Http2StreamSourceChannel requestChannel, org.xnio.OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler) |
| Modifier and Type | Method and Description |
|---|---|
void | addCloseListener(ServerConnection.CloseListener listener) Adds a close listener, than will be invoked with the connection is closed |
<T> void | addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value) Add a value to a list-typed attachment key. |
void | close() |
protected void | exchangeComplete(HttpServerExchange exchange) Invoked when the exchange is complete. |
<T> T | getAttachment(AttachmentKey<T> key) Get an attachment value. |
<T> List<T> | getAttachmentList(AttachmentKey<? extends List<T>> key) Gets a list attachment value. |
org.xnio.Pool<ByteBuffer> | getBufferPool() |
int | getBufferSize() |
ByteBufferPool | getByteBufferPool() |
org.xnio.ChannelListener.Setter<? extends org.xnio.channels.ConnectedChannel> | getCloseSetter() |
org.xnio.XnioIoThread | getIoThread() |
SocketAddress | getLocalAddress() |
<A extends SocketAddress> | getLocalAddress(Class<A> type) |
<T> T | getOption(org.xnio.Option<T> option) |
SocketAddress | getPeerAddress() Returns the actual address of the remote connection. |
<A extends SocketAddress> | getPeerAddress(Class<A> type) Returns the actual address of the remote connection. |
protected org.xnio.conduits.ConduitStreamSinkChannel | getSinkChannel() |
protected org.xnio.conduits.StreamSinkConduit | getSinkConduit(HttpServerExchange exchange, org.xnio.conduits.StreamSinkConduit conduit) Gets the sink conduit that should be used for this request. |
protected org.xnio.conduits.ConduitStreamSourceChannel | getSourceChannel() |
SSLSessionInfo | getSslSessionInfo() Gets SSL information about the connection. |
String | getTransportProtocol() Returns a string representation describing the protocol used to transmit messages on this connection. |
org.xnio.OptionMap | getUndertowOptions() |
org.xnio.XnioWorker | getWorker() |
protected boolean | isConnectSupported() |
boolean | isContinueResponseSupported() |
boolean | isOpen() |
boolean | isPushSupported() |
protected boolean | isUpgradeSupported() |
protected void | maxEntitySizeUpdated(HttpServerExchange exchange) Callback that is invoked if the max entity size is updated. |
boolean | pushResource(String path, HttpString method, HeaderMap requestHeaders) Attempts to push a resource if this connection supports server push. |
boolean | pushResource(String path, HttpString method, HeaderMap requestHeaders, HttpHandler handler) Attempts to push a resource if this connection supports server push. |
<T> T | putAttachment(AttachmentKey<T> key, T value) Set an attachment value. |
<T> T | removeAttachment(AttachmentKey<T> key) Remove an attachment, returning its previous value. |
HttpServerExchange | sendOutOfBandResponse(HttpServerExchange exchange) Sends an out of band response, such as a HTTP 100-continue response. |
protected void | setConnectListener(HttpUpgradeListener connectListener) |
<T> T | setOption(org.xnio.Option<T> option, T value) |
void | setSslSessionInfo(SSLSessionInfo sessionInfo) Sets the current SSL information. |
protected void | setUpgradeListener(HttpUpgradeListener upgradeListener) |
boolean | supportsOption(org.xnio.Option<?> option) |
void | terminateRequestChannel(HttpServerExchange exchange) Invoked when the exchange is complete, and there is still data in the request channel. |
protected org.xnio.StreamConnection | upgradeChannel() Upgrade the connection, if allowed |
createAttachmentMappublic Http2ServerConnection(Http2Channel channel, Http2StreamSourceChannel requestChannel, org.xnio.OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)
public Http2ServerConnection(Http2Channel channel, Http2DataStreamSinkChannel sinkChannel, org.xnio.OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)
channel - undertowOptions - bufferSize - rootHandler - public org.xnio.Pool<ByteBuffer> getBufferPool()
getBufferPool in class ServerConnectionpublic ByteBufferPool getByteBufferPool()
getByteBufferPool in class ServerConnectionpublic org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelgetWorker in class ServerConnectionpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelgetIoThread in class ServerConnectionpublic HttpServerExchange sendOutOfBandResponse(HttpServerExchange exchange)
ServerConnectionsendOutOfBandResponse in class ServerConnectionexchange - The current exchangepublic boolean isContinueResponseSupported()
isContinueResponseSupported in class ServerConnectiontrue if this connection supports sending a 100-continue responsepublic void terminateRequestChannel(HttpServerExchange exchange)
ServerConnectionterminateRequestChannel in class ServerConnectionexchange - The current exchange.public boolean isOpen()
isOpen in interface ChannelisOpen in class ServerConnectionpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.ConfigurablesupportsOption in class ServerConnectionpublic <T> T getOption(org.xnio.Option<T> option)
throws IOException getOption in interface org.xnio.channels.ConfigurablegetOption in class ServerConnectionIOExceptionpublic <T> T setOption(org.xnio.Option<T> option,
T value)
throws IllegalArgumentException,
IOException setOption in interface org.xnio.channels.ConfigurablesetOption in class ServerConnectionIllegalArgumentExceptionIOExceptionpublic void close()
throws IOException close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelclose in class ServerConnectionIOExceptionpublic SocketAddress getPeerAddress()
ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelgetPeerAddress in class ServerConnectionpublic <A extends SocketAddress> A getPeerAddress(Class<A> type)
ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelgetPeerAddress in class ServerConnectionA - The address typetype - The type of address to returnpublic org.xnio.ChannelListener.Setter<? extends org.xnio.channels.ConnectedChannel> getCloseSetter()
public SocketAddress getLocalAddress()
getLocalAddress in interface org.xnio.channels.BoundChannelgetLocalAddress in class ServerConnectionpublic <A extends SocketAddress> A getLocalAddress(Class<A> type)
getLocalAddress in interface org.xnio.channels.BoundChannelgetLocalAddress in class ServerConnectionpublic org.xnio.OptionMap getUndertowOptions()
getUndertowOptions in class ServerConnectionpublic int getBufferSize()
getBufferSize in class ServerConnectionpublic SSLSessionInfo getSslSessionInfo()
ServerConnectiongetSslSessionInfo in class ServerConnectionpublic void setSslSessionInfo(SSLSessionInfo sessionInfo)
ServerConnectionsetSslSessionInfo in class ServerConnectionsessionInfo - The ssl session informationpublic void addCloseListener(ServerConnection.CloseListener listener)
ServerConnectionaddCloseListener in class ServerConnectionlistener - The close listenerprotected org.xnio.StreamConnection upgradeChannel()
ServerConnectionupgradeChannel in class ServerConnectionprotected org.xnio.conduits.ConduitStreamSinkChannel getSinkChannel()
getSinkChannel in class ServerConnectionprotected org.xnio.conduits.ConduitStreamSourceChannel getSourceChannel()
getSourceChannel in class ServerConnectionprotected org.xnio.conduits.StreamSinkConduit getSinkConduit(HttpServerExchange exchange, org.xnio.conduits.StreamSinkConduit conduit)
ServerConnectiongetSinkConduit in class ServerConnectionprotected boolean isUpgradeSupported()
isUpgradeSupported in class ServerConnectionprotected boolean isConnectSupported()
isConnectSupported in class ServerConnectiontrue if this connection supports the HTTP CONNECT verbprotected void exchangeComplete(HttpServerExchange exchange)
ServerConnectionexchangeComplete in class ServerConnectionprotected void setUpgradeListener(HttpUpgradeListener upgradeListener)
setUpgradeListener in class ServerConnectionprotected void setConnectListener(HttpUpgradeListener connectListener)
setConnectListener in class ServerConnectionprotected void maxEntitySizeUpdated(HttpServerExchange exchange)
ServerConnectionmaxEntitySizeUpdated in class ServerConnectionexchange - The current exchangepublic <T> void addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value)
AbstractAttachableaddToAttachmentList in interface AttachableaddToAttachmentList in class AbstractAttachableT - the list value typekey - the attachment keyvalue - the value to addpublic <T> T removeAttachment(AttachmentKey<T> key)
AbstractAttachableremoveAttachment in interface AttachableremoveAttachment in class AbstractAttachableT - the value typekey - the attachment keynull if there was nonepublic <T> T putAttachment(AttachmentKey<T> key, T value)
AbstractAttachablenull, the attachment key is removed.putAttachment in interface AttachableputAttachment in class AbstractAttachableT - the value typekey - the attachment keyvalue - the new valuenull if there was nonepublic <T> List<T> getAttachmentList(AttachmentKey<? extends List<T>> key)
AbstractAttachablegetAttachmentList in interface AttachablegetAttachmentList in class AbstractAttachableT - the value typekey - the attachment keypublic <T> T getAttachment(AttachmentKey<T> key)
AbstractAttachablenull is returned.getAttachment in interface AttachablegetAttachment in class AbstractAttachableT - the value typekey - the attachment keynull if there is nonepublic boolean isPushSupported()
isPushSupported in class ServerConnectionpublic boolean pushResource(String path, HttpString method, HeaderMap requestHeaders)
ServerConnectionpushResource in class ServerConnectionpath - The path of the resourcemethod - The request methodrequestHeaders - The request headerstrue if the server attempted the push, false otherwisepublic boolean pushResource(String path, HttpString method, HeaderMap requestHeaders, HttpHandler handler)
ServerConnectionHttpHandler passed in will be used to generate the pushed responsepushResource in class ServerConnectionpath - The path of the resourcemethod - The request methodrequestHeaders - The request headerstrue if the server attempted the push, false otherwisepublic String getTransportProtocol()
ServerConnectiongetTransportProtocol in class ServerConnectionCopyright © 2015 JBoss by Red Hat. All rights reserved.