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
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
- 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
Return the study with studyDeploymentId and deviceRoleName, or null when no such study is found.
getStudyList
Return all studies in this repository. May be an empty list if no studies have been added.
hasStudy
- TStudy study
Is study in this repository?
removeStudy
- TStudy study
Remove study which is already stored in the repository. In case study is not stored in this repository, nothing happens.
updateStudy
- TStudy study
Update a study which is already stored in the repository. In case study is not stored in this repository, nothing happens.