Interface RelationshipManager
-
public interface RelationshipManager
This interface handles Social relationships & relationship requests Implement this interface to according to the persistence storage of social data
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
acceptRelationshipRequest(String viewer, String owner)
Creates a relationship between viewer and ownerString[]
getPendingRelationshipRequests(String owner)
String[]
getRelationshipList(String loggedUser)
String
getRelationshipStatus(String viewer, String owner)
boolean
ignoreRelationship(String viewer, String owner)
Ignores the relationship request from viewer to owner Implementation should remove the userId of viewer from the pending-relationship-requests list of the ownerboolean
removeRelationship(String owner, String viewer)
Removes the relationship between owner and viewer Implementation should remove the association between owner and viewerboolean
requestRelationship(String viewer, String owner)
Creates a relationship request from viewer to owner The userId of viewer should be added to the pending relationship requests of the owner
-
-
-
Method Detail
-
requestRelationship
boolean requestRelationship(String viewer, String owner) throws SocialDataException
Creates a relationship request from viewer to owner The userId of viewer should be added to the pending relationship requests of the owner- Parameters:
viewer
- The userId of the person who is viewing the owner's profileowner
- The userId of the person whose profile is being viewed- Returns:
- Throws:
SocialDataException
-
getRelationshipStatus
String getRelationshipStatus(String viewer, String owner) throws SocialDataException
- Parameters:
viewer
- The userId of the person who is viewing the owner's profileowner
- The userId of the person whose profile is being viewed- Returns:
- The relationship status between viewer and owner {NONE,PENDING_REQUEST,CONNECTED}
- Throws:
SocialDataException
-
getPendingRelationshipRequests
String[] getPendingRelationshipRequests(String owner) throws SocialDataException
- Parameters:
owner
- The userId of the person whose pending relationship list to be retrieved- Returns:
- An array of userId strings from whom the owner has received relationship requests
- Throws:
SocialDataException
-
acceptRelationshipRequest
boolean acceptRelationshipRequest(String viewer, String owner) throws SocialDataException
Creates a relationship between viewer and owner- Parameters:
viewer
-owner
-- Returns:
- true if the relationship request was accepted succesfully false if the relationship request was not accepted successfully
- Throws:
SocialDataException
-
getRelationshipList
String[] getRelationshipList(String loggedUser) throws SocialDataException
- Parameters:
loggedUser
- The userId of the user whose relationship list to be retrieved- Returns:
- An array of userIds of users with whom the loggedUser has a relationship
- Throws:
SocialDataException
-
ignoreRelationship
boolean ignoreRelationship(String viewer, String owner) throws SocialDataException
Ignores the relationship request from viewer to owner Implementation should remove the userId of viewer from the pending-relationship-requests list of the owner- Parameters:
viewer
- The userId of the person who has requested for a relationship with ownerowner
- The userId of the person to whom the viewer has sent a relationship request- Returns:
- true if the relationship request was ignored false if the relationship request was not ignored successfully
- Throws:
SocialDataException
-
removeRelationship
boolean removeRelationship(String owner, String viewer) throws SocialDataException
Removes the relationship between owner and viewer Implementation should remove the association between owner and viewer- Parameters:
owner
- The userId of the person to whom the viewer has sent a relationship requestviewer
- The userId of the person who has requested for a relationship with owner- Returns:
- true if the relationship was removed successfully false if the relationship is not removed
- Throws:
SocialDataException
-
-