Interface RelationshipManager
public interface RelationshipManager
This interface handles Social relationships invalid input: '&' relationship requests
Implement this interface to according to the persistence storage of social data
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptRelationshipRequest(String viewer, String owner) Creates a relationship between viewer and ownerString[]String[]getRelationshipList(String loggedUser) getRelationshipStatus(String viewer, String owner) booleanignoreRelationship(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 ownerbooleanremoveRelationship(String owner, String viewer) Removes the relationship between owner and viewer Implementation should remove the association between owner and viewerbooleanrequestRelationship(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 Details
-
requestRelationship
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
- 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
- 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
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
- 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
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
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
-