public abstract class ServerConnection extends AbstractAttachable implements ConnectedChannel
| Modifier and Type | Class and Description |
|---|---|
static interface |
ServerConnection.CloseListener |
EMPTY| Constructor and Description |
|---|
ServerConnection() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addCloseListener(ServerConnection.CloseListener listener)
Adds a close listener, than will be invoked with the connection is closed
|
abstract void |
close()
Close this channel.
|
protected abstract void |
exchangeComplete(HttpServerExchange exchange)
Invoked when the exchange is complete.
|
abstract Pool<ByteBuffer> |
getBufferPool()
Deprecated.
|
abstract int |
getBufferSize() |
abstract ByteBufferPool |
getByteBufferPool() |
abstract XnioIoThread |
getIoThread()
Get the I/O thread associated with this channel.
|
abstract SocketAddress |
getLocalAddress()
Get the local address that this channel is bound to.
|
abstract <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. |
abstract <T> T |
getOption(Option<T> option)
Get the value of a channel option.
|
abstract SocketAddress |
getPeerAddress()
Returns the actual address of the remote connection.
|
abstract <A extends SocketAddress> |
getPeerAddress(Class<A> type)
Returns the actual address of the remote connection.
|
protected abstract ConduitStreamSinkChannel |
getSinkChannel() |
protected abstract StreamSinkConduit |
getSinkConduit(HttpServerExchange exchange,
StreamSinkConduit conduit)
Gets the sink conduit that should be used for this request.
|
protected abstract ConduitStreamSourceChannel |
getSourceChannel() |
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 String |
getTransportProtocol()
Returns a string representation describing the protocol used to transmit messages
on this connection.
|
abstract OptionMap |
getUndertowOptions() |
abstract XnioWorker |
getWorker()
Get the worker for this channel.
|
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(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.
|
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(Option<T> option,
T value)
Set an option for this channel.
|
abstract void |
setSslSessionInfo(SSLSessionInfo sessionInfo)
Sets the current SSL information.
|
protected abstract void |
setUpgradeListener(HttpUpgradeListener upgradeListener) |
abstract boolean |
supportsOption(Option<?> option)
Determine whether an option is supported on this channel.
|
abstract void |
terminateRequestChannel(HttpServerExchange exchange)
Invoked when the exchange is complete, and there is still data in the request channel.
|
protected abstract StreamConnection |
upgradeChannel()
Upgrade the connection, if allowed
|
addToAttachmentList, createAttachmentMap, getAttachment, getAttachmentList, putAttachment, removeAttachmentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCloseSetter@Deprecated public abstract Pool<ByteBuffer> getBufferPool()
public abstract ByteBufferPool getByteBufferPool()
public abstract XnioWorker getWorker()
CloseableChannelgetWorker in interface CloseableChannelpublic abstract XnioIoThread getIoThread()
CloseableChannelgetIoThread in interface 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()
public abstract boolean supportsOption(Option<?> option)
ConfigurablesupportsOption in interface Configurableoption - the optiontrue if it is supportedpublic abstract <T> T getOption(Option<T> option) throws IOException
ConfigurablegetOption in interface ConfigurableT - 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 abstract <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException
ConfigurablesetOption in interface ConfigurableT - 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 abstract void close()
throws IOException
CloseableChannelclose in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface CloseableChannelIOException - if the close failedpublic SSLSession getSslSession()
getSslSessionInfo() should be used instead, as it
takes into account other information potentially provided by load balancers that terminate SSLpublic abstract SocketAddress getPeerAddress()
getPeerAddress in interface ConnectedChannelpublic abstract <A extends SocketAddress> A getPeerAddress(Class<A> type)
getPeerAddress in interface ConnectedChannelA - The address typetype - The type of address to returnpublic abstract SocketAddress getLocalAddress()
BoundChannelgetLocalAddress in interface BoundChannelpublic abstract <A extends SocketAddress> A getLocalAddress(Class<A> type)
BoundChannelnull if the address is not of that
type.getLocalAddress in interface BoundChannelA - the address typetype - the address type classnull if unknownpublic abstract 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 StreamConnection upgradeChannel()
protected abstract ConduitStreamSinkChannel getSinkChannel()
protected abstract ConduitStreamSourceChannel getSourceChannel()
protected abstract StreamSinkConduit getSinkConduit(HttpServerExchange exchange, 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 String getTransportProtocol()
public boolean pushResource(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(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 © 2017 JBoss by Red Hat. All rights reserved.