Class ProfileSearchDataAccessImpl
- java.lang.Object
-
- in.cs699.tensors.delagram.profile_search_service.repository.ProfileSearchDataAccessImpl
-
- All Implemented Interfaces:
ProfileSearchDataAccess
@Repository public class ProfileSearchDataAccessImpl extends Object implements ProfileSearchDataAccess
A Firebase based implementation of data access.- Author:
- swaroop_nath
-
-
Constructor Summary
Constructors Constructor Description ProfileSearchDataAccessImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
fetchUserByID(String userID)
An implementation to fetch the user against the searched user id.boolean
updateCircleForUsers(User currentUser, User targetUser)
An implementation to add users in each others' circles.
-
-
-
Method Detail
-
fetchUserByID
public User fetchUserByID(String userID) throws SearchFailedException, UserDoesNotExistException
An implementation to fetch the user against the searched user id.- Specified by:
fetchUserByID
in interfaceProfileSearchDataAccess
- Parameters:
userID
- The id of the user to be fetched.- Returns:
- Returns the associated user.
- Throws:
SearchFailedException
- Thrown in case the search for the user failed.UserDoesNotExistException
- Thrown in case any user doesn't exist against the user id.
-
updateCircleForUsers
public boolean updateCircleForUsers(User currentUser, User targetUser) throws UserNotAddedToCircleException
An implementation to add users in each others' circles.- Specified by:
updateCircleForUsers
in interfaceProfileSearchDataAccess
- Parameters:
currentUser
- The currently logged in user.targetUser
- The user intended to be added in the circle.- Returns:
- Returns true in case the addition was successful.
- Throws:
UserNotAddedToCircleException
- Thrown in case users couldn't be added in their circles.
-
-