Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
public class HttpClient
extends io.netty.util.AbstractReferenceCounted
implements java.lang.AutoCloseable
Constructor and Description |
---|
HttpClient(java.net.URL endpoint) |
HttpClient(java.net.URL endpoint,
int connectionTimeout,
int requestTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Implemented for
AutoCloseable . |
protected void |
deallocate()
Frees any resources held by the client.
|
boolean |
isClosed()
Verifies if the client stills accepting new requests
|
java.util.concurrent.CompletableFuture<io.netty.handler.codec.http.FullHttpResponse> |
sendRequest(io.netty.handler.codec.http.FullHttpRequest req)
Sends a
FullHttpRequest that will be processed asynchronously |
io.netty.util.ReferenceCounted |
touch(java.lang.Object hint)
Implemented for
AbstractReferenceCounted . |
public HttpClient(java.net.URL endpoint)
endpoint
- the base endpoint URL for this client requestspublic HttpClient(java.net.URL endpoint, int connectionTimeout, int requestTimeout)
endpoint
- the base endpoint URL for this client requestsconnectionTimeout
- timeout in milliseconds, -1
to ignore itrequestTimeout
- timeout in milliseconds, -1
to ignore itpublic void close()
AutoCloseable
. Releases the client.close
in interface java.lang.AutoCloseable
public io.netty.util.ReferenceCounted touch(java.lang.Object hint)
AbstractReferenceCounted
.touch
in interface io.netty.util.ReferenceCounted
protected void deallocate()
deallocate
in class io.netty.util.AbstractReferenceCounted
java.io.IOException
public boolean isClosed()
close()
public java.util.concurrent.CompletableFuture<io.netty.handler.codec.http.FullHttpResponse> sendRequest(io.netty.handler.codec.http.FullHttpRequest req)
FullHttpRequest
that will be processed asynchronouslyreq
- FullHttpRequest
CompletableFuture
containing the asynchronous computation of the
FullHttpResponse
java.lang.IllegalStateException
- if the the client is already closed isClosed()