public interface UpgradeProtocol
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Request request)
Allows the implementation to examine the request and accept or reject it based on what it finds.
|
byte[] |
getAlpnIdentifier() |
java.lang.String |
getAlpnName() |
java.lang.String |
getHttpUpgradeName(boolean isSSLEnabled) |
InternalHttpUpgradeHandler |
getInternalUpgradeHandler(SocketWrapperBase<?> socketWrapper,
Adapter adapter,
Request request) |
Processor |
getProcessor(SocketWrapperBase<?> socketWrapper,
Adapter adapter) |
default void |
setHttp11Protocol(AbstractHttp11Protocol<?> protocol)
Configure the HTTP/1.1 protocol that this UpgradeProcotol is nested under.
|
default void |
setHttp11Protocol(AbstractProtocol<?> protocol)
Deprecated.
This will be removed in Tomcat 10. Use
setHttp11Protocol(AbstractHttp11Protocol) instead |
java.lang.String getHttpUpgradeName(boolean isSSLEnabled)
isSSLEnabled - 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.null if upgrade via an HTTP/1.1 upgrade request is not supported.byte[] getAlpnIdentifier()
null if upgrade via
ALPN is not supported.java.lang.String getAlpnName()
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.Processor getProcessor(SocketWrapperBase<?> socketWrapper, Adapter adapter)
socketWrapper - The socketWrapper for the connection that requires a processoradapter - The Adapter instance that provides access to the standard Engine/Host/Context/Wrapper
processing chainInternalHttpUpgradeHandler getInternalUpgradeHandler(SocketWrapperBase<?> socketWrapper, Adapter adapter, Request request)
socketWrapper - The socketadapter - The Adapter to use to configure the new upgrade handlerrequest - A copy (may be incomplete) of the request that triggered the upgradeboolean accept(Request request)
request - The request that included an upgrade header for this protocoltrue if the request is accepted, otherwise falsedefault void setHttp11Protocol(AbstractHttp11Protocol<?> protocol)
The default implementation is a NO-OP.
protocol - The HTTP/1.1 protocol implementation that will initially handle any connections passed to this
UpgradeProtocol via the HTTP upgrade mechanism@Deprecated default void setHttp11Protocol(AbstractProtocol<?> protocol)
setHttp11Protocol(AbstractHttp11Protocol) instead
The default implementation is to call setHttp11Protocol(AbstractHttp11Protocol) if protocol is an
instance of AbstractHttp11Protocol else this is a NO-OP.
protocol - The HTTP/1.1 protocol implementation that will initially handle any connections passed to this
UpgradeProtocol via the HTTP upgrade mechanismCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.