ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/coyote/UpgradeProtocol.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/coyote/UpgradeProtocol.java
Status
scanned
Type
file
Name
UpgradeProtocol.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
4520 (4.4 KB)
MD5
a6447b55bcc79d51ab69c583d85fbc56
SHA1
1a7ed3b26320d1b165e60ce11f0e17aa72991e41
SHA256
7b2be6b8a6d96d08f0c953e7afa6c1f88958b536152ebf865696566d8183ac17
SHA512

      
    
SHA1_git
eb1556ac57b80ca66210f4ffc638e476c8ccdb7c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
UpgradeProtocol.java | 4.4 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.coyote; import org.apache.coyote.http11.AbstractHttp11Protocol; import org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler; import org.apache.tomcat.util.net.SocketWrapperBase; public interface UpgradeProtocol { /** * @param 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. * * @return The name that clients will use to request an upgrade to this protocol via an HTTP/1.1 upgrade request or * <code>null</code> if upgrade via an HTTP/1.1 upgrade request is not supported. */ String getHttpUpgradeName(boolean isSSLEnabled); /** * @return The byte sequence as listed in the IANA registry for this protocol or <code>null</code> if upgrade via * ALPN is not supported. */ byte[] getAlpnIdentifier(); /** * @return The name of the protocol as listed in the IANA registry if and only if {@link #getAlpnIdentifier()} * returns the UTF-8 encoding of this name. If {@link #getAlpnIdentifier()} returns some other byte * sequence, then this method returns the empty string. If upgrade via ALPN is not supported then * <code>null</code> is returned. */ /* * Implementation note: If Tomcat ever supports ALPN for a protocol where the identifier is not the UTF-8 encoding * of the name then some refactoring is going to be required. * * Implementation note: Tomcat assumes that the UTF-8 encoding of this name will not exceed 255 bytes. Tomcat's * behaviour if longer names are used is undefined. */ String getAlpnName(); /** * @param socketWrapper The socketWrapper for the connection that requires a processor * @param adapter The Adapter instance that provides access to the standard Engine/Host/Context/Wrapper * processing chain * * @return A processor instance for processing a connection using this protocol. */ Processor getProcessor(SocketWrapperBase<?> socketWrapper, Adapter adapter); /** * @param socketWrapper The socket * @param adapter The Adapter to use to configure the new upgrade handler * @param request A copy (may be incomplete) of the request that triggered the upgrade * * @return An instance of the HTTP upgrade handler for this protocol */ InternalHttpUpgradeHandler getInternalUpgradeHandler(SocketWrapperBase<?> socketWrapper, Adapter adapter, Request request); /** * Allows the implementation to examine the request and accept or reject it based on what it finds. * * @param request The request that included an upgrade header for this protocol * * @return <code>true</code> if the request is accepted, otherwise <code>false</code> */ boolean accept(Request request); /** * 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. * <p> * The default implementation is a NO-OP. * * @param protocol The HTTP/1.1 protocol implementation that will initially handle any connections passed to this * UpgradeProtocol via the HTTP upgrade mechanism */ default void setHttp11Protocol(AbstractHttp11Protocol<?> protocol) { // NO-OP } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
21.44
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9