Class DataCacheMem
- Namespace
- SWConfigDataClientLib.Proxies.IppbxServer
- Assembly
- IpPbxCDSClientLib.dll
This class is used to keep collections of configuration data up to date by handling the data change events from the CDS. Cached data: Users with configured mobile extension, location entries and license data.
public class DataCacheMem : DataCacheCommon
- Inheritance
-
DataCacheMem
- Inherited Members
Constructors
DataCacheMem()
public DataCacheMem()
Properties
AddNewItems
Gets or sets weather new items should be added automatically to the registered collection or not.
public bool AddNewItems { get; set; }
Property Value
Methods
CheckFeatureList(int, FeatureList)
Sets the licensed and enabled flag for all features in an list of features for an user.
public void CheckFeatureList(int UserID, FeatureList featureList)
Parameters
UserID
intThe id of the user to be checked for
featureList
FeatureListThe list of features
Clear()
Removes all data from cache and removes references to LibManager object
public void Clear()
ContainsUser(int)
public bool ContainsUser(int userID)
Parameters
userID
int
Returns
DeinitChangeManagement()
Deregisters all ChangeInterest
public void DeinitChangeManagement()
GetDefaultLocationID()
Returns the id of the default location
public int GetDefaultLocationID()
Returns
- int
id
GetLocationCount()
Returns the number of locations
public int GetLocationCount()
Returns
- int
Number of locations
GetLocationEntry(int)
Returns the location entry
public LocationEntry GetLocationEntry(int locationID)
Parameters
locationID
intThe id of the location
Returns
GetLocationIDs()
Returns all location ids in read only list
public SReadOnlyIntList GetLocationIDs()
Returns
- SReadOnlyIntList
List of ids
GetMarkedForUpdateCount()
Get the number of cached users
public int GetMarkedForUpdateCount()
Returns
- int
Number of cached users.
GetMemUserEntry()
Returns the user entry of the mem user.
public UserEntry GetMemUserEntry()
Returns
- UserEntry
User entry or null
GetUserCount()
Returns the number of users
public int GetUserCount()
Returns
- int
Number of users
GetUserEntry(int)
Gets an single user entry by id
public UserEntry GetUserEntry(int userID)
Parameters
userID
intThe id of the user
Returns
- UserEntry
UserEntry
Exceptions
- SSystemException
Throws if user id is unknown
GetUserEntryByName(string)
Gets an single user entry by name
public UserEntry GetUserEntryByName(string name)
Parameters
name
string
Returns
- UserEntry
UserEntry
Exceptions
- SSystemException
Throws if user id is unknown
GetUserID(string)
Gets the id of an user by its name
public int GetUserID(string name)
Parameters
name
stringName of the user.
Returns
- int
UserID or 0
GetUserIDByMIN(string)
Returns the UserID of an user identified by its Mobile Identification Number
public int GetUserIDByMIN(string min)
Parameters
min
stringThe Mobile Identification Number
Returns
- int
UserID or 0
GetUserIDs()
Gets all user ids
public SReadOnlyIntList GetUserIDs()
Returns
GetUserIDsByLocation(int)
Gets ids of all users in a given location.
public SReadOnlyIntList GetUserIDsByLocation(int locationID)
Parameters
locationID
intid of the location
Returns
- SReadOnlyIntList
Read only list of user ids.
GetUsers()
Returns all cached user entries in a read only collection
public ReadOnlyUserCollection GetUsers()
Returns
- ReadOnlyUserCollection
Read only collection with all cached users
Init(LibManager, bool, string)
Initializes the cache with data and subscribes for changes at the ConfigDataStore
public void Init(LibManager libManager, bool loadAll, string memUserName)
Parameters
libManager
LibManagerThe connection that will be used by the cache.
loadAll
boolIf true the cache will load all data from database into cache. Should be true in most cases.
memUserName
stringname of the mem user
InitChangeManagement(DataCacheSubscription)
Subscribes a set of change notification subscriptions at the ConfigDataStore and subscribes the given subscription at the cache itself.
public void InitChangeManagement(DataCacheSubscription subscription)
Parameters
subscription
DataCacheSubscriptionSubscription for all changes of the cached data.
InitLibManager(LibManager, bool, string)
Initializes the cache with data connection to CDS
public void InitLibManager(LibManager libManager, bool loadAll, string memUserName)
Parameters
libManager
LibManagerThe connection that will be used by the cache.
loadAll
boolIf true the cache will load all data from database into cache. Should be true in most cases.
memUserName
stringName of the mem user.
LoadAll()
Loads all data from the CDS (except License and Feature data)
public void LoadAll()
LoadAllAfterReconnect()
Loads all data from the CDS. Will be called after reconnection to the CDS
public void LoadAllAfterReconnect()
MarkLocationForReload(int)
The given location will be reloaded asynchronously.
public void MarkLocationForReload(int locationID)
Parameters
locationID
intId of the given location
MarkUserForReload(int)
The given user will be reloaded asynchronously.
public void MarkUserForReload(int userID)
Parameters
userID
intId of the given user
MemUserExisits()
Returns true if a mem user is configured
public bool MemUserExisits()
Returns
- bool
True/False
Verbose()
public string Verbose()
Returns
Events
OnChangeReceived
Occurs after data in cache has been changed by the CDS.
public event ChangeReceivedEventHandler OnChangeReceived