Package com.linecorp.armeria.common
Enum SessionProtocol
- All Implemented Interfaces:
Serializable
,Comparable<SessionProtocol>
,java.lang.constant.Constable
public enum SessionProtocol extends Enum<SessionProtocol>
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 Type Method Description int
defaultPort()
Returns the default INET port number of this protocol.static SessionProtocol
find(String uriText)
Finds theSessionProtocol
with the specifieduriText()
.static Set<SessionProtocol>
httpsValues()
static Set<SessionProtocol>
httpValues()
boolean
isMultiplex()
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
of(String uriText)
Returns theSessionProtocol
with the specifieduriText()
.String
toString()
String
uriText()
Returns the textual representation of this format for use in aScheme
.static SessionProtocol
valueOf(String name)
Returns the enum constant of this type with the specified name.static SessionProtocol[]
values()
Returns an array containing the constants of this enum type, 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 type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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()
-
httpsValues
Returns an immutableSet
that containsHTTPS
,H1
andH2
. Note that it does not contain HTTP protocols such asHTTP
,H1C
andH2C
.- See Also:
httpValues()
-
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>
-