Table of Contents

Class CPCacheBaseClass

Namespace
Contensive.BaseClasses
Assembly
CPBase.dll

CP.Cache - local and remote caching

public abstract class CPCacheBaseClass
Inheritance
CPCacheBaseClass
Inherited Members

Methods

Clear(List<string>)

Invalidate one or more cache objects by key

public abstract void Clear(List<string> keyList)

Parameters

keyList List<string>

Clear(string)

Use Clear(dependentKeyList)

[Obsolete("Use Clear(dependentKeyList)", false)]
public abstract void Clear(string ContentNameList)

Parameters

ContentNameList string

ClearAll()

Invalidate all system cache.

public abstract void ClearAll()

CreateDependencyKeyInvalidateOnChange(string)

use CreateTabledependencyKey() instead

[Obsolete("use CreateTabledependencyKey() instead", false)]
public abstract string CreateDependencyKeyInvalidateOnChange(string tablename)

Parameters

tablename string

Returns

string

CreateDependencyKeyInvalidateOnChange(string, string)

use CreateTabledependencyKey() instead

[Obsolete("use CreateTabledependencyKey() instead", false)]
public abstract string CreateDependencyKeyInvalidateOnChange(string tablename, string datasource)

Parameters

tablename string
datasource string

Returns

string

CreateKey(string)

Createconvert a unique name to a cache key

public abstract string CreateKey(string uniqueName)

Parameters

uniqueName string

Returns

string

CreateKey(string, string)

deprecated. Use CreateKey( uniqueName )

public abstract string CreateKey(string uniqueName, string objectUniqueIdentifier)

Parameters

uniqueName string
objectUniqueIdentifier string

Returns

string

CreateKeyForDbRecord(int, string)

use CreateRecordKey() instead

[Obsolete("use CreateRecordKey() instead", false)]
public abstract string CreateKeyForDbRecord(int recordId, string tableName)

Parameters

recordId int
tableName string

Returns

string

CreateKeyForDbRecord(int, string, string)

use CreateRecordKey() instead

[Obsolete("use CreateRecordKey() instead", false)]
public abstract string CreateKeyForDbRecord(int recordId, string tableName, string dataSourceName)

Parameters

recordId int
tableName string
dataSourceName string

Returns

string

CreatePtrKeyforDbRecordGuid(string, string)

Create a cachKeyPointer for a db model object.

public abstract string CreatePtrKeyforDbRecordGuid(string guid, string tableName)

Parameters

guid string
tableName string

Returns

string

CreatePtrKeyforDbRecordGuid(string, string, string)

Create a pointer cacheKey for a db model object. A Ptr key doesnt contain the object, but points to a key for an object. When you get a cache object from a Ptr Key, the object it points to is returned. For example, data may be stored in a cache named for the id of a record, then a pointer created for the guid of the record.

public abstract string CreatePtrKeyforDbRecordGuid(string guid, string tableName, string dataSourceName)

Parameters

guid string
tableName string
dataSourceName string

Returns

string

CreatePtrKeyforDbRecordUniqueName(string, string)

Create a Ptr key for a db model object based on the record name.

public abstract string CreatePtrKeyforDbRecordUniqueName(string name, string tableName)

Parameters

name string
tableName string

Returns

string

CreatePtrKeyforDbRecordUniqueName(string, string, string)

Create a Ptr key for a db model object based on the record name. Only for tables where the name is unique

public abstract string CreatePtrKeyforDbRecordUniqueName(string name, string tableName, string dataSourceName)

Parameters

name string
tableName string
dataSourceName string

Returns

string

CreateRecordKey(int, string)

Create a cacheKey for a database record in the default datasource. A cacheKey argument is required for many cache methods.

public abstract string CreateRecordKey(int recordId, string tableName)

Parameters

recordId int
tableName string

Returns

string

CreateRecordKey(int, string, string)

Create a cacheKey for a database model object. A cacheKey argument is required for many cache methods.

public abstract string CreateRecordKey(int recordId, string tableName, string dataSourceName)

Parameters

recordId int
tableName string
dataSourceName string

Returns

string

CreateTableDependencyKey(string)

Create a dependency cacheKey for a database table. Use a dependency cacheKey as an argument in setCache(). If any record is updated in this table, any cache that includes this dependency will be invalidated

public abstract string CreateTableDependencyKey(string tableName)

Parameters

tableName string

Returns

string

CreateTableDependencyKey(string, string)

Create a key used only as a dependency. If any record in the table is added/deleted/modified, this key will be updated, invalidating the parent object. Uses UpdateLastModified Uses the

public abstract string CreateTableDependencyKey(string tableName, string dataSourceName)

Parameters

tableName string
dataSourceName string

Returns

string

GetBoolean(string)

Return a boolean from cache. If empty or invalid, returns false.

public abstract bool GetBoolean(string key)

Parameters

key string

Returns

bool

GetDate(string)

Return a date from cache. If empty or invalid, returns Date.MinValue.

public abstract DateTime GetDate(string key)

Parameters

key string

Returns

DateTime

GetInteger(string)

Return an integer from cache. If empty or invalid, returns 0.

public abstract int GetInteger(string key)

