示例#1
0
        public ConversationContext GetConversation(IdAndTimestamp conversationId)
        {
            if (conversationId != null &&
                _conversationContexts.ContainsKey(conversationId))
            {
                return(_conversationContexts[conversationId]);
            }

            return(null);
        }
示例#2
0
        public string GetConversationOfTweet(IdAndTimestamp tweetId)
        {
            if (tweetId != null &&
                _tweetToConversation.ContainsKey(tweetId))
            {
                return(_tweetToConversation[tweetId]);
            }

            return(null);
        }
示例#3
0
        public ITweet GetRootTweetOfConversation(IdAndTimestamp conversationId)
        {
            if (conversationId != null &&
                _converstionToRootTweet.ContainsKey(conversationId))
            {
                return(_converstionToRootTweet[conversationId]);
            }

            return(null);
        }
示例#4
0
        public bool PutConversation(IdAndTimestamp conversationId, ConversationContext conversationContext)
        {
            if (conversationId != null &&
                conversationContext != null)
            {
                _conversationContexts.AddOrUpdate(conversationId, conversationContext);
                return(true);
            }

            return(false);
        }
示例#5
0
        public bool PutConversationOfTweet(IdAndTimestamp tweetId, string conversationId)
        {
            if (tweetId != null &&
                conversationId != null)
            {
                _tweetToConversation.AddOrUpdate(tweetId, conversationId);
                return(true);
            }

            return(false);
        }
示例#6
0
        public bool PutLatestTweetOfConversation(IdAndTimestamp conversationId, ITweet tweet)
        {
            if (conversationId != null &&
                tweet != null)
            {
                _converstionToLatestTweet.AddOrUpdate(conversationId, tweet);
                if (!_converstionToRootTweet.ContainsKey(conversationId))
                {
                    _converstionToRootTweet.Add(conversationId, tweet);
                }
                return(true);
            }

            return(false);
        }