Top Fields Constructors Methods
org.apache.coyote.http2

public Class Http2Protocol

extends Object
implements UpgradeProtocol
Class Inheritance
All Implemented Interfaces
org.apache.coyote.UpgradeProtocol
Imports
java.nio.charset.StandardCharsets, java.util.Enumeration, javax.management.ObjectName, org.apache.coyote.Adapter, .ContinueResponseTiming, .Processor, .Request, .RequestGroupInfo, .Response, .UpgradeProtocol, .UpgradeToken, org.apache.coyote.http11.AbstractHttp11Protocol, org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler, .UpgradeProcessorInternal, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.modeler.Registry, org.apache.tomcat.util.net.SocketWrapperBase, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static final String
pack-priv static final long
pack-priv static final int
pack-priv static final long
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
private RequestGroupInfo
private AbstractHttp11Protocol<?>
private static final String
private int
private boolean
private long
private static final Log
private int
private long
private int
private int
private int
private int
private int
private int
private int
private long
private static final StringManager
private long
private long
private boolean
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
accept(Request
The request that included an upgrade header for this protocol
request
)

Implements org.apache.coyote.UpgradeProtocol.accept.

Allows the implementation to examine the request and accept or reject it based on what it finds.

public byte[]
public String
public ContinueResponseTiming
public RequestGroupInfo
public AbstractHttp11Protocol<?>
public String
getHttpUpgradeName(boolean
Is this for a connector that is configured to support TLS. Some protocols (e.g. HTTP/2) only support HTTP upgrade over non-secure connections.
isSSLEnabled
)

Implements org.apache.coyote.UpgradeProtocol.getHttpUpgradeName.

public int
public boolean
public InternalHttpUpgradeHandler
getInternalUpgradeHandler(SocketWrapperBase<?>
The socket
socketWrapper
,
Adapter
The Adapter to use to configure the new upgrade handler
adapter
,
Request
A copy (may be incomplete) of the request that triggered the upgrade
coyoteRequest
)

Implements org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

public long
public int
public long
public int
public int
public int
public int
public int
public int
public int
public int
public int
public Processor
getProcessor(SocketWrapperBase<?>
The socketWrapper for the connection that requires a processor
socketWrapper
,
Adapter
The Adapter instance that provides access to the standard Engine/Host/Context/Wrapper processing chain
adapter
)

Implements org.apache.coyote.UpgradeProtocol.getProcessor.

public long
public long
public long
public String
public boolean
public long
pack-priv boolean
public void
setHttp11Protocol(AbstractHttp11Protocol<?>
The HTTP/1.1 protocol implementation that will initially handle any connections passed to this UpgradeProtocol via the HTTP upgrade mechanism
http11Protocol
)

Overrides default org.apache.coyote.UpgradeProtocol.setHttp11Protocol.

Configure the HTTP/1.1 protocol that this UpgradeProcotol is nested under.

public void
setInitialWindowSize(int initialWindowSize)

public void
setInitiatePingDisabled(boolean initiatePingDisabled)

public void
setKeepAliveTimeout(long keepAliveTimeout)

public void
setMaxConcurrentStreamExecution(int maxConcurrentStreamExecution)

public void
setMaxConcurrentStreams(long maxConcurrentStreams)

public void
setMaxHeaderCount(int maxHeaderCount)

public void
setMaxTrailerCount(int maxTrailerCount)

public void
setOverheadContinuationThreshold(int overheadContinuationThreshold)

public void
setOverheadCountFactor(int overheadCountFactor)

public void
setOverheadDataThreshold(int overheadDataThreshold)

public void
setOverheadResetFactor(int overheadResetFactor)

public void
setOverheadWindowUpdateThreshold(int overheadWindowUpdateThreshold)

public void
setReadTimeout(long readTimeout)

public void
setStreamReadTimeout(long streamReadTimeout)

public void
setStreamWriteTimeout(long streamWriteTimeout)

public void
setUseSendfile(boolean useSendfile)

