Package com.jms.socialmedia.dataservice
Interface DataService
-
- All Known Implementing Classes:
CachingDataService
,DataServiceWithMetrics
,MockDataService
,MybatisDataService
public interface DataService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
addComment(Comment comment)
boolean
addPost(Post post)
boolean
addUser(NewUser newUser)
boolean
addUserSession(int userId, String sessionId)
boolean
deleteComment(int commentId)
boolean
deletePost(int postId)
boolean
editComment(int commentId, String commentText)
boolean
editPassword(Integer userId, String hashedPassword)
boolean
editPost(int postId, String postText)
boolean
followUser(int followerUserId, int followingUserId)
Comment
getComment(int commentId)
Collection<Post>
getCommentedPostsByUserId(int userId)
Collection<Integer>
getCommentLikes(int commentId)
Collection<Comment>
getComments(int postId)
Collection<Comment>
getCommentsByUserId(int userId)
Collection<Integer>
getFollowerUserIds(int userId)
Collection<Integer>
getFollowingUserIds(int userId)
User
getHashedPasswordByUserId(Integer userId)
Collection<Post>
getLikedPostsByUserId(int userId)
Post
getPost(int postId)
Collection<Integer>
getPostLikes(int postId)
default Collection<Post>
getPosts(Integer userId)
default Collection<Post>
getPosts(Integer userId, Integer sincePostId)
Collection<Post>
getPosts(Collection<Integer> userIds, String username, String tag, String onDate, String beforeDate, String afterDate, Integer sincePostId, String sortBy, boolean sortOrderAsc)
User
getUserBySessionId(String sessionId)
Integer
getUserIdByUsername(String username)
Integer
getUserIdFromCommentId(int commentId)
Integer
getUserIdFromPostId(int postId)
User
getUserLoginInfoByString(String usernameOrEmail)
Collection<User>
getUsernamesByIds(Collection<Integer> userIds)
UserPage
getUserPageInfoByName(String username)
Collection<User>
getUsersToFollow(int userId)
boolean
isEmailTaken(String email)
boolean
isUsernameTaken(String username)
boolean
likeComment(int commentId, int userId)
boolean
likePost(int postId, int userId)
void
removeSessionId(String sessionId)
boolean
unfollowUser(int followerUserId, int followingUserId)
boolean
unlikeComment(int commentId, int userId)
boolean
unlikePost(int postId, int userId)
-
-
-
Method Detail
-
getUsernamesByIds
Collection<User> getUsernamesByIds(Collection<Integer> userIds)
-
getUsersToFollow
Collection<User> getUsersToFollow(int userId)
-
isUsernameTaken
boolean isUsernameTaken(String username)
-
isEmailTaken
boolean isEmailTaken(String email)
-
addUser
boolean addUser(NewUser newUser)
-
addUserSession
boolean addUserSession(int userId, String sessionId)
-
removeSessionId
void removeSessionId(String sessionId)
-
getPosts
Collection<Post> getPosts(Collection<Integer> userIds, String username, String tag, String onDate, String beforeDate, String afterDate, Integer sincePostId, String sortBy, boolean sortOrderAsc)
-
getPosts
default Collection<Post> getPosts(Integer userId)
-
getPosts
default Collection<Post> getPosts(Integer userId, Integer sincePostId)
-
getPost
Post getPost(int postId)
-
getUserIdFromPostId
Integer getUserIdFromPostId(int postId)
-
addPost
boolean addPost(Post post)
-
editPost
boolean editPost(int postId, String postText)
-
deletePost
boolean deletePost(int postId)
-
getCommentedPostsByUserId
Collection<Post> getCommentedPostsByUserId(int userId)
-
getLikedPostsByUserId
Collection<Post> getLikedPostsByUserId(int userId)
-
getPostLikes
Collection<Integer> getPostLikes(int postId)
-
likePost
boolean likePost(int postId, int userId)
-
unlikePost
boolean unlikePost(int postId, int userId)
-
getComments
Collection<Comment> getComments(int postId)
-
getCommentsByUserId
Collection<Comment> getCommentsByUserId(int userId)
-
getComment
Comment getComment(int commentId)
-
getUserIdFromCommentId
Integer getUserIdFromCommentId(int commentId)
-
addComment
boolean addComment(Comment comment)
-
editComment
boolean editComment(int commentId, String commentText)
-
deleteComment
boolean deleteComment(int commentId)
-
getCommentLikes
Collection<Integer> getCommentLikes(int commentId)
-
likeComment
boolean likeComment(int commentId, int userId)
-
unlikeComment
boolean unlikeComment(int commentId, int userId)
-
getFollowerUserIds
Collection<Integer> getFollowerUserIds(int userId)
-
getFollowingUserIds
Collection<Integer> getFollowingUserIds(int userId)
-
followUser
boolean followUser(int followerUserId, int followingUserId)
-
unfollowUser
boolean unfollowUser(int followerUserId, int followingUserId)
-
-