Class PostManager
- java.lang.Object
-
- lumis.service.socialnetworkservices.microblog.core.manager.PostManager
-
public class PostManager extends Object
Manager class used to deal with issues related to Posts.- Since:
- 6.1.0
- Version:
- $Revision: 20509 $ $Date: 2017-09-11 16:18:14 -0300 (Mon, 11 Sep 2017) $
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Post
findById(String postId)
Method used to find a post by it's id.List<Post>
findByOwnerId(String ownerId)
Method that retrieves a list of posts given an owner id.List<Post>
findUserNetworkPosts(String userId, String searchKeyword, String serviceInstanceId, String socialNetworkId)
Method designed to retrieve posts that contains keywords specified by the user.static PostManager
getInstance()
Singleton method that retrieves a instance of this class.List<Post>
getPostsUsingHashtag(String serviceInstanceId, String hashtag)
Returns a list of posts that contains a given hashtag.List<Post>
getUserWallPosts(String userId, String socialNetworkId, String serviceInstanceId, boolean isRefresh)
Returns the user wall posts.void
remove(Post post)
Method that deletes an user postvoid
removePostWithDependencies(Post post)
Method that deletes an user post and all related data, i.e., associated entities attached to it (Comments, PostAttachments, Hashtags)
-
-
-
Method Detail
-
getInstance
public static PostManager getInstance()
Singleton method that retrieves a instance of this class.- Returns:
- an instance of PostManager
- Since:
- 6.1.0
-
remove
public void remove(Post post)
Method that deletes an user post- Parameters:
post
- The Post itself- Since:
- 6.1.0
-
removePostWithDependencies
public void removePostWithDependencies(Post post) throws TransactionRequiredException, PortalException
Method that deletes an user post and all related data, i.e., associated entities attached to it (Comments, PostAttachments, Hashtags)- Parameters:
post
- The Post itself- Throws:
PortalException
TransactionRequiredException
- Since:
- 6.1.0
-
findByOwnerId
public List<Post> findByOwnerId(String ownerId)
Method that retrieves a list of posts given an owner id.- Parameters:
ownerId
- id of the owner whose post should be found- Returns:
- a list of posts from the given owner id.
- Since:
- 6.1.0
-
findById
public Post findById(String postId)
Method used to find a post by it's id.- Parameters:
postId
- the post id.- Returns:
- a post instance if exists or null if not exists.
- Since:
- 6.1.0
-
getUserWallPosts
public List<Post> getUserWallPosts(String userId, String socialNetworkId, String serviceInstanceId, boolean isRefresh)
Returns the user wall posts.- Parameters:
userId
- identifier for the current usersocialNetworkId
- identifier for the user social networkisRefresh
- flag indicating if the operation is a refresh, i.e., only retrieves new posts, if available, to the user wall.- Returns:
- the user wall posts.
- Since:
- 6.1.0
-
findUserNetworkPosts
public List<Post> findUserNetworkPosts(String userId, String searchKeyword, String serviceInstanceId, String socialNetworkId)
Method designed to retrieve posts that contains keywords specified by the user. These posts are from the user social network, i.e, from followed users.- Parameters:
userId
- identifier for the current usersearchKeyword
- string that represents the searchsocialNetworkId
- identifier for the user social network- Returns:
- the posts
- Since:
- 6.1.0
-
getPostsUsingHashtag
public List<Post> getPostsUsingHashtag(String serviceInstanceId, String hashtag)
Returns a list of posts that contains a given hashtag.- Parameters:
serviceInstanceId
- the service instance id.hashtag
- the given hash tag- Returns:
- a list of posts that contains the given hashtag
- Since:
- 6.1.0
-
-