Cache class

Consists of the methods related to Cache.

Package

com.sap.mobile.lib.cache

Syntax

public class Cache implements ICache

Implemented interfaces

Members

All members of Cache, including inherited members.

Constructors
Modifier and Type Constructor Description
public Cache(Context, ILogger)  
Methods
Modifier and Type Method Description
public String addEntry(IODataEntry) A new cache entry will be added into the local Cache using this particular method.
protected void addtoDelta(String, String)  
protected void addtoLocal(IODataEntry, String)  
protected void addtoServer(ODataEntryServer, String, boolean)  
public void clearCache(String) This API will clears entries for the URLkey passed from all the cache except the Local cache.
public void clearLocalEntry(String) This API is will clear entry from Local Cache.
public void deleteEntry(String) This API is will cache Entry associated with HTTP DELETE which deletes the existing resource of a collection this entry will be marked as 'Deleted' in Local Cache.
protected void deleteFromServercache(String)  
protected Object deserialze(byte[])  
public String getDeltaLink(String) This should return the delta token/delta link for the URL key passed.
public void initializeCache()  
public void mergeEntries(IODataFeed, String) Merge APIS are to be invoked after doing a HTTP GET after modification or a set of modifications.
public Object readDocument(int, String) This API returns the service document or the meta data document depending on the DocumentType and for the specified URLKey.
protected List< IODataEntry > readEntriesFromServer(String, String)  
public List< IODataEntry > readEntriesLocal(String, String) Gets the Entries from the Local cache based on the EntityType and the EntryID.
public List< IODataEntry > readEntriesServer(String) Returns an array of ODataEntry Objects stored for the given URL key in the server Cache The return type will be an array of Entries.
protected byte[] serialize(Object)  
public void setCacheListener(ICacheUpdateListener) Sets the listener for any update on Server cache and call backs upon merging Cache.
public void setIsPersistable(boolean) This API sets the isPersistable property of the cache which is used to check if the cache is implicitly persistable.
public void storeDocument(Object, int, String) This API Caches the service document or the meta data document depending on the DocumentType and against specified URLKey.
public void updateEntry(IODataEntry) This API is will cache Entry associated with HTTP PUT which modifies the existing resource of a collection this entry will be marked as 'Updated' in Local Cache.