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

public final Class AltServicesRegistry

extends Object
Class Inheritance
Imports
java.net.URI, java.util.HashMap, .LinkedHashMap, .List, .Map, .Objects, .Optional, java.util.concurrent.locks.ReentrantLock, java.util.function.Predicate, java.util.stream.Stream, javax.net.ssl.SNIServerName, jdk.internal.net.http.common.Deadline, .Log, .Logger, .TimeSource, .Utils

A registry for Alternate Services advertised by server endpoints. There is one registry per HttpClient.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
private static record

Field Summary

Modifier and TypeField and Description
private final Map<Origin, List<AltServicesRegistry.AltService>>
private final Logger
private final long
private final AltServicesRegistry.InvalidAltServices
private final ReentrantLock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear(final Origin
The origin whose alternate services need to be cleared
origin
)

Clear the alternate services of the specified origin from the registry

pack-priv String
public boolean
isActive(final AltServicesRegistry.AltService
The alternate service Returns true if the service is known to this registry and the service isn't past its max age. false otherwise.
altService
)

Returns: true if the service is known to this registry and the service isn't past its max age.

private boolean
private boolean
private boolean
private boolean
public Stream<AltServicesRegistry.AltService>
lookup(final URI uri, final String alpn)

public Stream<AltServicesRegistry.AltService>

Returns:

a stream of AlternateService that are available for the given origin and that support the given ALPN
lookup
(final Origin
the URI of the origin server
origin
,
final String
the ALPN of the alternate service
alpn
)

A stream of AlternateService that are available for the given origin and the given ALPN.

public Stream<AltServicesRegistry.AltService>
lookup(final URI uri, final Predicate<? super String> alpnMatcher)

private Stream<AltServicesRegistry.AltService>

Returns:

a stream of AlternateService that are available for the given origin and whose ALPN satisfies the alpn predicate.
lookup
(final Origin
the URI of the origin server
origin
,
final Predicate<? super String>
a predicate to select particular AltService(s) based on the alpn of the alternate service
alpnMatcher
)

A stream of AlternateService that are available for the given origin and the given ALPN.

public void
private void
pack-priv Optional<AltServicesRegistry.AltService>

Returns:

An Optional containing the registered AltService, or Optional#empty() if the service was not registered.
registerUnadvertised
(final AltServicesRegistry.AltService.Identity
The alt service identity
id
,
final Origin
The origin
origin
,
final HttpConnection conn)

Registers an unadvertised alt service for the given origin and the alpn.

public void
replace(final Origin
the origin
origin
,
final List<AltServicesRegistry.AltService>
a set of alt services for the origin
services
)

Declare a new Alternate Service endpoint for the given origin.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait