Package org.ametys.plugins.blog
Class BlogCacheManager.PostTagCache
java.lang.Object
org.ametys.plugins.blog.BlogCacheManager.PostTagCache
- Enclosing class:
- BlogCacheManager
Post cache by tag.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a post to the cache.void
addPost
(BlogCacheManager.Post post, String tagId) Add a post to the cache.void
clear()
Clear the cache.protected Map<String,
BlogCacheManager.Post> getOrCreatePostMap
(String tagId) Get or create the post set for the specified year and month.Test if the post with the given ID exists for this year and month.getPostByName
(String tagId, String name) Get the posts for a year-month couple.Get the posts for a year-month couple.getTags()
Get the years with posts.boolean
Test if the post with the given ID exists for this year and month.boolean
hasPostByName
(String tagId, String name) Get the posts for a year-month couple.boolean
Get the years with posts.void
removePost
(String contentId, String tagId) Remove a post from the cache.
-
Constructor Details
-
PostTagCache
public PostTagCache()Construct a PostTagCache instance.
-
-
Method Details
-
hasTag
Get the years with posts.- Parameters:
tagId
- The id of tag- Returns:
- the years with posts as a Set of Integer.
-
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
Add a post to the cache.- Parameters:
content
- The contenttagId
- the tag ID.
-
addPost
Add a post to the cache.- Parameters:
post
- the posttagId
- the tag ID.
-
removePost
Remove a post from the cache.- Parameters:
contentId
- The id of contenttagId
- 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
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
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
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.
-