Package com.io7m.idstore.user_client.api

# Interface IdUClientType

All Superinterfaces:
  `AutoCloseable`, `com.io7m.hibiscus.api.HBClientCloseableType<IdUClientException>`, `com.io7m.hibiscus.api.HBClientType<IdUMessageType,IdUClientConnectionParameters,IdUClientException>`, `com.io7m.hibiscus.api.HBIOOperationsType<IdUMessageType,IdUClientException>`

All Known Implementing Classes:
  `IdUClient`

public interface IdUClientType extends com.io7m.hibiscus.api.HBClientType<IdUMessageType,IdUClientConnectionParameters,IdUClientException>
The type of clients.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default IdUMessageType`
  `connectOrThrow(IdUClientConnectionParameters parameters)`
  Call `HBClientType.connect(HBConnectionParametersType)` but throw an exception if the result is an `IdUResponseError`.
  `default <R extends IdUResponseType>
  R`
  `sendAndWaitOrThrow(IdUCommandType<R> message, Duration timeout)`
  Call `HBIOOperationsType.sendAndWait(HBMessageType, Duration)` but throw an exception if the result is an `IdUResponseError`.

  ### Methods inherited from interface com.io7m.hibiscus.api.HBClientCloseableType

  `close, isClosed`

  ### Methods inherited from interface com.io7m.hibiscus.api.HBClientType

  `connect, disconnect, state, stateNow`

  ### Methods inherited from interface com.io7m.hibiscus.api.HBIOOperationsType

  `receive, send, sendAndForget, sendAndWait`

- ## Method Details

  - ### connectOrThrow

    default IdUMessageType connectOrThrow(IdUClientConnectionParameters parameters) throws IdUClientException, InterruptedException
    Call `HBClientType.connect(HBConnectionParametersType)` but throw an exception if the result is an `IdUResponseError`.
    Parameters:
      `parameters` - The connection parameters
    Returns:
      The success message
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### sendAndWaitOrThrow

    default <R extends IdUResponseType> R sendAndWaitOrThrow(IdUCommandType<R> message, Duration timeout) throws IdUClientException, InterruptedException, TimeoutException
    Call `HBIOOperationsType.sendAndWait(HBMessageType, Duration)` but throw an exception if the result is an `IdUResponseError`.
    Type Parameters:
      `R` - The type of results
    Parameters:
      `message` - The message
      `timeout` - The timeout
    Returns:
      The result
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption
      `TimeoutException` - On timeouts