Class 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 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
      • 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 user
        socialNetworkId - identifier for the user social network
        isRefresh - 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 user
        searchKeyword - string that represents the search
        socialNetworkId - 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