Class BlogCacheManager.AllPostCache

    • Constructor Detail

      • AllPostCache

        public AllPostCache()
        Construct a AllPostCache instance.
    • Method Detail

      • getPostIds

        public Set<StringgetPostIds()
        Get a list of all the posts' IDs.
        Returns:
        all the posts' IDs as a Set.
      • getPost

        public BlogCacheManager.Post getPost​(String id)
        Test if a post exists, provided its ID.
        Parameters:
        id - the post content ID.
        Returns:
        true if the post exists.
      • hasPost

        public boolean hasPost​(String id)
        Test if a post exists, provided its ID.
        Parameters:
        id - the post content ID.
        Returns:
        true if the post exists.
      • getPostByName

        public BlogCacheManager.Post getPostByName​(String name)
        Test if a post exists, provided its content name.
        Parameters:
        name - the post content name.
        Returns:
        true if the post exists.
      • hasPostByName

        public boolean hasPostByName​(String name)
        Test if a post exists, provided its content name.
        Parameters:
        name - the post content name.
        Returns:
        true if the post exists.
      • addPost

        public void addPost​(Content content)
        Add a post to the cache.
        Parameters:
        content - the post content.
      • removePost

        public void removePost​(Content content)
        Remove a post from the cache.
        Parameters:
        content - the post content to remove from the cache.
      • removePost

        public void removePost​(String id,
                               String name)
        Remove a post from the cache.
        Parameters:
        id - The id of post
        name - The name of post
      • clear

        public void clear()
        Clear the cache.