public static final class Client.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Client |
build()
Creates a new instance of the client.
|
Client.Builder |
forTenant(io.spine.core.TenantId tenant)
Assigns the tenant for the client connection to be built.
|
Client.Builder |
onServerError(ServerErrorHandler handler)
Assigns a default handler for an error occurred on the server-side (such as
validation error) in response to a message posted by the client.
|
Client.Builder |
onStreamingError(ErrorHandler handler)
Assigns a default handler for streaming errors for the asynchronous requests
initiated by the client.
|
Client.Builder |
shutdownTimeout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the timeout for the shutdown operation of the client.
|
Client.Builder |
shutdownTimout(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Use
Client.Builder.shutdownTimeout(long, TimeUnit) instead. |
Client.Builder |
withGuestId(java.lang.String guestUser)
Assigns the ID of the user for performing requests on behalf of non-logged in user.
|
Client.Builder |
withGuestId(io.spine.core.UserId guestUser)
Assigns the ID of the user for performing requests on behalf of non-logged in user.
|
public Client.Builder forTenant(io.spine.core.TenantId tenant)
This method should be called only in multitenant applications.
tenant
- a non-null and non-default ID of the tenantpublic Client.Builder withGuestId(io.spine.core.UserId guestUser)
If the not set directly, the value "guest"
will be used.
guestUser
- non-null and non-default valuepublic Client.Builder withGuestId(java.lang.String guestUser)
If the not set directly, the value "guest"
will be used.
guestUser
- non-null and not empty or a blank value@Deprecated public Client.Builder shutdownTimout(long timeout, java.util.concurrent.TimeUnit timeUnit)
Client.Builder.shutdownTimeout(long, TimeUnit)
instead.If not specified directly, Client.DEFAULT_SHUTDOWN_TIMEOUT
will be used.
public Client.Builder shutdownTimeout(long timeout, java.util.concurrent.TimeUnit timeUnit)
If not specified directly, Client.DEFAULT_SHUTDOWN_TIMEOUT
will be used.
@CanIgnoreReturnValue public Client.Builder onStreamingError(ErrorHandler handler)
@CanIgnoreReturnValue public Client.Builder onServerError(ServerErrorHandler handler)
public Client build()