public class Http2ServerConnection extends ServerConnection
ServerConnection.CloseListenerEMPTY| Constructor and Description |
|---|
Http2ServerConnection(Http2Channel channel,
Http2DataStreamSinkChannel sinkChannel,
OptionMap undertowOptions,
int bufferSize,
HttpHandler rootHandler)
Channel that is used when the request is already half closed
|
Http2ServerConnection(Http2Channel channel,
Http2StreamSourceChannel requestChannel,
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()
Close this channel.
|
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.
|
Pool<ByteBuffer> |
getBufferPool() |
int |
getBufferSize() |
ByteBufferPool |
getByteBufferPool() |
ChannelListener.Setter<? extends ConnectedChannel> |
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.
|
XnioIoThread |
getIoThread()
Get the I/O thread associated with this channel.
|
SocketAddress |
getLocalAddress()
Get the local address that this channel is bound to.
|
<A extends SocketAddress> |
getLocalAddress(Class<A> type)
Get the local address of a given type, or
null if the address is not of that
type. |
<T> T |
getOption(Option<T> option)
Get the value of a channel 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 ConduitStreamSinkChannel |
getSinkChannel() |
protected StreamSinkConduit |
getSinkConduit(HttpServerExchange exchange,
StreamSinkConduit conduit)
Gets the sink conduit that should be used for this request.
|
protected ConduitStreamSourceChannel |
getSourceChannel() |
SSLSession |
getSslSession()
Gets the SSLSession of the underlying connection, or null if SSL is not in use.
|
SSLSessionInfo |
getSslSessionInfo()
Gets SSL information about the connection.
|
String |
getTransportProtocol()
Returns a string representation describing the protocol used to transmit messages
on this connection.
|
OptionMap |
getUndertowOptions() |
XnioWorker |
getWorker()
Get the worker for this channel.
|
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(Option<T> option,
T value)
Set an option for this channel.
|
void |
setSslSessionInfo(SSLSessionInfo sessionInfo)
Sets the current SSL information.
|
protected void |
setUpgradeListener(HttpUpgradeListener upgradeListener) |
boolean |
supportsOption(Option<?> option)
Determine whether an option is supported on this channel.
|
void |
terminateRequestChannel(HttpServerExchange exchange)
Invoked when the exchange is complete, and there is still data in the request channel.
|
protected StreamConnection |
upgradeChannel()
Upgrade the connection, if allowed
|
createAttachmentMappublic Http2ServerConnection(Http2Channel channel, Http2StreamSourceChannel requestChannel, OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)
public Http2ServerConnection(Http2Channel channel, Http2DataStreamSinkChannel sinkChannel, OptionMap undertowOptions, int bufferSize, HttpHandler rootHandler)
channel - undertowOptions - bufferSize - rootHandler - public Pool<ByteBuffer> getBufferPool()
getBufferPool in class ServerConnectionpublic SSLSession getSslSession()
ServerConnectionServerConnection.getSslSessionInfo() should be used instead, as it
takes into account other information potentially provided by load balancers that terminate SSLgetSslSession in class ServerConnectionpublic ByteBufferPool getByteBufferPool()
getByteBufferPool in class ServerConnectionpublic XnioWorker getWorker()
CloseableChannelgetWorker in interface CloseableChannelgetWorker in class ServerConnectionpublic XnioIoThread getIoThread()
CloseableChannelgetIoThread in interface 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(Option<?> option)
ConfigurablesupportsOption in interface ConfigurablesupportsOption in class ServerConnectionoption - the optiontrue if it is supportedpublic <T> T getOption(Option<T> option) throws IOException
ConfigurablegetOption in interface ConfigurablegetOption in class ServerConnectionT - the type of the option valueoption - the option to getnull if it is not setIOException - if an I/O error occurred when reading the optionpublic <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException
ConfigurablesetOption in interface ConfigurablesetOption in class ServerConnectionT - the type of the option valueoption - the option to setvalue - the value of the option to setIllegalArgumentException - if the value is not acceptable for this optionIOException - if an I/O error occurred when modifying the optionpublic void close()
throws IOException
CloseableChannelclose in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface CloseableChannelclose in class ServerConnectionIOException - if the close failedpublic SocketAddress getPeerAddress()
ServerConnectiongetPeerAddress in interface ConnectedChannelgetPeerAddress in class ServerConnectionpublic <A extends SocketAddress> A getPeerAddress(Class<A> type)
ServerConnectiongetPeerAddress in interface ConnectedChannelgetPeerAddress in class ServerConnectionA - The address typetype - The type of address to returnpublic ChannelListener.Setter<? extends ConnectedChannel> getCloseSetter()
ConnectedChannelpublic SocketAddress getLocalAddress()
BoundChannelgetLocalAddress in interface BoundChannelgetLocalAddress in class ServerConnectionpublic <A extends SocketAddress> A getLocalAddress(Class<A> type)
BoundChannelnull if the address is not of that
type.getLocalAddress in interface BoundChannelgetLocalAddress in class ServerConnectionA - the address typetype - the address type classnull if unknownpublic 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 StreamConnection upgradeChannel()
ServerConnectionupgradeChannel in class ServerConnectionprotected ConduitStreamSinkChannel getSinkChannel()
getSinkChannel in class ServerConnectionprotected ConduitStreamSourceChannel getSourceChannel()
getSourceChannel in class ServerConnectionprotected StreamSinkConduit getSinkConduit(HttpServerExchange exchange, 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 © 2017 JBoss by Red Hat. All rights reserved.