Mobile API Reference  MicroStrategy 2019
MSICacheManager Class Reference

#import <MSICacheManager.h>

Inheritance diagram for MSICacheManager:

Instance Methods

(void) - retrieveCacheForObjectId:withPriority:withElementsPromptAnswers:andProjectInfo:completionHandler:
 
(void) - retrieveCacheForObjectId:withPriority:withElementsPromptAnswers:andValuePromptAnswers:andProjectInfo:completionHandler:
 
(MSIDocumentCache *) - cacheForKey:
 
(void) - deleteAllCaches
 
(void) - deleteAllCachesBeforeDate:
 
(void) - deleteCache:
 
(void) - deleteCachesForObjectId:projectInfo:
 

Class Methods

(MSICacheManager *) + manager
 

Detailed Description

This class is for SDK users to monitor and manage cache status

Method Documentation

◆ cacheForKey:()

- (MSIDocumentCache*) cacheForKey: (NSString *)  key

This method will return the cache of certain key

Parameters
keyshould be created by [NSString stringWithFormat:"%%%%", projectIdentifier, objectId, elementsPromptAnswers, valuePromptAnswers]; ProjectInfo has an instance method called projectIdentifier, which will return a string as projectIdentifier If the document does not contain prompt answer, we should provide nil as parameter: [NSString stringWithFormat:"%%%%", projectIdentifier objectId, nil, nil];

◆ deleteAllCaches()

- (void) deleteAllCaches

◆ deleteAllCachesBeforeDate:()

- (void) deleteAllCachesBeforeDate: (NSDate *)  date

◆ deleteCache:()

- (void) deleteCache: (MSIDocumentCache *)  cache

◆ deleteCachesForObjectId:projectInfo:()

- (void) deleteCachesForObjectId: (NSString *)  objectId
projectInfo: (MSIProjectInfo *)  projectInfo 

◆ manager()

+ (MSICacheManager*) manager

◆ retrieveCacheForObjectId:withPriority:withElementsPromptAnswers:andProjectInfo:completionHandler:()

- (void) retrieveCacheForObjectId: (NSString *)  objectId
withPriority: (MSMCachePriorities priority
withElementsPromptAnswers: (NSString *)  elementsPromptAnswers
andProjectInfo: (MSIProjectInfo *)  projectInfo
completionHandler: (void(^)(MSIDocumentCache *documentCache, NSError *error))  handlerBlock 

This method is already deprecated, user should use the next method and set value prompt to nil if there is no value prompt

◆ retrieveCacheForObjectId:withPriority:withElementsPromptAnswers:andValuePromptAnswers:andProjectInfo:completionHandler:()

- (void) retrieveCacheForObjectId: (NSString *)  objectId
withPriority: (MSMCachePriorities priority
withElementsPromptAnswers: (NSString *)  elementsPromptAnswers
andValuePromptAnswers: (NSString *)  valuePromptAnswers
andProjectInfo: (MSIProjectInfo *)  projectInfo
completionHandler: (void(^)(MSIDocumentCache *documentCache, NSError *error))  handlerBlock 

This method will retrieve cache at report/document and prompt answer level.

Parameters
objectIdis the id of the object you want to retrieve cache for.
withPriorityis used to define the priority of current request. projectInfo is used to specify project, if not provided, we will use default projectInfo
blockis used when the MSMCache is retrieved.