Top Description Fields Constructors Methods
io.undertow.server.protocol.http2

public Class Http2ServerConnection

extends ServerConnection
Class Inheritance
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.nio.charset.StandardCharsets, java.util.List, javax.net.ssl.SSLSession, io.undertow.UndertowLogger, .UndertowOptions, .UndertowMessages, io.undertow.protocols.http2.Http2HeadersStreamSinkChannel, .Http2Channel, .Http2DataStreamSinkChannel, .Http2StreamSourceChannel, io.undertow.server.ConduitWrapper, .ExchangeCompletionListener, .HttpHandler, .XnioBufferPoolAdaptor, .Connectors, .HttpServerExchange, .HttpUpgradeListener, .SSLSessionInfo, .ServerConnection, io.undertow.server.protocol.http.HttpContinue, io.undertow.util.ConduitFactory, .DateUtils, .Headers, .ParameterLimitException, .Protocols, .AttachmentKey, .AttachmentList, .HeaderMap, .HttpString, .StatusCodes, .URLUtils, org.xnio.ChannelListener, .Option, .OptionMap, .Pool, .StreamConnection, .XnioIoThread, .XnioWorker, io.undertow.connector.ByteBufferPool, org.xnio.channels.Configurable, .ConnectedChannel, org.xnio.conduits.ConduitStreamSinkChannel, .ConduitStreamSourceChannel, .EmptyStreamSourceConduit, .StreamSinkChannelWrappingConduit, .StreamSinkConduit, .StreamSourceChannelWrappingConduit, .StreamSourceConduit, .WriteReadyHandler

A server connection. There is one connection per request

Todo

how are we going to deal with attachments?

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final int
private final Http2Channel
private final ConduitStreamSinkChannel
private final ConduitStreamSourceChannel
private boolean
private HttpServerExchange
private final StreamSinkConduit
private final StreamSourceConduit
private XnioBufferPoolAdaptor
poolAdaptor

References Deprecated XnioBufferPoolAdaptor is deprecated or references (maybe indirectly) at least one deprecated element.
private final String
private final Http2StreamSourceChannel
private final Http2DataStreamSinkChannel
private final HttpHandler
private SSLSessionInfo
private static final HttpString
private final OptionMap

Constructor Summary

AccessConstructor and Description
public
Http2ServerConnection(Http2Channel channel, Http2StreamSourceChannel requestChannel, OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)

public
Http2ServerConnection(Http2Channel channel, Http2DataStreamSinkChannel sinkChannel, OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)

Channel that is used when the request is already half closed

Method Summary

Modifier and TypeMethod and Description
public void
addCloseListener(final ServerConnection.CloseListener
The close listener
listener
)

Implements abstract io.undertow.server.ServerConnection.addCloseListener.

Adds a close listener, than will be invoked with the connection is closed

public <T> void
addToAttachmentList(AttachmentKey<AttachmentList<T>>
the attachment key
key
,
T
the value to add
value
)

Overrides io.undertow.util.AbstractAttachable.addToAttachmentList.

Implements io.undertow.util.Attachable.addToAttachmentList.

Add a value to a list-typed attachment key.

public void
protected void
exchangeComplete(HttpServerExchange exchange)

Implements abstract io.undertow.server.ServerConnection.exchangeComplete.

Invoked when the exchange is complete.

public <T> T
public <T> List<T>
getAttachmentList(AttachmentKey<? extends List<T>>
the attachment key
key
)

Overrides io.undertow.util.AbstractAttachable.getAttachmentList.

Implements io.undertow.util.Attachable.getAttachmentList.

Gets a list attachment value.

public Pool<ByteBuffer>
getBufferPool()

Implements abstract io.undertow.server.ServerConnection.getBufferPool.

References Deprecated Pool is deprecated or references (maybe indirectly) at least one deprecated element.

public int
public ByteBufferPool
public ChannelListener.Setter<? extends ConnectedChannel>
getCloseSetter()

Implements org.xnio.channels.ConnectedChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public XnioIoThread
getIoThread()

Implements abstract io.undertow.server.ServerConnection.getIoThread.

Implements org.xnio.channels.CloseableChannel.getIoThread.

Get the I/O thread associated with this channel.

public SocketAddress
getLocalAddress()

Implements abstract io.undertow.server.ServerConnection.getLocalAddress.

Implements org.xnio.channels.BoundChannel.getLocalAddress.

Get the local address that this channel is bound to.

public <A extends SocketAddress> A
getLocalAddress(Class<A>
the address type class
type
)

Implements abstract io.undertow.server.ServerConnection.getLocalAddress.

Implements org.xnio.channels.BoundChannel.getLocalAddress.

Get the local address of a given type, or null if the address is not of that type.