public void
setWriteTimeout(long writeTimeout)

public boolean
useCompression(Request request, Response response)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALPN_IDENTIFIERback to summary
private static final byte[] ALPN_IDENTIFIER
ALPN_NAMEback to summary
private static final String ALPN_NAME
DEFAULT_KEEP_ALIVE_TIMEOUTback to summary
pack-priv static final long DEFAULT_KEEP_ALIVE_TIMEOUT
DEFAULT_MAX_CONCURRENT_STREAM_EXECUTIONback to summary
pack-priv static final int DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION
DEFAULT_MAX_CONCURRENT_STREAMSback to summary
pack-priv static final long DEFAULT_MAX_CONCURRENT_STREAMS
DEFAULT_OVERHEAD_CONTINUATION_THRESHOLDback to summary
pack-priv static final int DEFAULT_OVERHEAD_CONTINUATION_THRESHOLD
DEFAULT_OVERHEAD_COUNT_FACTORback to summary
pack-priv static final int DEFAULT_OVERHEAD_COUNT_FACTOR
DEFAULT_OVERHEAD_DATA_THRESHOLDback to summary
pack-priv static final int DEFAULT_OVERHEAD_DATA_THRESHOLD
DEFAULT_OVERHEAD_REDUCTION_FACTORback to summary
pack-priv static final int DEFAULT_OVERHEAD_REDUCTION_FACTOR
DEFAULT_OVERHEAD_RESET_FACTORback to summary
pack-priv static final int DEFAULT_OVERHEAD_RESET_FACTOR
DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLDback to summary
pack-priv static final int DEFAULT_OVERHEAD_WINDOW_UPDATE_THRESHOLD
DEFAULT_READ_TIMEOUTback to summary
pack-priv static final long DEFAULT_READ_TIMEOUT
DEFAULT_STREAM_READ_TIMEOUTback to summary
pack-priv static final long DEFAULT_STREAM_READ_TIMEOUT
DEFAULT_STREAM_WRITE_TIMEOUTback to summary
pack-priv static final long DEFAULT_STREAM_WRITE_TIMEOUT
DEFAULT_WRITE_TIMEOUTback to summary
pack-priv static final long DEFAULT_WRITE_TIMEOUT
globalback to summary
private RequestGroupInfo global
http11Protocolback to summary
private AbstractHttp11Protocol<?> http11Protocol
HTTP_UPGRADE_NAMEback to summary
private static final String HTTP_UPGRADE_NAME
initialWindowSizeback to summary
private int initialWindowSize
initiatePingDisabledback to summary
private boolean initiatePingDisabled
keepAliveTimeoutback to summary
private long keepAliveTimeout
logback to summary
private static final Log log
maxConcurrentStreamExecutionback to summary
private int maxConcurrentStreamExecution
maxConcurrentStreamsback to summary
private long maxConcurrentStreams
maxHeaderCountback to summary
private int maxHeaderCount
maxTrailerCountback to summary
private int maxTrailerCount
overheadContinuationThresholdback to summary
private int overheadContinuationThreshold
overheadCountFactorback to summary
private int overheadCountFactor
overheadDataThresholdback to summary
private int overheadDataThreshold
overheadResetFactorback to summary
private int overheadResetFactor
overheadWindowUpdateThresholdback to summary
private int overheadWindowUpdateThreshold
readTimeoutback to summary
private long readTimeout
smback to summary
private static final StringManager sm
streamReadTimeoutback to summary
private long streamReadTimeout
streamWriteTimeoutback to summary
private long streamWriteTimeout
useSendfileback to summary
private boolean useSendfile
writeTimeoutback to summary
private long writeTimeout

Constructor Detail

Http2Protocolback to summary
public Http2Protocol()

Method Detail

acceptback to summary
public boolean accept(Request request)

Implements org.apache.coyote.UpgradeProtocol.accept.

Doc from org.apache.coyote.UpgradeProtocol.accept.

