java.lang.Object
com.hedera.hashgraph.sdk.HttpTransportConfiguration
How the SDK-supplied
DefaultHttpTransport is built.
It is ignored when an application injects its own transport through
MirrorNodeHttpConfig.withTransport(HttpTransport) — an injected transport brings its own
connect timeout, redirect bound and body cap.
Instances are derived from defaults() with the withX methods. There is no public
constructor, so a partially populated instance is unreachable.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpTransportConfigurationdefaults()A configuration with every field at its declared default.Extract the connect timeout.Extract the transport's default headers.intExtract the redirect bound.longExtract the response body cap.toString()withConnectTimeout(Duration connectTimeout) Derive a copy with a different connect timeout.withDefaultHeaders(Map<String, String> defaultHeaders) Derive a copy whose default headers are replaced wholesale.withMaxRedirects(int maxRedirects) Derive a copy with a different redirect bound.withMaxResponseBytes(long maxResponseBytes) Derive a copy with a different response body cap.
-
Method Details
-
defaults
A configuration with every field at its declared default.- Returns:
- the default configuration
-
withConnectTimeout
Derive a copy with a different connect timeout.- Parameters:
connectTimeout- the bound on TCP connect and the TLS handshake together;Duration.ZEROkeeps the platform stack's own bound rather than meaning "no bound"- Returns:
- the derived configuration
-
withMaxRedirects
Derive a copy with a different redirect bound.- Parameters:
maxRedirects- the number of hops to follow;0follows none- Returns:
- the derived configuration
-
withMaxResponseBytes
Derive a copy with a different response body cap.- Parameters:
maxResponseBytes- the cap, in bytes; must be at least 1- Returns:
- the derived configuration
-
withDefaultHeaders
Derive a copy whose default headers are replaced wholesale.These sit at the bottom of the header precedence order: they belong to the SDK-built transport alone, and are overridden by the caller headers on
MirrorNodeHttpConfig, by any header the endpoint sets, and by the SDK identity header.- Parameters:
defaultHeaders- the headers to send on every request; names are lowercased- Returns:
- the derived configuration
-
getConnectTimeout
Extract the connect timeout.- Returns:
- the bound on connect and handshake;
Duration.ZEROmeans the platform default
-
getMaxRedirects
public int getMaxRedirects()Extract the redirect bound.- Returns:
- the number of hops to follow
-
getMaxResponseBytes
public long getMaxResponseBytes()Extract the response body cap.- Returns:
- the cap, in bytes
-
getDefaultHeaders
Extract the transport's default headers.- Returns:
- an unmodifiable map, never null
-
toString
-