Parameters

key string

Returns

int

GetNumber(string)

Return a double from cache. If empty or invalid, returns 0.

public abstract double GetNumber(string key)

Parameters

key string

Returns

double

GetObject(string)

Return the value of a cache. If empty or invalid, returns null.

public abstract object GetObject(string key)

Parameters

key string

Returns

object

GetObject<T>(string)

Get an object of type T from cache. If empty or invalid type, returns Null.

public abstract T GetObject<T>(string key)

Parameters

key string

Returns

T

Type Parameters

T

GetText(string)

Return a string from cache. If empty or invalid, returns empty string.

public abstract string GetText(string key)

Parameters

key string

Returns

string

Invalidate(string)

Invalidate a cache.

public abstract void Invalidate(string key)

Parameters

key string

InvalidateAll()

Invalidate all system cache.

public abstract void InvalidateAll()

InvalidateContentRecord(string, int)

Invalidate a key based on the content name and recordId

public abstract void InvalidateContentRecord(string contentName, int recordId)

Parameters

contentName string
recordId int

InvalidateTable(string)

Invalidate all cache entries dependent on this tableKey

public abstract void InvalidateTable(string tableName)

Parameters

tableName string

InvalidateTableRecord(string, int)

Invalidate a key based on the table and recordId

public abstract void InvalidateTableRecord(string tableName, int recordId)

Parameters

tableName string
recordId int

InvalidateTag(string)

Use Invalidate(key)

[Obsolete("Use Invalidate(key)", false)]
public abstract void InvalidateTag(string tag)

Parameters

tag string

InvalidateTagList(List<string>)

Invalidate a list of cache keys.

public abstract void InvalidateTagList(List<string> keyList)

Parameters

keyList List<string>

Read(string)

Use GetText(key) instead

[Obsolete("Use GetText(key) instead", false)]
public abstract string Read(string key)

Parameters

key string

Returns

string

Save(string, string)

Use Store()

[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value)

Parameters

key string
Value string

Save(string, string, string)

Use Store()

[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value, string tagCommaList)

Parameters

key string
Value string
tagCommaList string

Save(string, string, string, DateTime)

Use Store()

[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value, string tagCommaList, DateTime ClearOnDate)

Parameters

key string
Value string
tagCommaList string
ClearOnDate DateTime

SetKey(string, object)

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value)

Parameters

key string
Value object

SetKey(string, object, List<string>)

Deprecated. Use Store().

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, List<string> tagList)

Parameters

key string
Value object
tagList List<string>

SetKey(string, object, DateTime)

Deprecated. Use Store().

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate)

Parameters

key string
Value object
invalidationDate DateTime

SetKey(string, object, DateTime, List<string>)

Deprecated. Use Store().

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate, List<string> tagList)

Parameters

key string
Value object
invalidationDate DateTime
tagList List<string>

SetKey(string, object, DateTime, string)

Deprecated. Use Store().

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate, string tag)

Parameters

key string
Value object
invalidationDate DateTime
tag string

SetKey(string, object, string)

Deprecated. Use Store().

[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, string tag)

Parameters

key string
Value object
tag string

Store(string, object)

Store an object to a key.

public abstract void Store(string key, object value)

Parameters

key string
value object

Store(string, object, List<string>)

Store an object to a key. Invalidate the object if a dependentKey is updated after this object is stored.

public abstract void Store(string key, object value, List<string> dependentKeyList)

Parameters

key string
value object
dependentKeyList List<string>

Store(string, object, DateTime)

Store an object to a key. Invalidate at the date and time specified.

public abstract void Store(string key, object value, DateTime invalidationDate)

Parameters

key string
value object
invalidationDate DateTime

Store(string, object, DateTime, List<string>)

Store an object to a key. Invalidate at the date and time specified.

public abstract void Store(string key, object value, DateTime invalidationDate, List<string> dependentKeyList)

Parameters

key string
value object
invalidationDate DateTime
dependentKeyList List<string>

Store(string, object, DateTime, string)

Store an object to a key.

public abstract void Store(string key, object value, DateTime invalidationDate, string dependentKey)

Parameters

key string
value object
invalidationDate DateTime
dependentKey string

Store(string, object, string)

Store an object to a key. Invalidate the object if a dependentKey is updated after this object is stored.

public abstract void Store(string key, object value, string dependentKey)

Parameters

key string
value object
dependentKey string

StorePtr(string, string)

Store a ptr to a cache entry. For example you may store an object by its recordId, but need to reference it by its guid. Create the cache key with the id, and a cache ptr which refers the guid to the cacheKey and a Get of the ptr will return the cache entry for the id.

public abstract void StorePtr(string keyPtr, string key)

Parameters

keyPtr string
key string

UpdateLastModified(string)

Use InvalidateTableDependencyKey() instead

[Obsolete("Use InvalidateTableDependencyKey() instead", false)]
public abstract void UpdateLastModified(string tableName)

Parameters

tableName string

invalidateTableDependencyKey(string)

Invalidate all cache objects created with CreateRecordKey() and including this tableName

public abstract void invalidateTableDependencyKey(string tableName)

Parameters

tableName string