Package org.ametys.plugins.blog
Class BlogCacheManager.AllPostCache
java.lang.Object
org.ametys.plugins.blog.BlogCacheManager.AllPostCache
- Enclosing class:
- BlogCacheManager
Cache of all the posts.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a post to the cache.void
addPost
(BlogCacheManager.Post post) Add a post to the cache.void
clear()
Clear the cache.Test if a post exists, provided its ID.getPostByName
(String name) Test if a post exists, provided its content name.Get a list of all the posts' IDs.getPosts()
Get the exhaustive list of Posts.boolean
Test if a post exists, provided its ID.boolean
hasPostByName
(String name) Test if a post exists, provided its content name.void
removePost
(String id, String name) Remove a post from the cache.void
removePost
(Content content) Remove a post from the cache.
-
Constructor Details
-
AllPostCache
public AllPostCache()Construct a AllPostCache instance.
-
-
Method Details
-
getPostIds
Get a list of all the posts' IDs.- Returns:
- all the posts' IDs as a Set.
-
getPosts
Get the exhaustive list of Posts.- Returns:
- the exhaustive list of Posts.
-
getPost
Test if a post exists, provided its ID.- Parameters:
id
- the post content ID.- Returns:
- true if the post exists.
-
hasPost
Test if a post exists, provided its ID.- Parameters:
id
- the post content ID.- Returns:
- true if the post exists.
-
getPostByName
Test if a post exists, provided its content name.- Parameters:
name
- the post content name.- Returns:
- true if the post exists.
-
hasPostByName
Test if a post exists, provided its content name.- Parameters:
name
- the post content name.- Returns:
- true if the post exists.
-
addPost
Add a post to the cache.- Parameters:
content
- the post content.
-
addPost
Add a post to the cache.- Parameters:
post
- The post
-
removePost
Remove a post from the cache.- Parameters:
content
- the post content to remove from the cache.
-
removePost
Remove a post from the cache.- Parameters:
id
- The id of postname
- The name of post
-
clear
Clear the cache.
-