Skip to content

API Library MemCacheD

Robert Polak edited this page Jul 24, 2019 · 24 revisions

Home / API Library / MemCacheD

API Library MemCacheD

API Library MemCacheD handling Memory Cache based on the Enyim client. The API Library MemCacheD Methods list with Parameters, Return examples.

Configuration

Configuration- Details

Configuration of MemCacheD variables at App.config.

<configuration>
	<AppSettings>
		<!-- MemCacheD - Switch on [TRUE] or off [FALSE] the MemCacheD -->
		<add key="API_MEMCACHED_ENABLED" value="FALSE" />
		<!-- MemCacheD - Maximum validity in number of seconds that MemCacheD can handle (30 days = 2592000) -->
		<add key="API_MEMCACHED_MAX_VALIDITY" value="2592000" />
		<!-- MemCacheD - Salsa code to isolate the cache records form other applications or environments -->
		<add key="API_MEMCACHED_SALSA" value="subdomain.domain.extension" />		
	</AppSettings>
	<enyim.com>
		<memcached protocol="Binary">
			<servers>
				<!-- N.B. Make sure you use the same ordering of nodes in every configuration you have -->
				<add address="" port="11211" />
			</servers>
			<socketPool minPoolSize="10" maxPoolSize="20" connectionTimeout="00:00:10" deadTimeout="00:00:10" />
		</memcached>
	</enyim.com>
</configuration>

Store_ADO

Store_ADO - Details

Store_ADO is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls (ADO). Returns Bool.

Method: API.MemCacheD.Store_ADO

Parameters:

Name Type Default Description
nameSpace String Name Space
procedureName String Procedure Name
inputParams Array [ADO_inputParams] Input Params Object
data dynamic data
expiresAt DateTime new DateTime(0) Expires At Date Time
validFor TimeSpan new TimeSpan(0) Valid For Time Period
repository String null Repository

ADO_inputParams - Parameter

Name Type Default Description
name string name
value dynamic value
typeName string typeName

Return: Bool


Store_BSO

Store_BSO - Details

Store_BSO is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of dervice calls (BSO). Returns Bool.

Method: API.MemCacheD.Store_BSO

Parameters:

Name Type Default Description
nameSpace String Name Space
className String Class Name
methodName String Method Name
inputDTO dynamic inputDTO
data T data
expiresAt DateTime new DateTime(0) Expires At Date Time
validFor TimeSpan new TimeSpan(0) Valid For Time Period
repository String null Repository

Repository constans definition at PxStat => \Resources\Constants.cs:

        C_CAS_NAVIGATION_READ = "PxStat.System.Navigation.Navigation_API.Read";
        C_CAS_NAVIGATION_SEARCH = "PxStat.System.Navigation.Navigation_API.Search";
        C_CAS_DATA_CUBE_READ_DATASET = "PxStat.Data.Cube_API.ReadDataset";
        C_CAS_DATA_COMPARE_READ_AMENDMENT = "PxStat.Data.Compare_API.ReadAmendment";
        C_CAS_DATA_COMPARE_READ_DELETION = "PxStat.Data.Compare_API.ReadDeletion";
        C_CAS_DATA_COMPARE_READ_ADDITION = "PxStat.Data.Compare_API.ReadAddition";
        C_CAS_DATA_COMPARE_READ_PREVIOUS_RELEASE = "PxStat.Data.Compare_API.ReadPreviousRelease";
        C_CAS_DATA_CUBE_READ_METADATA = "PxStat.Data.Cube_API.ReadMetadata";
        C_CAS_DATA_READ_PRE_DATASET = "PxStat.Data.Cube_API.ReadPreDataset";
        C_CAS_DATA_READ_PRE_METADATA = "PxStat.Data.Cube_API.ReadPreMetadata";
        C_CAS_DATA_CUBE_READ_COLLECTION = "PxStat.Data.Cube_API.ReadCollection";

Return: Bool

Code usage C# example:

MemCacheD.Store_BSO<dynamic>("PxStat.Data", "Cube_API", "ReadCollection", theCubeDTO, theResponse.data, new DateTime(), Resources.Constants.C_CAS_DATA_CUBE_READ_COLLECTION);

Cas Repository Flush

Cas Repository Flush - Details

Remove all the cached records stored into a Cas Repository. Returns void

Method: API.MemCacheD.CasRepositoryFlush

Parameters:

Name Type Default Description
repository String repository

Return: void

Code usage C# example:

MemCacheD.CasRepositoryFlush(Resources.Constants.C_CAS_DATA_COMPARE_READ_ADDITION + latestRelease.RlsCode);

Get_ADO

Get_ADO - Details

Get_ADO get in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls (ADO). Returns MemCachedD_Value.

Method: API.MemCacheD.Get_ADO

Parameters:

Name Type Default Description
nameSpace String Name Space
procedureName String Procedure Name
inputParams Array [ADO_inputParams] Input Params Object

ADO_inputParams - Parameter

Name Type Default Description
name string name
value dynamic value
typeName string typeName

Return: MemCachedD_Value Object.

MemCachedD_Value:

Name Type Default Description
datetime DateTime new DateTime.Now Date Time Now
expiresAt DateTime new DateTime(0) Expires At Date Time
validFor TimeSpan new TimeSpan(0) Valid For Time Period
hasData Bool false Has Data Indicator
data dynamic null Data
Clone this wiki locally