AddonClientFactory

@PublicApi
class AddonClientFactory


Provides a AddonClient.

Summary

Public functions

java-static AddonClient!
getClient(cloudProjectNumber: Long)

Returns the singleton instance of AddonClient.

java-static AddonClient!
getClient(
    cloudProjectNumber: Long,
    backgroundExecutorService: Optional<ExecutorService!>!,
    scheduledExecutorService: Optional<ScheduledExecutorService!>!
)

Returns the singleton instance of AddonClient.

Public functions

getClient

java-static fun getClient(cloudProjectNumber: Long): AddonClient!

Returns the singleton instance of AddonClient.

Parameters
cloudProjectNumber: Long

the cloud project number of the Google Workspace Marketplace add-on associated with the app

Throws
java.lang.IllegalArgumentException

if the cloudProjectNumber changes across calls

getClient

java-static fun getClient(
    cloudProjectNumber: Long,
    backgroundExecutorService: Optional<ExecutorService!>!,
    scheduledExecutorService: Optional<ScheduledExecutorService!>!
): AddonClient!

Returns the singleton instance of AddonClient.

Passing in different values backgroundExecutorService or scheduledExecutorService across multiple calls is not recommended and has no effect.

If empty optionals are provided for the ExecutorService or ScheduledExecutorService the SDK will create its own in their place for background tasks.

Parameters
cloudProjectNumber: Long

the cloud project number of the Google Workspace Marketplace add-on associated with the add-on app

backgroundExecutorService: Optional<ExecutorService!>!

an executor for the SDK to offload various internal tasks including IPC, callbacks etc. The executor should have a thread pool of size 6 or more for optimal performance. Using a single-threaded ExecutorService will lead to poor performance.

scheduledExecutorService: Optional<ScheduledExecutorService!>!

a ScheduledExecutorService for the SDK to perform periodic tasks for state synchronization. This can have a single thread without affecting performance.

Throws
java.lang.IllegalArgumentException

if the cloudProjectNumber is not provided or changes across calls