Module io.helidon.webclient.api
Package io.helidon.webclient.api
Class UnixDomainSocketClientConnection
java.lang.Object
io.helidon.webclient.api.UnixDomainSocketClientConnection
- All Implemented Interfaces:
ClientConnection,ReleasableResource
Client connection to a UNIX domain socket.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck whether this connection is allowed to send 100-Continue.voidallowExpectContinue(boolean allowExpectContinue) Set whether this connection allows 100-Continue to be sent.Channel id, mostly used in logs.voidCloses the resource, we cannot use nameclose, as that would conflict withAutoCloseable, as we do not want to have a checked exception thrown.connect()Connect this connection to the socket.create(WebClient webClient, Tls tls, List<String> tcpProtocolIds, UnixDomainSocketAddress address, Function<UnixDomainSocketClientConnection, Boolean> releaseFunction, Consumer<UnixDomainSocketClientConnection> closeConsumer) Create a new UNIX Domain Socket Connection.AssociatedHelidonSocket.booleanCheck whether this connection is connected.reader()Data reader providing response bytes.voidreadTimeout(Duration readTimeout) Read timeout for this connection.voidReleases the resource, and if this resource is re-usable, enabled reuse.writer()Data writer the client request writes to.
-
Method Details
-
create
public static UnixDomainSocketClientConnection create(WebClient webClient, Tls tls, List<String> tcpProtocolIds, UnixDomainSocketAddress address, Function<UnixDomainSocketClientConnection, Boolean> releaseFunction, Consumer<UnixDomainSocketClientConnection> closeConsumer) Create a new UNIX Domain Socket Connection.- Parameters:
webClient- webclient, to get configurationtls- TLS configurationtcpProtocolIds- protocol IDs for ALPN (TLS protocol negotiation)address- address of the socketreleaseFunction- called whenreleaseResource()is called, iffalseis returned, the connection will be closed instead kept opencloseConsumer- called whencloseResource()is called, the connection is no longer usable after this moment- Returns:
- a new UNIX domain socket connection,
connect()must be called to make it available for use
-
reader
Description copied from interface:ClientConnectionData reader providing response bytes.- Specified by:
readerin interfaceClientConnection- Returns:
- reader to read from this connection
-
writer
Description copied from interface:ClientConnectionData writer the client request writes to.- Specified by:
writerin interfaceClientConnection- Returns:
- writer to write to this connection
-
channelId
Description copied from interface:ClientConnectionChannel id, mostly used in logs.- Specified by:
channelIdin interfaceClientConnection- Returns:
- id of this channel (connection)
-
allowExpectContinue
public boolean allowExpectContinue()Description copied from interface:ClientConnectionCheck whether this connection is allowed to send 100-Continue.- Specified by:
allowExpectContinuein interfaceClientConnection- Returns:
- whether 100-Continue is allowed
-
allowExpectContinue
public void allowExpectContinue(boolean allowExpectContinue) Description copied from interface:ClientConnectionSet whether this connection allows 100-Continue to be sent.- Specified by:
allowExpectContinuein interfaceClientConnection- Parameters:
allowExpectContinue- whether to allow 100-Continue
-
helidonSocket
Description copied from interface:ClientConnectionAssociatedHelidonSocket.- Specified by:
helidonSocketin interfaceClientConnection- Returns:
- socket of this connection
-
readTimeout
Description copied from interface:ClientConnectionRead timeout for this connection.- Specified by:
readTimeoutin interfaceClientConnection- Parameters:
readTimeout- connection read timeout
-
isConnected
public boolean isConnected()Description copied from interface:ClientConnectionCheck whether this connection is connected.- Specified by:
isConnectedin interfaceClientConnection- Returns:
- true if connected, false otherwise
-
closeResource
public void closeResource()Description copied from interface:ReleasableResourceCloses the resource, we cannot use nameclose, as that would conflict withAutoCloseable, as we do not want to have a checked exception thrown.- Specified by:
closeResourcein interfaceReleasableResource
-
releaseResource
public void releaseResource()Description copied from interface:ReleasableResourceReleases the resource, and if this resource is re-usable, enabled reuse.- Specified by:
releaseResourcein interfaceReleasableResource
-
connect
Connect this connection to the socket.- Specified by:
connectin interfaceClientConnection- Returns:
- this connection, connected to the UNIX domain socket
-