Package com.jms.socialmedia.cache
Class AbstractHeapCachingService
- java.lang.Object
-
- com.jms.socialmedia.cache.AbstractCachingService
-
- com.jms.socialmedia.cache.AbstractHeapCachingService
-
- Direct Known Subclasses:
GuavaCachingService
,JavaMapCachingService
public abstract class AbstractHeapCachingService extends AbstractCachingService
-
-
Constructor Summary
Constructors Constructor Description AbstractHeapCachingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
editCommentInCache(int commentId, String text)
Either edits the text of the Comment in the Cache, or invalidates the Commentvoid
editPostInCache(int postId, String text)
Either edits the text of the Post in the Cache, or invalidates the Postvoid
likeCommentInCache(int commentId, int userId)
Either adds a Like to the Comment in the Cache, or invalidates the Commentvoid
likePostInCache(int postId, int userId)
Either adds a Like to the Post in the Cache, or invalidates the Postvoid
unlikeCommentInCache(int commentId, int userId)
Either removes a Like in the Comment in the Cache, or invalidates the Commentvoid
unlikePostInCache(int postId, int userId)
Either removes a Like in the Post in the Cache, or invalidates the Post-
Methods inherited from class com.jms.socialmedia.cache.AbstractCachingService
commentsCacheHit, commentsCacheMiss, getCommentFromCache, getCommentsFromCache, getCommentsFromCacheOrSupplier, getPostFromCache, getPostFromCacheOrSupplier, getUserSessionCacheOrSupplier, getUserSessionFromCache, postCacheHit, postCacheMiss, putCommentIntoCache, putCommentsFromPostIntoCache, putPostIntoCache, putUserSessionIntoCache, removeCommentFromCache, removePostFromCache, removeUserSessionFromCache, userSessionCacheHit, userSessionCacheMiss
-
-
-
-
Method Detail
-
editPostInCache
public void editPostInCache(int postId, String text)
Description copied from class:AbstractCachingService
Either edits the text of the Post in the Cache, or invalidates the Post- Specified by:
editPostInCache
in classAbstractCachingService
- Parameters:
postId
- ID of the Post being editedtext
- New text of the Post
-
likePostInCache
public void likePostInCache(int postId, int userId)
Description copied from class:AbstractCachingService
Either adds a Like to the Post in the Cache, or invalidates the Post- Specified by:
likePostInCache
in classAbstractCachingService
- Parameters:
postId
- ID of the Post being likeduserId
- ID of the User the liked the Post
-
unlikePostInCache
public void unlikePostInCache(int postId, int userId)
Description copied from class:AbstractCachingService
Either removes a Like in the Post in the Cache, or invalidates the Post- Specified by:
unlikePostInCache
in classAbstractCachingService
- Parameters:
postId
- ID of the Post being unlikeduserId
- ID of the User the unliked the Post
-
editCommentInCache
public void editCommentInCache(int commentId, String text)
Description copied from class:AbstractCachingService
Either edits the text of the Comment in the Cache, or invalidates the Comment- Specified by:
editCommentInCache
in classAbstractCachingService
- Parameters:
commentId
- ID of the Comment being editedtext
- New text of the Comment
-
likeCommentInCache
public void likeCommentInCache(int commentId, int userId)
Description copied from class:AbstractCachingService
Either adds a Like to the Comment in the Cache, or invalidates the Comment- Specified by:
likeCommentInCache
in classAbstractCachingService
- Parameters:
commentId
- ID of the Comment being likeduserId
- ID of the User the liked the Comment
-
unlikeCommentInCache
public void unlikeCommentInCache(int commentId, int userId)
Description copied from class:AbstractCachingService
Either removes a Like in the Comment in the Cache, or invalidates the Comment- Specified by:
unlikeCommentInCache
in classAbstractCachingService
- Parameters:
commentId
- ID of the Comment being unlikeduserId
- ID of the User the unliked the Comment
-
-