Class DataCache
- Namespace
- SWConfigDataClientLib.Proxies.IppbxServer
- Assembly
- IpPbxCDSClientLib.dll
Container object for cached data used by the IpPxServer. 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 DataCache : DataCacheCommon
- Inheritance
-
DataCache
- Inherited Members
Constructors
DataCache()
public DataCache()
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
ProvisioningUri
Gets the provisioning uri
public string ProvisioningUri { get; }
Property Value
Methods
CheckConferencePin(string, string)
public bool CheckConferencePin(string internalNumber, string pin)
Parameters
Returns
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()
EnqueueTrunkRecording(NewTrunkRecordingParam)
public void EnqueueTrunkRecording(NewTrunkRecordingParam param)
Parameters
param
NewTrunkRecordingParam
GetAllTrunks()
Returns all cached trunk entries in a read only collection
public ReadOnlyTrunkCollection GetAllTrunks()
Returns
- ReadOnlyTrunkCollection
Read only collection with all cached trunks
GetCallSignalingReceivers(SIntList, SignalType)
Gets an array/vector of distinct users ids of users that are signaling receivers of one user in a list of users
public int[] GetCallSignalingReceivers(SIntList userIDs, SignalType signalType)
Parameters
userIDs
SIntListList of user ids
signalType
SignalTypeThe type of signaling
Returns
- int[]
array/vector of user ids
GetCallSignalingReceivers(int, SignalType)
Gets an array/vector of users ids of user that are signaling receivers of an user
public int[] GetCallSignalingReceivers(int userID, SignalType signalType)
Parameters
userID
intThe id of the given user
signalType
SignalTypeThe type of signaling
Returns
- int[]
array/vector of user ids
GetConfiguredDevicesOfUser(int)
Returns all configured devices of an user
public DcfDeviceInfoList GetConfiguredDevicesOfUser(int userId)
Parameters
userId
int
Returns
- DcfDeviceInfoList
list of device configurations
GetDcfDeviceByHardwareId(string)
Returns device for specific mac address
public DcfDeviceInfo GetDcfDeviceByHardwareId(string hardwareId)
Parameters
hardwareId
stringhardwareId
Returns
- DcfDeviceInfo
device configuration
GetDefaultLocationID()
Returns the id of the default location
public int GetDefaultLocationID()
Returns
- int
id
GetDefaultLocationsUndeliveryCallsNumber()
Return the number for undeliverable calls of the default location
public string GetDefaultLocationsUndeliveryCallsNumber()
Returns
- string
Number
GetGroup(int)
Returns a group
public GroupEntry GetGroup(int groupID)
Parameters
groupID
intid of the group
Returns
- GroupEntry
Group
GetGroupCount()
Returns the number of groups
public int GetGroupCount()
Returns
- int
Number of groups
GetGroupName(int)
Returns the name of a group
public string GetGroupName(int groupID)
Parameters
groupID
intid of the group
Returns
- string
Name or empty string
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()
Return the number of user currently marked for reload
public int GetMarkedForUpdateCount()
Returns
- int
Number of user marked for reload
GetMembersOfGroup(int)
Returns list of group members
public MembershipList GetMembersOfGroup(int groupId)
Parameters
groupId
intid of the group
Returns
- MembershipList
List of members
GetNumberProfileEntry(string)
public NumberProfileEntry GetNumberProfileEntry(string profileId)
Parameters
profileId
string
Returns
GetProviderProfileEntry(string)
public ProviderProfileEntry GetProviderProfileEntry(string profileId)
Parameters
profileId
string
Returns
GetSignallingRelationCount()
Returns the number of signal relations
public int GetSignallingRelationCount()
Returns
- int
Number of signal relations
GetSipCredentialsBySipUserId(string)
Returns the sip credentials of an user identified by its sip user id
public SipCredentials GetSipCredentialsBySipUserId(string sipUserId)
Parameters
sipUserId
stringSip User Id
Returns
- SipCredentials
GetSipCredentialsCount(bool)
Returns the number of sip credentials
public int GetSipCredentialsCount(bool includeLegacy)
Parameters
includeLegacy
bool
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
GetSipUserAgentRegExpressionInfo(string)
public SipUserAgentRegExpressionInfo GetSipUserAgentRegExpressionInfo(string hardwareId)
Parameters
hardwareId
string
Returns
- SipUserAgentRegExpressionInfo
GetSoftwareDevice(int, string)
Returns the soft device configuration. Currently this configuration contains the PNS Shared Secret only. if config does not exist an empty configuration will be returned. (Empty: SharedSecret is null)
public UserSoftwareDevice GetSoftwareDevice(int userId, string deviceId)
Parameters
Returns
- UserSoftwareDevice
UserSoftwareDevice never null
GetTenantFileQuotaInfo()
public TenantFileQuotaInfo GetTenantFileQuotaInfo()
Returns
- TenantFileQuotaInfo
GetTrunkCount()
Returns the number of trunk
public int GetTrunkCount()
Returns
- int
Number of trunks
GetTrunkEntry(int)
Gets a trunk entry by its id
public PortEntry GetTrunkEntry(int trunkID)
Parameters
trunkID
intThe id of the trunk
Returns
- PortEntry
Trunk entry
GetTrunkID(string)
Returns a trunk entry by its id
public int GetTrunkID(string name)
Parameters
name
stringThe id of the trunk
Returns
- int
Trunk entry
GetTrunkIDBySipUserID(string)
Gets the id of a trunk by the configured SIP User ID
public int GetTrunkIDBySipUserID(string name)
Parameters
name
stringSIP User ID
Returns
- int
The of the trunk. 0 if no trunk exists with the given SIP User ID.
GetTrunkIDsByLocation(int)
Gets the ids of all trunks assigned to the given location
public SReadOnlyIntList GetTrunkIDsByLocation(int locationID)
Parameters
locationID
intid of the location
Returns
- SReadOnlyIntList
Read only list of trunk ids.
GetTrunkIdsWithMatchingRange(string)
public SIntList GetTrunkIdsWithMatchingRange(string canonicalNumber)
Parameters
canonicalNumber
string
Returns
GetTrunksForUpdateCount()
Return the number of trunks currently marked for reload
public int GetTrunksForUpdateCount()
Returns
- int
Number of trunks marked for reload
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
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
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
GetUserIDByControlledNumber(string)
Returns the UserID of an user identified by its controlled number
public int GetUserIDByControlledNumber(string value)
Parameters
value
stringControlled NUmber
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
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
GetUserIDByMobilePhoneNumber(string)
Returns the UserID of an user identified by its
public int GetUserIDByMobilePhoneNumber(string mobilePhoneNumber)
Parameters
mobilePhoneNumber
string
Returns
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
GetUserIDOfConferenceUser()
Returns the user id of a tenants first conference user If there is no conference user 0 is returned
public int GetUserIDOfConferenceUser()
Returns
- int
Id of the conmference user 0
GetUserIDsByAllowed3pcc(bool)
Returns all userIDs of users having a given status of the Use3pccAllowed flag
public SReadOnlyIntList GetUserIDsByAllowed3pcc(bool value)
Parameters
value
boolThe status of the flag
Returns
- SReadOnlyIntList
Read only list of user ids
GetUserIDsByLocation(int)
Returns all userIDs of users assigned to the given location
public SReadOnlyIntList GetUserIDsByLocation(int locationID)
Parameters
locationID
intid of the location
Returns
- SReadOnlyIntList
Read only list of user ids
GetUserIDsByNTAccount(string)
Returns all userIDs of users that are assigned to a windows account/id
public SReadOnlyIntList GetUserIDsByNTAccount(string accountName)
Parameters
accountName
stringThe windows account name (SID)
Returns
- SReadOnlyIntList
Read only list of user ids
GetUserIDsByUseAsSystemPhone(bool)
Returns all userIDs of users having a given status of the UseAsSystemPhone flag
public SReadOnlyIntList GetUserIDsByUseAsSystemPhone(bool value)
Parameters
value
boolThe status of the flag
Returns
- SReadOnlyIntList
Read only list of user ids
GetUserMessageCount(int)
Gets message counts for user
public NumMessages GetUserMessageCount(int userId)
Parameters
userId
int
Returns
- NumMessages
NumMessages
Exceptions
- SSystemException
Throws if user id is unknown
GetUserQuotaInfo(int)
Gets an single user entry by id
public UserFileQuotaInfo GetUserQuotaInfo(int userID)
Parameters
userID
intThe id of the user
Returns
- UserFileQuotaInfo
UserEntry
Exceptions
- SSystemException
Throws if user id is unknown
GetUsers()
Returns all cached user entries in a read only collection
public ReadOnlyUserCollection GetUsers()
Returns
- ReadOnlyUserCollection
Read only collection with all cached users
HasConferencePin(string)
public bool HasConferencePin(string internalNumber)
Parameters
internalNumber
string
Returns
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.
IsInternalNumberAllowed(int, string)
Returns true if the given internal number is one of the allowed ones of the the given user. Allowed number are all internal numbers of the user and all substituted numbers of this user and his groups.
public bool IsInternalNumberAllowed(int userID, string internalNumber)
Parameters
Returns
- bool
True or False
Remarks
The list of allowed internals will be cached in the local user object after first call. Every change on table Membership, InternalNumbers or Substituted Numbers will invalidate the cached list of all users.
IsUserMemberOfGroup(int, int)
Returns true if user is member of the group
public bool IsUserMemberOfGroup(int userId, int groupId)
Parameters
Returns
- bool
true id user member of group
IsWellKnownDcfDevice(string)
public bool IsWellKnownDcfDevice(string hardwareId)
Parameters
hardwareId
string
Returns
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
MarkTrunkForReload(int)
The given trunk will be reloaded asynchronously.
public void MarkTrunkForReload(int trunkID)
Parameters
trunkID
intId of the given trunk
MarkUserForReload(int)
The given user will be reloaded asynchronously.
public void MarkUserForReload(int userID)
Parameters
userID
intId of the given user
MemCallsAllowedOnGroup(int)
Gets the value of the MemCallsAllowed Flag of the specified group
public bool MemCallsAllowedOnGroup(int groupID)
Parameters
groupID
intid of the group
Returns
- bool
true or false
PutPnsSharedSecret(int, string, string)
Pns shared secret will be stored
public void PutPnsSharedSecret(int userId, string deviceId, string sharedSecret)
Parameters
UpdateDcfDeviceFromSipUserAgentInfo(string, SipUserAgentInfo)
public bool UpdateDcfDeviceFromSipUserAgentInfo(string hardwareId, SipUserAgentInfo info)
Parameters
hardwareId
stringinfo
SipUserAgentInfo
Returns
UpdateDcfDeviceFromSipUserAgentString(string, string)
public bool UpdateDcfDeviceFromSipUserAgentString(string hardwareId, string userAgentString)
Parameters
Returns
Verbose()
public string Verbose()
Returns
Events
OnChangeReceived
public event ChangeReceivedEventHandler OnChangeReceived