Class BlogCacheManager.PostTagCache

    • Constructor Detail

      • PostTagCache

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

      • hasTag

        public boolean hasTag​(String tagId)
        Get the years with posts.
        Parameters:
        tagId - The id of tag
        Returns:
        the years with posts as a Set of Integer.
      • getTags

        public Set<StringgetTags()
        Get the years with posts.
        Returns:
        the years with posts as a Set of Integer.
      • addPost

        public void addPost​(Content content,
                            String tagId)
        Add a post to the cache.
        Parameters:
        content - The content
        tagId - the tag ID.
      • removePost

        public void removePost​(String contentId,
                               String tagId)
        Remove a post from the cache.
        Parameters:
        contentId - The id of content
        tagId - the id of tag
      • getPost

        public BlogCacheManager.Post getPost​(String tagId,
                                             String id)
        Test if the post with the given ID exists for this year and month.
        Parameters:
        tagId - the tag id.
        id - the post ID.
        Returns:
        the posts in the specified year and month.
      • hasPost

        public boolean hasPost​(String tagId,
                               String id)
        Test if the post with the given ID exists for this year and month.
        Parameters:
        tagId - the tag id.
        id - the post ID.
        Returns:
        the posts in the specified year and month.
      • getPostByName

        public BlogCacheManager.Post getPostByName​(String tagId,
                                                   String name)
        Get the posts for a year-month couple.
        Parameters:
        tagId - the year.
        name - The name of post
        Returns:
        the posts in the specified year and month.
      • hasPostByName

        public boolean hasPostByName​(String tagId,
                                     String name)
        Get the posts for a year-month couple.
        Parameters:
        tagId - the year.
        name - the name of post
        Returns:
        the posts in the specified year and month.
      • clear

        public void clear()
        Clear the cache.