Class ProfileSearchServiceImpl
- java.lang.Object
-
- in.cs699.tensors.delagram.profile_search_service.service.ProfileSearchServiceImpl
-
- All Implemented Interfaces:
ProfileSearchService
@Service public class ProfileSearchServiceImpl extends Object implements ProfileSearchService
An implementation of the business-logic.- Author:
- swaroop_nath
-
-
Constructor Summary
Constructors Constructor Description ProfileSearchServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
fetchUserByID(String userID)
An implementation for the logic of search a user by user id.boolean
makeCircleAndPersist(Map<String,Object> payload)
An implementation for the logic of adding users in each others' circle.
-
-
-
Method Detail
-
fetchUserByID
public User fetchUserByID(String userID) throws SearchFailedException, UserDoesNotExistException
An implementation for the logic of search a user by user id.- Specified by:
fetchUserByID
in interfaceProfileSearchService
- Parameters:
userID
- The user id for which the user has to be searched.- Returns:
- Returns the user if found.
- Throws:
SearchFailedException
- Thrown in case the search couldn't be done.UserDoesNotExistException
- Thrown in case the user was not found.
-
makeCircleAndPersist
public boolean makeCircleAndPersist(Map<String,Object> payload) throws InternalServerException, UserNotAddedToCircleException
An implementation for the logic of adding users in each others' circle.- Specified by:
makeCircleAndPersist
in interfaceProfileSearchService
- Parameters:
payload
- The payload with the request. It must include the user ids of both the users.- Returns:
- Returns true in case the addition was successful.
- Throws:
InternalServerException
- Thrown in case there is any internal server error.UserNotAddedToCircleException
- Thrown in case the user couldn't be added to the circle.
-
-