APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http

pack-priv final Class AltSvcProcessor

extends Object
Class Inheritance
Imports
jdk.internal.net.http.AltServicesRegistry.AltService, jdk.internal.net.http.common.Deadline, .Log, .Logger, .TimeSource, .Utils, jdk.internal.net.http.frame.AltSvcFrame, java.net.InetSocketAddress, .URI, .URISyntaxException, java.util.ArrayList, .Collections, .HashMap, .List, .Map, .StringTokenizer, javax.net.ssl.SNIHostName, .SNIServerName

Responsible for parsing the Alt-Svc values from an Alt-Svc header and/or AltSvc HTTP/2 frame.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static record

Field Summary

Modifier and TypeField and Description
private static final boolean
private static final List<AltServicesRegistry.AltService>
private static final Logger
private static final String
private static final SNIHostName

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
private static Map<String, String>
private static AltSvcProcessor.HostPort
getHostPort(Origin origin, String altAuthority)

private static boolean
getPersist(final String persist)

pack-priv static List<SNIServerName>
private static Deadline
getValidTill(final String maxAge)

private static AltSvcProcessor.ParsedHeaderValue
parseAltValue(final Origin origin, final String altValue)

pack-priv static void
processAltSvcFrame(final int streamId, final AltSvcFrame frame, final HttpConnection conn, final HttpClientImpl client)

pack-priv static void
processAltSvcHeader(Response
response passed on by the server
response
,
HttpClientImpl
client that holds alt-svc registry
client
,
HttpRequestImpl
request that holds the origin details
request
)

Parses the alt-svc header received from origin and update registry with the processed values.

private static List<AltServicesRegistry.AltService>
processHeaderValue(final Origin origin, final String headerValue)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowLocalHostOriginback to summary
private static final boolean allowLocalHostOrigin
CLEAR_ALL_ALT_SVCSback to summary
private static final List<AltServicesRegistry.AltService> CLEAR_ALL_ALT_SVCS
debugback to summary
private static final Logger debug
LOCALHOST_SNIback to summary
private static final SNIHostName LOCALHOST_SNI

Constructor Detail

AltSvcProcessorback to summary
private AltSvcProcessor()

Method Detail

decodePotentialPercentEncodedback to summary
private static String decodePotentialPercentEncoded(final String val)
extractParametersback to summary
private static Map<String, String> extractParameters(final String val)
getHostPortback to summary
private static AltSvcProcessor.HostPort getHostPort(Origin origin, String altAuthority)
getPersistback to summary
private static boolean getPersist(final String persist)
getSNIServerNamesback to summary
pack-priv static List<SNIServerName> getSNIServerNames(final HttpConnection conn)
getValidTillback to summary
private static Deadline getValidTill(final String maxAge)
parseAltValueback to summary
private static AltSvcProcessor.ParsedHeaderValue parseAltValue(final Origin origin, final String altValue)
processAltSvcFrameback to summary
pack-priv static void processAltSvcFrame(final int streamId, final AltSvcFrame frame, final HttpConnection conn, final HttpClientImpl client)
processAltSvcHeaderback to summary
pack-priv static void processAltSvcHeader(Response response, HttpClientImpl client, HttpRequestImpl request)

Parses the alt-svc header received from origin and update registry with the processed values.

Parameters
response:Response

response passed on by the server

client:HttpClientImpl

client that holds alt-svc registry

request:HttpRequestImpl

request that holds the origin details

processHeaderValueback to summary
private static List<AltServicesRegistry.AltService> processHeaderValue(final Origin origin, final String headerValue)
processValueAndUpdateRegistryback to summary
private static void processValueAndUpdateRegistry(HttpClientImpl client, Origin origin, String altSvcValue)
jdk.internal.net.http back to summary

private final Record AltSvcProcessor.HostPort

extends Record
Class Inheritance
Record Components
host:String 
port:int 

Field Summary

Modifier and TypeField and Description
private final String
host

Record Component accessed by host().

private final int
port

Record Component accessed by port().

Constructor Summary

AccessConstructor and Description
private
HostPort(String host, int port)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String
host()

Record Component getter of host.

public int
port()

Record Component getter of port.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

hostback to summary
private final String host

Record Component accessed by host().

portback to summary
private final int port

Record Component accessed by port().

Constructor Detail

HostPortback to summary
private HostPort(String host, int port)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

hostback to summary
public String host()

Record Component getter of host.

portback to summary
public int port()

Record Component getter of port.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.internal.net.http back to summary

private final Record AltSvcProcessor.ParsedHeaderValue

extends Record
Class Inheritance
Record Components
rawValue:String 
alpnName:String 
host:String 
port:int 
parameters:Map<String, String> 

Field Summary

Modifier and TypeField and Description
private final String
alpnName

Record Component accessed by alpnName().

private final String
host

Record Component accessed by host().

private final Map<String, String>
parameters

Record Component accessed by parameters().

private final int
port

Record Component accessed by port().

private final String
rawValue

Record Component accessed by rawValue().

Constructor Summary

AccessConstructor and Description
private
ParsedHeaderValue(String rawValue, String alpnName, String host, int port, Map<String, String> parameters)

Method Summary

Modifier and TypeMethod and Description
public String
alpnName()

Record Component getter of alpnName.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String
host()

Record Component getter of host.

public Map<String, String>
parameters()

Record Component getter of parameters.

public int
port()

Record Component getter of port.

public String
rawValue()

Record Component getter of rawValue.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

alpnNameback to summary
private final String alpnName

Record Component accessed by alpnName().

hostback to summary
private final String host

Record Component accessed by host().

parametersback to summary
private final Map<String, String> parameters

Record Component accessed by parameters().

portback to summary
private final int port

Record Component accessed by port().

rawValueback to summary
private final String rawValue

Record Component accessed by rawValue().

Constructor Detail

ParsedHeaderValueback to summary
private ParsedHeaderValue(String rawValue, String alpnName, String host, int port, Map<String, String> parameters)

Method Detail

alpnNameback to summary
public String alpnName()

Record Component getter of alpnName.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

hostback to summary
public String host()

Record Component getter of host.

parametersback to summary
public Map<String, String> parameters()

Record Component getter of parameters.

portback to summary
public int port()

Record Component getter of port.

rawValueback to summary
public String rawValue()

Record Component getter of rawValue.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.