private CachedTopic GetCachedTopic(AbsoluteTopicName name) { CachedTopic answer = null; if (CacheManager != null) { answer = (CachedTopic)CacheManager.GetCachedTopic(name); } if (answer != null) { return answer; } ContentBase cb = ContentBaseForTopic(name); if (cb ==null || !cb.TopicExists(name)) { return null; } answer = new CachedTopic(name); CompositeCacheRule rule = new CompositeCacheRule(); rule.Add(cb.CacheRuleForAllPossibleInstancesOfTopic(name)); answer.Changes = cb.AllChangesForTopic(name.LocalName, rule); answer.CreationTime = cb.GetTopicCreationTime(name.LocalName); answer.LastModified = cb.GetTopicLastWriteTime(name.LocalName); answer.LastModifiedBy = cb.GetTopicLastAuthor(name.LocalName); answer.UnformattedContent = cb.Read(name.LocalName); answer.Properties = ContentBase.ExtractExplicitFieldsFromTopicBody(answer.UnformattedContent); AddImplicitPropertiesToHash(answer.Properties, name, answer.LastModifiedBy, answer.CreationTime, answer.LastModified, answer.UnformattedContent); if (CacheManager != null) { CacheManager.PutCachedTopic(name, answer, rule); } return answer; }
public void PutCachedTopic(AbsoluteTopicName name, CachedTopic val, CacheRule rule) { string key = KeyForTopicInfo(name); Put(key, val, rule); rule.SetupInvalidation(this, key); }