SmartphoneClientRepository
Stores the studies of the SmartPhoneClientManager on the phone.
A singleton ClientRepository that keeps studies in memory and saves them with the PersistenceService, so they survive app restarts.
- Implemented types
Constructors
SmartphoneClientRepository
Returns the singleton SmartphoneClientRepository.
Properties
deviceRegistration
The DeviceRegistration used to register the client in deployments.
studyStatusEvents
The StudyStatusEvents of all studies in this repository.
Methods
addStudy
- SmartphoneStudy 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
- SmartphoneStudy study
Is study in this repository?
init
Loads all studies from the PersistenceService.
Called by SmartPhoneClientManager.configure after the persistence service is initialized.
removeStudy
- SmartphoneStudy study
Remove study which is already stored in the repository. In case study is not stored in this repository, nothing happens.
toString
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.
updateStudy
- SmartphoneStudy study
Update a study which is already stored in the repository. In case study is not stored in this repository, nothing happens.