Class BlogCacheManager.PostTagCache

java.lang.Object
org.ametys.plugins.blog.BlogCacheManager.PostTagCache
Enclosing class:
BlogCacheManager

protected static class BlogCacheManager.PostTagCache extends Object
Post cache by tag.
  • Constructor Details

    • PostTagCache

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

    • 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<String> getTags()
      Get the years with posts.
      Returns:
      the years with posts as a Set of Integer.
    • getPosts

      Get the posts for a year-month couple.
      Parameters:
      tagId - the year.
      Returns:
      the posts in the specified year and month.
    • addPost

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

      public void addPost(BlogCacheManager.Post post, String tagId)
      Add a post to the cache.
      Parameters:
      post - the post
      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

      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

      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.
    • getOrCreatePostMap

      Get or create the post set for the specified year and month.
      Parameters:
      tagId - the year.
      Returns:
      the post set, indexed by id.