Package com.linecorp.armeria.common
Enum Class SessionProtocol
- All Implemented Interfaces:
Serializable
,Comparable<SessionProtocol>
,java.lang.constant.Constable
Session-level protocol that provides facilities such as framing and flow control.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the default INET port number of this protocol.static @Nullable SessionProtocol
Finds theSessionProtocol
with the specifieduriText()
.static Set
<SessionProtocol> static Set
<SessionProtocol> static Set
<SessionProtocol> boolean
boolean
boolean
isHttp()
boolean
isHttps()
boolean
Returnstrue
if and only if this protocol can multiplex a single transport-layer connection into more than one stream.boolean
isTls()
Returnstrue
if and only if this protocol uses TLS as its transport-level security layer.static SessionProtocol
Returns theSessionProtocol
with the specifieduriText()
.toString()
uriText()
Returns the textual representation of this format for use in aScheme
.static SessionProtocol
Returns the enum constant of this class with the specified name.static SessionProtocol[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HTTPS
HTTP - over TLS, HTTP/2 preferred. -
HTTP
HTTP - cleartext, HTTP/2 preferred. -
H1
HTTP/1 - over TLS. -
H1C
HTTP/1 - cleartext. -
H2
HTTP/2 - over TLS. -
H2C
HTTP/2 - cleartext. -
PROXY
PROXY protocol - v1 or v2.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
of
Returns theSessionProtocol
with the specifieduriText()
.- Throws:
IllegalArgumentException
- if there's no suchSessionProtocol
-
find
Finds theSessionProtocol
with the specifieduriText()
. -
httpValues
Returns an immutableSet
that containsHTTP
,H1C
andH2C
. Note that it does not contain HTTPS protocols such asHTTPS
,H1
andH2
.- See Also:
-
httpsValues
Returns an immutableSet
that containsHTTPS
,H1
andH2
. Note that it does not contain HTTP protocols such asHTTP
,H1C
andH2C
.- See Also:
-
httpAndHttpsValues
-
isHttp
public boolean isHttp()- See Also:
-
isHttps
public boolean isHttps()- See Also:
-
isExplicitHttp1
public boolean isExplicitHttp1()Returnstrue
if thisSessionProtocol
isH1
orH1C
. Note that this method returnsfalse
forHTTP
andHTTPS
. -
isExplicitHttp2
public boolean isExplicitHttp2()Returnstrue
if thisSessionProtocol
isH2
orH2C
. Note that this method returnsfalse
forHTTP
andHTTPS
. -
isTls
public boolean isTls()Returnstrue
if and only if this protocol uses TLS as its transport-level security layer. -
uriText
Returns the textual representation of this format for use in aScheme
. -
isMultiplex
public boolean isMultiplex()Returnstrue
if and only if this protocol can multiplex a single transport-layer connection into more than one stream. -
defaultPort
public int defaultPort()Returns the default INET port number of this protocol. -
toString
- Overrides:
toString
in classEnum<SessionProtocol>
-