public <T> T
getOption(Option<T>
the option to get
option
)

Implements abstract io.undertow.server.ServerConnection.getOption.

Implements org.xnio.channels.Configurable.getOption.

Get the value of a channel option.

public SocketAddress
getPeerAddress()

Implements abstract io.undertow.server.ServerConnection.getPeerAddress.

Implements org.xnio.channels.ConnectedChannel.getPeerAddress.

Returns the actual address of the remote connection.

public <A extends SocketAddress> A
getPeerAddress(Class<A>
The type of address to return
type
)

Implements abstract io.undertow.server.ServerConnection.getPeerAddress.

Implements org.xnio.channels.ConnectedChannel.getPeerAddress.

Returns the actual address of the remote connection.

public String
protected ConduitStreamSinkChannel
protected StreamSinkConduit
getSinkConduit(HttpServerExchange exchange, StreamSinkConduit conduit)

Implements abstract io.undertow.server.ServerConnection.getSinkConduit.

Gets the sink conduit that should be used for this request.

protected ConduitStreamSourceChannel
public SSLSession
getSslSession()

Overrides io.undertow.server.ServerConnection.getSslSession.

Gets the SSLSession of the underlying connection, or null if SSL is not in use.

public SSLSessionInfo
getSslSessionInfo()

Implements abstract io.undertow.server.ServerConnection.getSslSessionInfo.

Gets SSL information about the connection.

public String
getTransportProtocol()

Implements abstract io.undertow.server.ServerConnection.getTransportProtocol.

Returns a string representation describing the protocol used to transmit messages on this connection.

public OptionMap
public XnioWorker
getWorker()

Implements abstract io.undertow.server.ServerConnection.getWorker.

Implements org.xnio.channels.CloseableChannel.getWorker.

Get the worker for this channel.

protected boolean
public boolean
public boolean
isOpen()

Implements abstract io.undertow.server.ServerConnection.isOpen.

Implements java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

public boolean
public boolean
protected boolean
protected void
maxEntitySizeUpdated(HttpServerExchange
The current exchange
exchange
)

Implements abstract io.undertow.server.ServerConnection.maxEntitySizeUpdated.

Callback that is invoked if the max entity size is updated.

public boolean
pushResource(String
The path of the resource
path
,
HttpString
The request method
method
,
HeaderMap
The request headers
requestHeaders
)

Overrides io.undertow.server.ServerConnection.pushResource.

Attempts to push a resource if this connection supports server push.

public boolean
pushResource(String
The path of the resource
path
,
HttpString
The request method
method
,
HeaderMap
The request headers
requestHeaders
,
final HttpHandler handler)

Overrides io.undertow.server.ServerConnection.pushResource.

Attempts to push a resource if this connection supports server push.

public <T> T
putAttachment(AttachmentKey<T>
the attachment key
key
,
T
the new value
value
)

Overrides io.undertow.util.AbstractAttachable.putAttachment.

Implements io.undertow.util.Attachable.putAttachment.

Set an attachment value.

public <T> T
removeAttachment(AttachmentKey<T>
the attachment key
key
)

Overrides io.undertow.util.AbstractAttachable.removeAttachment.

Implements io.undertow.util.Attachable.removeAttachment.

Remove an attachment, returning its previous value.

public HttpServerExchange
sendOutOfBandResponse(HttpServerExchange
The current exchange
exchange
)

Implements abstract io.undertow.server.ServerConnection.sendOutOfBandResponse.

Sends an out of band response, such as a HTTP 100-continue response.

protected void
pack-priv void
public <T> T
setOption(Option<T>
the option to set
option
,
T
the value of the option to set
value
)

Implements abstract io.undertow.server.ServerConnection.setOption.

Implements org.xnio.channels.Configurable.setOption.

Set an option for this channel.

public void
setSslSessionInfo(SSLSessionInfo
The ssl session information
sessionInfo
)

Implements abstract io.undertow.server.ServerConnection.setSslSessionInfo.

Sets the current SSL information.

protected void
public boolean
supportsOption(Option<?>
the option
option
)

Implements abstract io.undertow.server.ServerConnection.supportsOption.

Implements org.xnio.channels.Configurable.supportsOption.

Determine whether an option is supported on this channel.

public void
terminateRequestChannel(HttpServerExchange
The current exchange.
exchange
)

Implements abstract io.undertow.server.ServerConnection.terminateRequestChannel.

Invoked when the exchange is complete, and there is still data in the request channel.

protected StreamConnection
upgradeChannel()

Implements abstract io.undertow.server.ServerConnection.upgradeChannel.

Upgrade the connection, if allowed

Inherited from io.undertow.server.ServerConnection:
getId