RemoteConnectionOptions

class RemoteConnectionOptions @JvmOverloads constructor(val url: String, val tokenUrl: String, val clientId: String, val clientSecret: String, val tenantId: String? = null, val insecureTls: Boolean = false, val enableKeepAlive: Boolean = true, val keepAliveInterval: Duration = Duration.ofSeconds(60)) : IConnectionOptions

Connects over HTTP(S) to a terminal-service deployment, authenticating with the OAuth2 client-credentials grant against tokenUrl - required, since Terminal.connect always needs a token to reach the terminal service.

Parameters

url

base URL of the terminal service, for example https://terminal-service.example.com.

tokenUrl

full OAuth2 token endpoint to POST grant_type=client_credentials to, for example https://auth.example.com/realms/apa/protocol/openid-connect/token.

clientId

OAuth2 client id of the confidential client. See tokenUrl.

clientSecret

OAuth2 client secret of the confidential client. See tokenUrl.

tenantId

optional tenant, sent as X-Tenant-ID.

insecureTls

when true, accepts any TLS certificate (including self-signed ones) for both the token request and the terminal's own calls - only meant for local/dev environments with a self-signed certificate (e.g. *.apa-dev.local); never enable this against a production terminal service, since it disables all certificate validation.

enableKeepAlive

when true (the default), Terminal polls the terminal in the background once keepAliveInterval has passed without any other call, so a terminal that goes unreachable while idle is still noticed (moving Terminal.getState to TerminalState.DISCONNECTED) instead of only surfacing on the next real call. Any call made in the meantime resets the idle timer, so this is a no-op while transactions are already flowing frequently enough on their own.

keepAliveInterval

how long the connection may sit idle before enableKeepAlive triggers a background keep-alive poll. Defaults to one minute.

Constructors

Link copied to clipboard
constructor(url: String, tokenUrl: String, clientId: String, clientSecret: String, tenantId: String? = null, insecureTls: Boolean = false, enableKeepAlive: Boolean = true, keepAliveInterval: Duration = Duration.ofSeconds(60))

Types

Link copied to clipboard
class Builder

Fluent alternative to the constructor, for callers who prefer setting fields incrementally (for example when some values are only known conditionally). Equivalent to the constructor otherwise - neither is "the" supported way. Obtain one via RemoteConnectionOptions.builder.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val insecureTls: Boolean = false
Link copied to clipboard
Link copied to clipboard
val tenantId: String? = null
Link copied to clipboard
Link copied to clipboard
val url: String