Class GroupRepository
- java.lang.Object
-
- edu.cnm.deepdive.teamassignmentsandroid.service.GroupRepository
-
public class GroupRepository extends Object
Fetches "Group" data from web service proxy.
-
-
Constructor Summary
Constructors Constructor Description GroupRepository(Context context)
Passes context for google sign in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Completable
deleteGroup(long groupId)
io.reactivex.Completable
deleteTask(long groupId, long taskId)
io.reactivex.Single<Group>
getGroup(long groupId, User user)
io.reactivex.Single<List<Group>>
getGroups(boolean ownedOnly, User user)
Gets List of groups.io.reactivex.Single<List<Group>>
getGroups(User user)
Sets List of group, gets bearer token for authentication.io.reactivex.Single<Task>
getTask(long groupId, long taskId)
io.reactivex.Single<List<Task>>
getTasks(long groupId)
Gets List of tasksio.reactivex.Single<Group>
saveGroup(Group group)
Saves single group to data base.io.reactivex.Single<Task>
saveTask(long groupId, Task task)
-
-
-
Constructor Detail
-
GroupRepository
public GroupRepository(Context context)
Passes context for google sign in.- Parameters:
context
- is received for current process.
-
-
Method Detail
-
getGroups
public io.reactivex.Single<List<Group>> getGroups(User user)
Sets List of group, gets bearer token for authentication.- Returns:
- groups if bear token is authenticated.
-
getGroups
public io.reactivex.Single<List<Group>> getGroups(boolean ownedOnly, User user)
Gets List of groups.- Parameters:
ownedOnly
- are groups authenticated by user.- Returns:
- list of groups owned by user.
-
saveGroup
public io.reactivex.Single<Group> saveGroup(Group group)
Saves single group to data base.- Parameters:
group
- is sent to database- Returns:
- group and bearer token
-
deleteGroup
public io.reactivex.Completable deleteGroup(long groupId)
-
getTasks
public io.reactivex.Single<List<Task>> getTasks(long groupId)
Gets List of tasks- Parameters:
groupId
- is retrieved from service proxy- Returns:
- list of tasks with id
-
getTask
public io.reactivex.Single<Task> getTask(long groupId, long taskId)
-
deleteTask
public io.reactivex.Completable deleteTask(long groupId, long taskId)
-
-