Class DataCacheUaCsta
- Namespace
- SWConfigDataClientLib.Proxies.IppbxServer
- Assembly
- IpPbxCDSClientLib.dll
Container object for cached data used by the UaCstaServer. Cached objects: Users, SipCredentials, Features 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 DataCacheUaCsta : DataCacheCommon
- Inheritance
-
DataCacheUaCsta
- Inherited Members
Constructors
DataCacheUaCsta()
public DataCacheUaCsta()
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
NotifyAllChanges
public bool NotifyAllChanges { 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()
Deregisters all ChangeInterest
public void DeinitChangeManagement()
GetMarkedForUpdateCount()
Return the number of user currently marked for reload
public int GetMarkedForUpdateCount()
Returns
- int
Number of user marked for reload
GetSipCredentialsCount()
Returns the number of sip credentials
public int GetSipCredentialsCount()
Returns
- int
Number of sip credentials
GetSipCredentialsOfUser(int)
Returns the sip credentials of an user identified by its User ID
public SipCredentialsList GetSipCredentialsOfUser(int userId)
Parameters
userId
intUser ID
Returns
GetUserCount()
Returns the number of users
public int GetUserCount()
Returns
- int
Number of users
GetUserEntry(int)
Gets an single user entry by id
public UserEntryUaCsta GetUserEntry(int userID)
Parameters
userID
intThe id of the user
Returns
- UserEntryUaCsta
UserEntry
Exceptions
- SSystemException
Throws if user id is unknown
GetUserID(string)
Returns an UserID by the name of the user. (0 is the user is not cached)
public int GetUserID(string name)
Parameters
name
stringThe name of the user
Returns
- int
UserID or 0
GetUserIdByLoginId(Guid)
Returns the UserID of an user identified by a login id. The login id will be invalidated implicitly.
public int GetUserIdByLoginId(Guid loginId)
Parameters
loginId
GuidLoginUserID
Returns
- int
UserID or 0
GetUserIdBySipUserId(string)
Returns the UserID of an user identified by its Sip User ID
public int GetUserIdBySipUserId(string sipUserID)
Parameters
sipUserID
stringSip User ID
Returns
- int
UserID or 0
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.
IsUserEntryDeleted(int)
Gets true is user is deleted but still accessible
public bool IsUserEntryDeleted(int userId)
Parameters
userId
int
Returns
- bool
true is deleted
Exceptions
- SSystemException
Throws if user id is unknown
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()
MarkUserForReload(int)
The given user will be reloaded asynchronously.
public void MarkUserForReload(int userID)
Parameters
userID
intId of the given user
Verbose()
public string Verbose()
Returns
Events
OnChangeReceived
public event ChangeReceivedEventHandler OnChangeReceived