Class AbstractCodecCachingService<T>

    • Constructor Detail

      • AbstractCodecCachingService

        public AbstractCodecCachingService​(CachingCodec<T> cachingServiceCodec)
    • Method Detail

      • getEncodedPostFromCache

        protected abstract T getEncodedPostFromCache​(int postId)
      • putEncodedPostIntoCache

        protected abstract void putEncodedPostIntoCache​(int postId,
                                                        T encodedPost)
      • 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 class AbstractCachingService
        Parameters:
        postId - ID of the Post being edited
        text - 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 class AbstractCachingService
        Parameters:
        postId - ID of the Post being liked
        userId - 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 class AbstractCachingService
        Parameters:
        postId - ID of the Post being unliked
        userId - ID of the User the unliked the Post
      • getEncodedCommentsFromCache

        protected abstract Collection<T> getEncodedCommentsFromCache​(int postId)
      • getEncodedCommentFromCache

        protected abstract T getEncodedCommentFromCache​(int commentId)
      • putEncodedCommentsFromPostIntoCache

        protected abstract void putEncodedCommentsFromPostIntoCache​(int postId,
                                                                    Map<T,​Double> encodedCommentsWithId)
      • putEncodedCommentIntoCache

        protected abstract void putEncodedCommentIntoCache​(int commentId,
                                                           int postId,
                                                           T encodedComment)
      • 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 class AbstractCachingService
        Parameters:
        commentId - ID of the Comment being edited
        text - 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 class AbstractCachingService
        Parameters:
        commentId - ID of the Comment being liked
        userId - 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 class AbstractCachingService
        Parameters:
        commentId - ID of the Comment being unliked
        userId - ID of the User the unliked the Comment
      • invalidateComment

        protected abstract void invalidateComment​(int commentId)
      • getEncodedUserSessionFromCache

        protected abstract T getEncodedUserSessionFromCache​(String sessionKey)
      • putEncodedUserSessionIntoCache

        protected abstract void putEncodedUserSessionIntoCache​(String sessionKey,
                                                               T encodedUserSession)