package Ġcom . open conference . model Ċ Ċ import Ġcom . open conference . model . database . dao . Session Dao Ċ import Ġcom . open conference . model . notification . Notification Scheduler Ċ import Ġrx . Observable Ċ Ċ /** Ċ Ġ* ĠResp ons ible Ġto Ġload Ġall Ġsessions Ċ Ġ* Ċ Ġ* Ġ@ author ĠH ann es ĠD or fm ann Ċ Ġ*/ Ċ interface ĠS essions Loader Ġ{ ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠLoad Ġall Ġsessions ĊĠĠ Ġ*/ ĊĠ Ġfun Ġall Sessions (): ĠObservable < List < Session >> ĊĊĠ Ġfun Ġfavorite Sessions (): ĠObservable < List < Session >> ĊĊĠ Ġfun Ġget Session ( id : ĠString ): ĠObservable < Session > ĊĊĠ Ġfun Ġadd Session To Schedule ( session : ĠSession ): ĠObservable < Boolean > ĊĊĠ Ġfun Ġremove Session From Schedule ( session : ĠSession ): ĠObservable < Boolean > ĊĊĠ Ġfun Ġget Sessions Of Speaker ( speaker Id : ĠString ): ĠObservable < List < Session >> Ċ } Ċ Ċ /** Ċ Ġ* ĠA Ġ[ Sessions Loader ] Ġthat Ġuses Ġthe Ġsessions Ġfrom Ġlocal Ġdatabase Ġ( sync ed Ġwith Ġthe Ġbackend ) Ċ Ġ*/ Ċ class ĠLocal Storage Sessions Loader ( private Ġval Ġschedule Data Aware Observable Factory : ĠSchedule Data Aware Observable Factory , ĊĠĠĠ Ġprivate Ġval Ġsession Dao : ĠSession Dao , ĊĠĠĠ Ġprivate Ġval Ġnotification Scheduler : ĠNotification Scheduler Ċ ) Ġ: ĠS essions Loader Ġ{ ĊĊĠ Ġoverride Ġfun Ġall Sessions (): ĠObservable < List < Session >> Ġ= ĊĠĠĠĠĠ Ġschedule Data Aware Observable Factory . create ( session Dao . getS essions ()) ĊĊĠ Ġoverride Ġfun Ġfavorite Sessions (): ĠObservable < List < Session >> Ġ= Ġschedule Data Aware Observable Factory . create ( ĊĠĠĠĠĠ Ġsession Dao . get Favorite Sessions ()) ĊĊĠ Ġoverride Ġfun Ġget Session ( ĊĠĠĠĠĠ Ġid : ĠString ): ĠObservable < Session > Ġ= Ġschedule Data Aware Observable Factory . create ( ĊĠĠĠĠĠ Ġsession Dao . getById ( id )) ĊĊĠ Ġoverride Ġfun Ġadd Session To Schedule ( session : ĠSession ): ĠObservable < Boolean > Ġ= Ġsession Dao . set Favorite ( ĊĠĠĠĠĠ Ġsession . id (), ĊĠĠĠĠĠ Ġtrue ). map Ġ{ Ġit Ġ> Ġ 0 Ġ} ĊĠĠĠĠĠ Ġ. do On Next Ġ{ Ġnotification Scheduler . add Or Res chedule Notification ( session ) Ġ} ĊĊĠ Ġoverride Ġfun Ġremove Session From Schedule ( ĊĠĠĠĠĠ Ġsession : ĠSession ): ĠObservable < Boolean > Ġ= Ġsession Dao . set Favorite ( ĊĠĠĠĠĠ Ġsession . id (), ĊĠĠĠĠĠ Ġfalse ). map Ġ{ Ġit Ġ> Ġ 0 Ġ} ĊĠĠĠĠĠ Ġ. do On Next Ġ{ Ġnotification Scheduler . remove Notification ( session ) Ġ} ĊĊĠ Ġoverride Ġfun Ġget Sessions Of Speaker ( speaker Id : ĠString ): ĠObservable < List < Session >> Ġ= ĊĠĠĠĠĠ Ġschedule Data Aware Observable Factory . create ( session Dao . getS essions Of Speaker ( speaker Id )) Ċ }