Allows the implementation to examine the request and accept or reject it based on what it finds.

Parameters
request:Request

The request that included an upgrade header for this protocol

Returns:boolean

true if the request is accepted, otherwise false

Annotations
@Override
getAlpnIdentifierback to summary
public byte[] getAlpnIdentifier()

Implements org.apache.coyote.UpgradeProtocol.getAlpnIdentifier.

Returns:byte[]

Doc from org.apache.coyote.UpgradeProtocol.getAlpnIdentifier.

The byte sequence as listed in the IANA registry for this protocol or null if upgrade via ALPN is not supported.

Annotations
@Override
getAlpnNameback to summary
public String getAlpnName()

Implements org.apache.coyote.UpgradeProtocol.getAlpnName.

Returns:String

Doc from org.apache.coyote.UpgradeProtocol.getAlpnName.

The name of the protocol as listed in the IANA registry if and only if getAlpnIdentifier() returns the UTF-8 encoding of this name. If getAlpnIdentifier() returns some other byte sequence, then this method returns the empty string. If upgrade via ALPN is not supported then null is returned.

Annotations
@Override
getContinueResponseTimingInternalback to summary
public ContinueResponseTiming getContinueResponseTimingInternal()
getGlobalback to summary
public RequestGroupInfo getGlobal()
getHttp11Protocolback to summary
public AbstractHttp11Protocol<?> getHttp11Protocol()
getHttpUpgradeNameback to summary
public String getHttpUpgradeName(boolean isSSLEnabled)

Implements org.apache.coyote.UpgradeProtocol.getHttpUpgradeName.

Parameters
isSSLEnabled:boolean

Doc from org.apache.coyote.UpgradeProtocol.getHttpUpgradeName.

Is this for a connector that is configured to support TLS. Some protocols (e.g. HTTP/2) only support HTTP upgrade over non-secure connections.

Returns:String

Doc from org.apache.coyote.UpgradeProtocol.getHttpUpgradeName.

The name that clients will use to request an upgrade to this protocol via an HTTP/1.1 upgrade request or null if upgrade via an HTTP/1.1 upgrade request is not supported.

Annotations
@Override
getInitialWindowSizeback to summary
public int getInitialWindowSize()
getInitiatePingDisabledback to summary
public boolean getInitiatePingDisabled()
getInternalUpgradeHandlerback to summary
public InternalHttpUpgradeHandler getInternalUpgradeHandler(SocketWrapperBase<?> socketWrapper, Adapter adapter, Request coyoteRequest)

Implements org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

Parameters
socketWrapper:SocketWrapperBase<?>

Doc from org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

The socket

adapter:Adapter

Doc from org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

The Adapter to use to configure the new upgrade handler

coyoteRequest:Request

Doc from org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

A copy (may be incomplete) of the request that triggered the upgrade

Returns:InternalHttpUpgradeHandler

Doc from org.apache.coyote.UpgradeProtocol.getInternalUpgradeHandler.

An instance of the HTTP upgrade handler for this protocol

Annotations
@Override
getKeepAliveTimeoutback to summary
public long getKeepAliveTimeout()
getMaxConcurrentStreamExecutionback to summary
public int getMaxConcurrentStreamExecution()
getMaxConcurrentStreamsback to summary
public long getMaxConcurrentStreams()
getMaxHeaderCountback to summary
public int getMaxHeaderCount()
getMaxHeaderSizeback to summary
public int getMaxHeaderSize()
getMaxTrailerCountback to summary
public int getMaxTrailerCount()
getMaxTrailerSizeback to summary
public int getMaxTrailerSize()
getOverheadContinuationThresholdback to summary
public int getOverheadContinuationThreshold()
getOverheadCountFactorback to summary
public int getOverheadCountFactor()
getOverheadDataThresholdback to summary
public int getOverheadDataThreshold()
getOverheadResetFactorback to summary
public int getOverheadResetFactor()
getOverheadWindowUpdateThresholdback to summary
public int getOverheadWindowUpdateThreshold()
getProcessorback to summary
public Processor getProcessor(SocketWrapperBase<?> socketWrapper, Adapter adapter)

