SDMCache class

Deprecated. since 3.0, Use Cache The SDMCache component is responsible for storing and accessing OData related objects in the memory of the device.

Package

com.sap.mobile.lib.sdmcache

Syntax

public class SDMCache implements ISDMCache, ISDMPreferenceChangeListener, ISDMEntrySearch

Implemented interfaces

Members

All members of SDMCache, including inherited members.

Variables
Modifier and Type Variable Description
public static final String ALL_ENTRY_SEARCH_TERM  
protected static final String ENTRY_TYPE_ODATASBASEDOCUMENT Search property tag to be used In the default cache search algorithm, this tag will be checked to identify the fields which are included in the search. If configured to be an empty string, all fields are included.
protected static final String ENTRY_TYPE_ODATAENTRY  
protected static final String ENTRY_KEY_ODATASERVICEDOCUMENT  
protected static final String ENTRY_KEY_ODATASCHEMA  
protected static final String NON_SAPDATA_DOCUMENTS_HASHMAP_KEY  
protected ISDMLogger logger Logger object.
protected String mLogTag  
protected ISDMEntrySearch entrySearch  
protected ISDMPreferences preferences  
protected int cacheCapacity  
protected int maxSearchResult  
protected String searchField  
protected int searchAlgorythm  
protected long mPerformanceTime  
protected long mTimerStart  
protected HashMap< String, Map< String, ISDMParserDocument > > collectionStore  
protected ISDMODataServiceDocument serviceDocument  
protected ISDMODataSchema schema  
Constructors Methods
Modifier and Type Method Description
protected void addSearchablePropertyPath(ISDMODataProperty, String, List< String[]>, String...)  
public void clear()  
protected Map< String, ISDMParserDocument > createStore()  
protected boolean fullTermContainSearch(String, ISDMODataEntry, List< String[]>)  
protected boolean fullTermPrefixSearch(String, ISDMODataEntry, List< String[]>)  
public ISDMEntrySearch getEntrySearch()  
public ISDMParserDocument getSDMODataDocument(String)  
public List< ISDMODataEntry > getSDMODataEntries(String)  
public ISDMODataEntry getSDMODataEntry(String)  
public ISDMODataSchema getSDMODataSchema()  
public ISDMODataServiceDocument getSDMODataServiceDocument()  
public int getSearchAlgorithm()  
public List< ISDMParserDocument > getStoredDocuments()  
public void onPreferenceChanged(String, Object)  
public void read(BufferedReader)  
protected boolean regexSearch(String, ISDMODataEntry)  
public boolean removeSDMODataDocument(String)  
public boolean removeSDMODataEntries(String)  
public void removeStoredDocuments()  
public boolean searchInEntry(String, String, List< String >, ISDMODataEntry, List< String[]>, int) Verifies whether the entry should be found during searching for the incoming search term.
public List< ISDMODataEntry > searchSDMODataEntries(String, String)  
public List< ISDMODataEntry > searchSDMODataEntries(String, String, int)  
public void setEntrySearch(ISDMEntrySearch)  
public void setSDMODataDocument(String, ISDMParserDocument)  
public void setSDMODataEntries(List< ISDMODataEntry >)  
public void setSDMODataEntry(ISDMODataEntry)  
public void setSDMODataSchema(ISDMODataSchema)  
public void setSDMODataServiceDocument(ISDMODataServiceDocument)  
public void setSearchAlgorithm(int)  
protected boolean tokenizedContainAllSearch(List< String >, ISDMODataEntry, List< String[]>)  
protected boolean tokenizedContainSearch(List< String >, ISDMODataEntry, List< String[]>)  
protected boolean tokenizedPrefixSearch(List< String >, ISDMODataEntry, List< String[]>)  
public void write(BufferedWriter)  
Inherited members from ISDMPersistable
Modifier and Type Member Description
public void read(BufferedReader)  
public void write(BufferedWriter)  

Usage

Technical Details: For capacity management, SDMCache uses an LRU (least recently used) like algorithm that ensures that the most recently used entries are not removed first because of reaching the maximum capacity. SDMCache currently supports only the tokenized prefix search as stated above. As a future improvement SDMCache is also going to support custom search logic. SDMCache is an implementer of the android.os.Parcelable interface provided by Android SDK. SDMCache depends on SAPData specific interfaces of SDMParser but does not depend on the real implementation of SDMParser.