Class ClientConnectionTarget
java.lang.Object
io.helidon.webclient.api.ClientConnectionTarget
Logical WebClient connection target selected after request services have finalized the URI and headers.
This value is safe to use as a cache key. A configured IP-based no-proxy rule retains the address that
selected the direct route so the physical connection cannot use a different DNS answer. That per-acquisition evidence
does not participate in target equality or hashing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDNS-free identity used to look up a logical WebClient connection target before selecting its proxy route. -
Method Summary
Modifier and TypeMethodDescriptionExisting connection policy and TLS identity.static ClientConnectionTargetcreate(ClientConnectionTarget.LookupKey lookupKey) Create a logical connection target from a cache lookup key.static ClientConnectionTargetcreate(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Create a logical IP connection target from a final request URI and headers.static ClientConnectionTargetcreate(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers, ProxyRoute selectedProxyRoute) Create a logical IP connection target using an already-selected proxy route.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme) Create a logical IP connection target using the connection-key origin.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority) Create a logical IP connection target from an already-normalized origin.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute) Create a logical target from an already-normalized origin and selected route.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute, long tlsGeneration) Create a logical target from an already-normalized origin and selected route.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute, InetSocketAddress localAddress, long tlsGeneration) Recreate a logical target from an already-selected route and captured generations.static ClientConnectionTargetcreate(ConnectionKey connectionKey, String scheme, ProxyRoute proxyRoute) Create a logical target using the connection-key origin and a selected route.static ClientConnectionTargetcreateUnixDomainSocket(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers, UnixDomainSocketAddress address) Create a logical Unix-domain-socket target.booleanWhether this target still represents the current TLS reload generation.booleaninthashCode()Requested local bind address.Create a cache lookup key for this target without retaining its selected proxy route.lookupKey(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Create a DNS-free cache lookup key from a final request URI and headers.lookupKey(ConnectionKey connectionKey, String scheme) Create a DNS-free cache lookup key using the connection-key origin.static Optional<ProxyRoute> matchingRoute(ClientConnection connection, ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Match an explicit TCP connection to a fully finalized logical target.Normalized effective HTTP origin authority.Effective proxy route selected for this target.resolve()Resolve a direct or proxied physical attempt for the connection-key host and port.Resolve a physical attempt for a selected route authority.static booleanrouteMatches(ConnectionKey connectionKey, String scheme, ProxyRoute proxyRoute) Whether a retained route was selected for the supplied logical target and proxy policy.scheme()Normalized origin scheme.longCaptured TLS reload generation.toString()Physical non-IP transport override.
-
Method Details
-
lookupKey
public static ClientConnectionTarget.LookupKey lookupKey(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Create a DNS-free cache lookup key from a final request URI and headers.- Parameters:
connectionKey- connection policy and TLS identityuri- final request URIheaders- final request headers- Returns:
- target lookup key
-
lookupKey
public static ClientConnectionTarget.LookupKey lookupKey(ConnectionKey connectionKey, String scheme) Create a DNS-free cache lookup key using the connection-key origin.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin scheme- Returns:
- target lookup key
-
create
Create a logical connection target from a cache lookup key.This selects the effective proxy route and may resolve DNS when configured IP-based
no-proxyrules require it.- Parameters:
lookupKey- target lookup key- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Create a logical IP connection target from a final request URI and headers.- Parameters:
connectionKey- connection policy and TLS identityuri- final request URIheaders- final request headers- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers, ProxyRoute selectedProxyRoute) Create a logical IP connection target using an already-selected proxy route.- Parameters:
connectionKey- connection policy and TLS identityuri- final request URIheaders- final request headersselectedProxyRoute- selected proxy route- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority) Create a logical IP connection target from an already-normalized origin.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin schemeoriginAuthority- normalized effective origin authority- Returns:
- logical connection target
-
create
Create a logical IP connection target using the connection-key origin.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin scheme- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute) Create a logical target from an already-normalized origin and selected route.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin schemeoriginAuthority- normalized effective origin authorityproxyRoute- previously selected proxy route- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, String scheme, ProxyRoute proxyRoute) Create a logical target using the connection-key origin and a selected route.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin schemeproxyRoute- previously selected proxy route- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute, long tlsGeneration) Create a logical target from an already-normalized origin and selected route.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin schemeoriginAuthority- normalized effective origin authorityproxyRoute- previously selected proxy routetlsGeneration- captured TLS reload generation- Returns:
- logical connection target
-
create
public static ClientConnectionTarget create(ConnectionKey connectionKey, String scheme, UriAuthority originAuthority, ProxyRoute proxyRoute, InetSocketAddress localAddress, long tlsGeneration) Recreate a logical target from an already-selected route and captured generations.- Parameters:
connectionKey- connection policy and TLS identityscheme- origin schemeoriginAuthority- normalized effective origin authorityproxyRoute- previously selected proxy routelocalAddress- local bind addresstlsGeneration- captured TLS reload generation- Returns:
- logical connection target
-
createUnixDomainSocket
public static ClientConnectionTarget createUnixDomainSocket(ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers, UnixDomainSocketAddress address) Create a logical Unix-domain-socket target.- Parameters:
connectionKey- connection policy and TLS identityuri- final request URIheaders- final request headersaddress- Unix-domain-socket address- Returns:
- logical connection target
-
connectionKey
Existing connection policy and TLS identity.- Returns:
- connection key
-
scheme
-
originAuthority
Normalized effective HTTP origin authority.- Returns:
- origin authority
-
proxyRoute
Effective proxy route selected for this target.- Returns:
- effective proxy route
-
transportAddress
Physical non-IP transport override.- Returns:
- transport address, empty for an IP target
-
localAddress
Requested local bind address.- Returns:
- local bind address, empty for the ordinary wildcard bind
-
tlsGeneration
public long tlsGeneration()Captured TLS reload generation.- Returns:
- TLS generation
-
lookupKey
Create a cache lookup key for this target without retaining its selected proxy route.- Returns:
- target lookup key
-
currentTlsGeneration
public boolean currentTlsGeneration()Whether this target still represents the current TLS reload generation.- Returns:
- whether the TLS generation is current
-
routeMatches
public static boolean routeMatches(ConnectionKey connectionKey, String scheme, ProxyRoute proxyRoute) Whether a retained route was selected for the supplied logical target and proxy policy.- Parameters:
connectionKey- connection policy and target tuplescheme- logical target schemeproxyRoute- retained route- Returns:
- whether the route belongs to and matches the target
-
matchingRoute
public static Optional<ProxyRoute> matchingRoute(ClientConnection connection, ConnectionKey connectionKey, ClientUri uri, ClientRequestHeaders headers) Match an explicit TCP connection to a fully finalized logical target.- Parameters:
connection- explicit connectionconnectionKey- finalized connection identityuri- finalized request URIheaders- finalized request headers- Returns:
- the connection's route when its complete logical target matches
-
resolve
Resolve a direct or proxied physical attempt for the connection-key host and port.- Returns:
- resolved target
-
resolve
Resolve a physical attempt for a selected route authority.- Parameters:
routeHost- selected direct or alternative route hostroutePort- selected direct or alternative route portnetworkGeneration- network/discovery generation- Returns:
- resolved target
-
equals
-
hashCode
-
toString
-