Skip to content

ClientRepository

Persists the device registration and the Studys of a client.

Used by a ClientManager to store and retrieve information about the client device and the studies it is handling. Implementations decide where the state lives (memory, local storage, ...).

Properties

deviceRegistration

DeviceRegistration? deviceRegistration
getter/setter pair

The DeviceRegistration used to register the client in deployments; null when none is stored. ClientManager.configure writes the registration given to it here.

Methods

addStudy

void addStudy(
  1. TStudy study
)

Adds study to the repository.

If study with the same study deployment id and device role name as study already exists in this repository, nothing happens. If a study needs to be updated, use the updateStudy method.

getStudy

TStudy? getStudy(
  1. String studyDeploymentId,
  2. String deviceRoleName
)

Return the study with studyDeploymentId and deviceRoleName, or null when no such study is found.

getStudyList

List<TStudy> getStudyList()

Return all studies in this repository. May be an empty list if no studies have been added.

hasStudy

bool hasStudy(
  1. TStudy study
)

Is study in this repository?

removeStudy

void removeStudy(
  1. TStudy study
)

Remove study which is already stored in the repository. In case study is not stored in this repository, nothing happens.

updateStudy

void updateStudy(
  1. TStudy study
)

Update a study which is already stored in the repository. In case study is not stored in this repository, nothing happens.