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

public final Class AjpServerConnection

extends AbstractServerConnection
Class Inheritance
Imports
io.undertow.UndertowMessages, io.undertow.server.AbstractServerConnection, .BasicSSLSessionInfo, .HttpUpgradeListener, .HttpHandler, .HttpServerExchange, .SSLSessionInfo, io.undertow.util.DateUtils, org.xnio.IoUtils, .OptionMap, .StreamConnection, io.undertow.connector.ByteBufferPool, org.xnio.conduits.ConduitStreamSinkChannel, .StreamSinkConduit, .WriteReadyHandler

A server-side AJP connection.

Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private AjpReadListener
private SSLSessionInfo
private WriteReadyHandler.ChannelListenerHandler<ConduitStreamSinkChannel>
Inherited from io.undertow.server.AbstractServerConnection:
bufferPoolchannelcloseListenerscloseSettercurrentextraBytesoriginalSinkConduitoriginalSourceConduitrootHandlerundertowOptions

Constructor Summary

AccessConstructor and Description
public
AjpServerConnection(StreamConnection channel, ByteBufferPool bufferPool, HttpHandler rootHandler, OptionMap undertowOptions, int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public void
clearChannel()

Overrides io.undertow.server.AbstractServerConnection.clearChannel.

Resets the channel to its original state, effectively disabling all current conduit wrappers.

protected void
exchangeComplete(HttpServerExchange exchange)

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

Invoked when the exchange is complete.

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.

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.

protected boolean
public boolean
public boolean
protected boolean
public AbstractServerConnection.ConduitState
resetChannel()

Overrides io.undertow.server.AbstractServerConnection.resetChannel.

Resets the channel to its original state, effectively disabling all current conduit wrappers.

public void
restoreChannel(AbstractServerConnection.ConduitState
The original state
state
)

Overrides io.undertow.server.AbstractServerConnection.restoreChannel.

Restores the channel conduits to a previous state.

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.

pack-priv void
protected void
pack-priv void
public void
setSslSessionInfo(SSLSessionInfo
The ssl session information
sessionInfo
)

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

Sets the current SSL information.

pack-priv void
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.AbstractServerConnection:
addCloseListenerclosegetBufferPoolgetBufferSizegetByteBufferPoolgetChannelgetCloseSettergetExtraBytesgetIoThreadgetLocalAddressgetLocalAddressgetOptiongetOriginalSinkConduitgetOriginalSourceConduitgetPeerAddressgetPeerAddressgetRootHandlergetSinkChannelgetSourceChannelgetUndertowOptionsgetWorkerisOpenmaxEntitySizeUpdatedsetExtraBytessetOptionsetUpgradeListenersinksourcesupportsOption

Field Detail

ajpReadListenerback to summary
private AjpReadListener ajpReadListener
sslSessionInfoback to summary
private SSLSessionInfo sslSessionInfo
writeReadyHandlerback to summary
private WriteReadyHandler.ChannelListenerHandler<ConduitStreamSinkChannel> writeReadyHandler

Constructor Detail

AjpServerConnectionback to summary
public AjpServerConnection(StreamConnection channel, ByteBufferPool bufferPool, HttpHandler rootHandler, OptionMap undertowOptions, int bufferSize)

Method Detail

clearChannelback to summary
public void clearChannel()

Overrides io.undertow.server.AbstractServerConnection.clearChannel.

Doc from io.undertow.server.AbstractServerConnection.clearChannel.

Resets the channel to its original state, effectively disabling all current conduit wrappers. The current state is lost.

Annotations
@Override
exchangeCompleteback to summary
protected void exchangeComplete(HttpServerExchange exchange)

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

Doc from io.undertow.server.ServerConnection.exchangeComplete.

Invoked when the exchange is complete.

Annotations
@Override
getSinkConduitback to summary
protected StreamSinkConduit getSinkConduit(HttpServerExchange exchange, StreamSinkConduit conduit)

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

Doc from io.undertow.server.ServerConnection.getSinkConduit.

Gets the sink conduit that should be used for this request. This allows the connection to apply any per-request conduit wrapping that is required, without adding to the response wrappers array. There is no corresponding method for source conduits, as in general conduits can be directly inserted into the connection after the request has been read.

Returns:StreamSinkConduit

The source conduit

Annotations
@Override
getSslSessionInfoback to summary
public SSLSessionInfo getSslSessionInfo()

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

Doc from io.undertow.server.ServerConnection.getSslSessionInfo.

Gets SSL information about the connection. This could represent the actual client connection, or could be providing SSL information that was provided by a front end proxy.

Returns:SSLSessionInfo

SSL information about the connection

Annotations
@Override
getTransportProtocolback to summary
public String getTransportProtocol()

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

Doc from io.undertow.server.ServerConnection.getTransportProtocol.

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

Returns:String

the transport protocol

Annotations
@Override
isConnectSupportedback to summary
protected boolean isConnectSupported()

Implements abstract io.undertow.server.ServerConnection.isConnectSupported.

Returns:boolean

Doc from io.undertow.server.ServerConnection.isConnectSupported.

true if this connection supports the HTTP CONNECT verb

Annotations
@Override
isContinueResponseSupportedback to summary
public boolean isContinueResponseSupported()

Implements abstract io.undertow.server.ServerConnection.isContinueResponseSupported.

Returns:boolean

Doc from io.undertow.server.ServerConnection.isContinueResponseSupported.

true if this connection supports sending a 100-continue response

Annotations
@Override
isRequestTrailerFieldsSupportedback to summary
public boolean isRequestTrailerFieldsSupported()

Implements abstract io.undertow.server.ServerConnection.isRequestTrailerFieldsSupported.

Annotations
@Override
isUpgradeSupportedback to summary
protected boolean isUpgradeSupported()

Implements abstract io.undertow.server.ServerConnection.isUpgradeSupported.

Returns:boolean

Doc from io.undertow.server.ServerConnection.isUpgradeSupported.

true if this connection supports HTTP upgrade

Annotations
@Override
resetChannelback to summary
public AbstractServerConnection.ConduitState resetChannel()

Overrides io.undertow.server.AbstractServerConnection.resetChannel.

Doc from io.undertow.server.AbstractServerConnection.resetChannel.

Resets the channel to its original state, effectively disabling all current conduit wrappers. The current state is encapsulated inside a ConduitState object that can be used the restore the channel.

Returns:AbstractServerConnection.ConduitState

An opaque representation of the previous channel state

Annotations
@Override
restoreChannelback to summary
public void restoreChannel(AbstractServerConnection.ConduitState state)

Overrides io.undertow.server.AbstractServerConnection.restoreChannel.

Doc from io.undertow.server.AbstractServerConnection.restoreChannel.

Restores the channel conduits to a previous state.

Parameters
state:AbstractServerConnection.ConduitState

The original state

Annotations
@Override
sendOutOfBandResponseback to summary
public HttpServerExchange sendOutOfBandResponse(HttpServerExchange exchange)

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

Doc from io.undertow.server.ServerConnection.sendOutOfBandResponse.

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

Warning

do not attempt to write to the current exchange until the out of band exchange has been fully written. Doing so may have unexpected results.

Todo

this needs more thought.

Parameters
exchange:HttpServerExchange

The current exchange

Returns:HttpServerExchange

The out of band exchange.

Annotations
@Override
setAjpReadListenerback to summary
pack-priv void setAjpReadListener(AjpReadListener ajpReadListener)
setConnectListenerback to summary
protected void setConnectListener(HttpUpgradeListener connectListener)

Implements abstract io.undertow.server.ServerConnection.setConnectListener.

Annotations
@Override
setCurrentExchangeback to summary
pack-priv void setCurrentExchange(HttpServerExchange exchange)
setSslSessionInfoback to summary
public void setSslSessionInfo(SSLSessionInfo sessionInfo)

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

Doc from io.undertow.server.ServerConnection.setSslSessionInfo.

Sets the current SSL information. This can be used by handlers to setup SSL information that was provided by a front end proxy. If this is being set of a per request basis then you must ensure that it is either cleared by an exchange completion listener at the end of the request, or is always set for every request. Otherwise it is possible to SSL information to 'leak' between requests.

Parameters
sessionInfo:SSLSessionInfo

The ssl session information

Annotations
@Override
setSSLSessionInfoback to summary
pack-priv void setSSLSessionInfo(BasicSSLSessionInfo sslSessionInfo)
terminateRequestChannelback to summary
public void terminateRequestChannel(HttpServerExchange exchange)

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

Doc from io.undertow.server.ServerConnection.terminateRequestChannel.

Invoked when the exchange is complete, and there is still data in the request channel. Some implementations (such as SPDY and HTTP2) have more efficient ways to drain the request than simply reading all data (e.g. RST_STREAM). After this method is invoked the stream will be drained normally.

Parameters
exchange:HttpServerExchange

The current exchange.

Annotations
@Override
upgradeChannelback to summary
protected StreamConnection upgradeChannel()

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

Doc from io.undertow.server.ServerConnection.upgradeChannel.

Upgrade the connection, if allowed

Returns:StreamConnection

The StreamConnection that should be passed to the upgrade handler

Annotations
@Override