Cache class

The class consists of method implementation for caching parsed OData entries.

Syntax

@interface Cache : NSObject <Caching>

Base protocols

Members

All members of Cache, including inherited members.

Methods
Method Description
- (NSString *) addEntry: (ODataEntry *) entry withError: (NSError **) error Adds a new entry cache.
- (void) addNotificationDelegate: (id) delegate withListener: (SEL) listener forUrlKey: (NSString *) urlKey Registers for notifications in case of change in the cached data when the merge is performed.
- (BOOL) clearCacheForUrlKey: (NSString *) urlKey withError: (NSError **) error Clears the cache for the URL key passed from all the caches, including the delta token and document cache.
- (BOOL) clearLocalEntryForEntryId: (NSString *) entryId withError: (NSError **) error Clears the local entry present in the local cache based on the entry ID passed.
- (BOOL) deleteEntryForEntryId: (NSString *) entryId withError: (NSError **) error Marks an entry from cache for deletion.
- (NSString *) getDeltaLinkForUrlKey: (NSString *) urlKey withError: (NSError **) error Returns the delta token or delta link for the URL key passed.
- (BOOL) initializeCacheWithError: (NSError **) error Retrieves all the initialized cache metadata.
- (BOOL) mergeEntries: (ODataFeed *) feed forUrlKey: (NSString *) urlKey withError: (NSError **) error withCompletionBlock: (NSNotification *) block Deprecated. Use 'mergeEntriesFromFeed' instead. This will be removed in the next drop
- (BOOL) mergeEntriesFromFeed: (ODataFeed *) feed forUrlKey: (NSString *) urlKey withError: (NSError **) error withCompletionBlock: (NSNotification *notification) block Merges the entries from the passed feed with the current set of entries (server version only) in the cache.
- (id) readDocumentForUrlKey: (NSString *) urlKey forDocType: (DocType) type withError: (NSError **) error Reads the service document or the meta data document for further reuse since they are the base on which data parsing can be performed.
- (NSArray *) readEntriesForUrlKey: (NSString *) urlKey withError: (NSError **) error Returns an array of ODataEntry* objects stored for the specified URL key.
- (NSArray *) readEntriesLocalForEntryId: (NSString *) entryId forEntityType: (NSString *) entityType withError: (NSError **) error Returns an array of ODataEntry* objects stored for the specified entity type and entry ID.
- (BOOL) storeDocument: (id) document forDocType: (DocType) type forUrlKey: (NSString *) urlKey withError: (NSError **) error Stores the service document or the meta data document for further reuse since they are the base on which data parsing can be performed.
- (BOOL) updateEntry: (ODataEntry *) entry withError: (NSError **) error This method call is associated with a HTTP PUT request, that is, a modification on the existing resource of a collection.

Usage

The current implementation uses SQLite Database as the persistence with SQLCipher as the encryption library. It also supports access to the persistence via core data. Cache works against the new parser API (OData*) only. Supports handling delta links and tombstones.

Error codes for caching

600 – Empty/Nil input parameter(s). 601 – No entries match the input. 602 – The entry being marked for delete is not a part of the server cache. Cannot perform operation.