Implements org.apache.coyote.UpgradeProtocol.getProcessor.

Parameters
socketWrapper:SocketWrapperBase<?>

Doc from org.apache.coyote.UpgradeProtocol.getProcessor.

The socketWrapper for the connection that requires a processor

adapter:Adapter

Doc from org.apache.coyote.UpgradeProtocol.getProcessor.

The Adapter instance that provides access to the standard Engine/Host/Context/Wrapper processing chain

Returns:Processor

Doc from org.apache.coyote.UpgradeProtocol.getProcessor.

A processor instance for processing a connection using this protocol.

Annotations
@Override
getReadTimeoutback to summary
public long getReadTimeout()
getStreamReadTimeoutback to summary
public long getStreamReadTimeout()
getStreamWriteTimeoutback to summary
public long getStreamWriteTimeout()
getUpgradeProtocolNameback to summary
public String getUpgradeProtocolName()
getUseSendfileback to summary
public boolean getUseSendfile()
getWriteTimeoutback to summary
public long getWriteTimeout()
isTrailerHeaderAllowedback to summary
pack-priv boolean isTrailerHeaderAllowed(String headerName)
setHttp11Protocolback to summary
public void setHttp11Protocol(AbstractHttp11Protocol<?> http11Protocol)

Overrides default org.apache.coyote.UpgradeProtocol.setHttp11Protocol.

Doc from org.apache.coyote.UpgradeProtocol.setHttp11Protocol.

Configure the HTTP/1.1 protocol that this UpgradeProcotol is nested under. Connections passed to this UpgradeProtocol via HTTP upgrade will have been initially handled by this HTTP/1.1 protocol implementation.

The default implementation is a NO-OP.

Parameters
http11Protocol:AbstractHttp11Protocol<?>

The HTTP/1.1 protocol implementation that will initially handle any connections passed to this UpgradeProtocol via the HTTP upgrade mechanism

Annotations
@Override
setInitialWindowSizeback to summary
public void setInitialWindowSize(int initialWindowSize)
setInitiatePingDisabledback to summary
public void setInitiatePingDisabled(boolean initiatePingDisabled)
setKeepAliveTimeoutback to summary
public void setKeepAliveTimeout(long keepAliveTimeout)
setMaxConcurrentStreamExecutionback to summary
public void setMaxConcurrentStreamExecution(int maxConcurrentStreamExecution)
setMaxConcurrentStreamsback to summary
public void setMaxConcurrentStreams(long maxConcurrentStreams)
setMaxHeaderCountback to summary
public void setMaxHeaderCount(int maxHeaderCount)
setMaxTrailerCountback to summary
public void setMaxTrailerCount(int maxTrailerCount)
setOverheadContinuationThresholdback to summary
public void setOverheadContinuationThreshold(int overheadContinuationThreshold)
setOverheadCountFactorback to summary
public void setOverheadCountFactor(int overheadCountFactor)
setOverheadDataThresholdback to summary
public void setOverheadDataThreshold(int overheadDataThreshold)
setOverheadResetFactorback to summary
public void setOverheadResetFactor(int overheadResetFactor)
setOverheadWindowUpdateThresholdback to summary
public void setOverheadWindowUpdateThreshold(int overheadWindowUpdateThreshold)
setReadTimeoutback to summary
public void setReadTimeout(long readTimeout)
setStreamReadTimeoutback to summary
public void setStreamReadTimeout(long streamReadTimeout)
setStreamWriteTimeoutback to summary
public void setStreamWriteTimeout(long streamWriteTimeout)
setUseSendfileback to summary
public void setUseSendfile(boolean useSendfile)
setWriteTimeoutback to summary
public void setWriteTimeout(long writeTimeout)
useCompressionback to summary
public boolean useCompression(Request request, Response response)