Class DataCachePhones
- Namespace
- SWConfigDataClientLib.Proxies.PhoneClient
- Assembly
- IpPbxCDSClientLib.dll
Container object for cached data used by the Phone Manager and the 3pcc Service. Cached objects: Users, Trunks, Location, AllowedInternals, SingallingRelations All data access methods are returning locally cached data without any io operation. The cached data will be updated asynchronously by notify messages from the cds and by reload action for specified entities.
public class DataCachePhones : DataCacheCommon
- Inheritance
-
DataCachePhones
- Inherited Members
Constructors
DataCachePhones()
public DataCachePhones()
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)
Returns true if an user is currently cached.
public bool ContainsUser(int userID)
Parameters
userID
intid of the user
Returns
- bool
true or false
Remarks
If the user will be removed from database the user will also be removed from the cache. An invocation of 'GetUserEntry' after a successfully 'ContainsUser' can still throw an exception.
DeinitChangeManagement()
Unsubscribe all change notification subscriptions of the cache at the ConfigDataStore
public void DeinitChangeManagement()
GetUserCount()
Returns the number of cached users entries.
public int GetUserCount()
Returns
- int
Number of users.
GetUserEntry(int)
public UserPinAuthEntry GetUserEntry(int userID)
Parameters
userID
int
Returns
- UserPinAuthEntry
GetUserIDByAutoLoginPhone(string)
Returns the UserID of an user identified by its mac address
public int GetUserIDByAutoLoginPhone(string mac)
Parameters
mac
stringthe mac address
Returns
- int
UserID or 0
GetUserIDByLanPhonePin(string)
Returns the UserID of an user identified by its lan phone pin
public int GetUserIDByLanPhonePin(string pin)
Parameters
pin
stringlan phone pin
Returns
- int
UserID or 0
GetUsersWithAuthloginOrLanPhonePinEnbaled()
Returns read only list of users that are having a mac for autologin
public ReadOnlyUserPinAuthCollection GetUsersWithAuthloginOrLanPhonePinEnbaled()
Returns
- ReadOnlyUserPinAuthCollection
Read only collection of PhonePinAuthEntries
Init(LibManager, bool)
Initializes the cache with data and subscribes for changes at the ConfigDataStore
public void Init(LibManager libManager, bool loadAll)
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.
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)
Initializes the cache with data connection to CDS
public void InitLibManager(LibManager libManager, bool loadAll)
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.
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
Verbose()
public string Verbose()
Returns
Events
OnChangeReceived
Occurs after cached data has been changed
public event ChangeReceivedEventHandler OnChangeReceived