package Ġcom . book store . repository Ċ Ċ import Ġcom . book store . dao . local . Local User DAO Ċ import Ġcom . book store . dao . remote . Remote User DAO Ċ import Ġcom . book store . model . request . user . AccessToken Request Ċ import Ġcom . book store . model . response . user . AccessToken Ċ Ċ class ĠUser Repository ( ĊĠĠĠ Ġprivate Ġval Ġremote User DAO : ĠRemote User DAO , ĊĠĠĠ Ġprivate Ġval Ġlocal User DAO : ĠLocal User DAO Ċ ) Ġ{ ĊĊĠĠĠ Ġsuspend Ġfun Ġget AccessToken ( accessToken Request : ĠAccess Token Request ) Ġ= ĊĠĠĠĠĠĠĠ Ġremote User DAO . get AccessToken ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠaccessToken Request . grant Type , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠaccessToken Request . scope , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠaccessToken Request . username , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠaccessToken Request . password ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġsuspend Ġfun Ġsave Session ( accessToken : ĠAccess Token ) Ġ= Ġ Ġlocal User DAO . save AccessToken ( accessToken ) ĊĊĠĠĠ Ġsuspend Ġfun Ġdestroy Session ( accessToken : ĠAccess Token ) Ġ= Ġlocal User DAO . remove Current AccessToken ( accessToken ) ĊĊĠĠĠ Ġsuspend Ġfun Ġcheck Session () Ġ= Ġlocal User DAO . getCurrent AccessToken () Ċ }