Enum Class Protocol

java.lang.Object
java.lang.Enum<Protocol>
org.miaixz.bus.http.Protocol
All Implemented Interfaces:
Serializable, Comparable<Protocol>, Constable

public enum Protocol extends Enum<Protocol>
协议vs计划 它的名字是:URL.getProtocol() 返回scheme (http, https, etc.), 而不是协议(http/1.1, spdy/3.1,等等) 请使用这个协议来识别它是如何被分割的 Httpd使用协议这个词来标识HTTP消息是如何构造的
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    明文HTTP/2,没有"upgrade"往返。此选项要求客户端事先知道服务器支持明文HTTP/2
    一种过时的plaintext,默认情况下不使用持久套接字
    包含持久连接的plaintext 此版本的Httpd实现了RFC 7230,并跟踪对该规范的修订
    IETF的二进制框架协议,包括头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义是在HTTP/2上分层的
    QUIC(快速UDP互联网连接)是一个新的多路复用和UDP之上的安全传输, 从底层设计和优化的HTTP/2语义。HTTP/1.1语义是在HTTP/2上分层的
    SOAP 1.1协议
    SOAP 1.2协议
    Chromium的二进制框架协议,包括标头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义在SPDY/3上分层.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Protocol
    get(String protocol)
     
    返回用于识别ALPN协议的字符串,如“http/1.1”、“spdy/3.1”或“http/2.0”.
    static Protocol
    Returns the enum constant of this class with the specified name.
    static Protocol[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • HTTP_1_0

      public static final Protocol HTTP_1_0
      一种过时的plaintext,默认情况下不使用持久套接字
    • HTTP_1_1

      public static final Protocol HTTP_1_1
      包含持久连接的plaintext 此版本的Httpd实现了RFC 7230,并跟踪对该规范的修订
    • HTTP_2

      public static final Protocol HTTP_2
      IETF的二进制框架协议,包括头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义是在HTTP/2上分层的
    • SPDY_3

      public static final Protocol SPDY_3
      Chromium的二进制框架协议,包括标头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义在SPDY/3上分层.
    • H2_PRIOR_KNOWLEDGE

      public static final Protocol H2_PRIOR_KNOWLEDGE
      明文HTTP/2,没有"upgrade"往返。此选项要求客户端事先知道服务器支持明文HTTP/2
    • QUIC

      public static final Protocol QUIC
      QUIC(快速UDP互联网连接)是一个新的多路复用和UDP之上的安全传输, 从底层设计和优化的HTTP/2语义。HTTP/1.1语义是在HTTP/2上分层的
    • SOAP_1_1

      public static final Protocol SOAP_1_1
      SOAP 1.1协议
    • SOAP_1_2

      public static final Protocol SOAP_1_2
      SOAP 1.2协议
  • Method Details

    • values

      public static Protocol[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Protocol valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public static Protocol get(String protocol) throws IOException
      Parameters:
      protocol - 协议标示
      Returns:
      返回由protocol标识的协议
      Throws:
      IOException - if protocol is unknown.
    • toString

      public String toString()
      返回用于识别ALPN协议的字符串,如“http/1.1”、“spdy/3.1”或“http/2.0”.
      Overrides:
      toString in class Enum<Protocol>