diff --git a/.pubnub.yml b/.pubnub.yml index fba2a8153..bc746049e 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -797,6 +797,7 @@ supported-platforms: - .Net Framework 4.0 - .Net Framework 4.5 - .Net Framework 4.6.1+ + - .Net Framework 6.0 - version: PubnubPCL 'C#' 6.20.1 platforms: @@ -892,9 +893,9 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - - .NET 4.x + - .NET 6.x minimum-os-version: - Windows 10 Home - Windows 10 Pro @@ -1031,9 +1032,9 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - - .NET 4.x + - .NET 6.x minimum-os-version: - Windows 10 Home - Windows 10 Pro @@ -1152,10 +1153,10 @@ sdks: supported-operating-systems: Android: runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x target-api-level: - 11 minimum-api-level: @@ -1172,10 +1173,10 @@ sdks: - ARMv7 (Cortex) CPU with NEON support iOS: runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - iOS 9.0 maximum-os-version: @@ -1189,10 +1190,10 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - Windows 10 Home - Windows 10 Pro @@ -1269,7 +1270,7 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 maximum-os-version: @@ -1280,10 +1281,10 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - Mac OS X 10.8 maximum-os-version: @@ -1330,7 +1331,7 @@ sdks: supported-operating-systems: Android: runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 target-api-level: @@ -1349,10 +1350,10 @@ sdks: - ARMv7 (Cortex) CPU with NEON support iOS: runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - iOS 9.0 maximum-os-version: @@ -1366,10 +1367,10 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - Windows 10 Home - Windows 10 Pro @@ -1446,10 +1447,10 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x maximum-os-version: - Ubuntu 20.04 LTS minimum-os-version: @@ -1458,10 +1459,10 @@ sdks: target-architecture: - x86-64 runtime-version: - - .NET 4.x Equivalent + - .NET 6.x Equivalent api-compatibility: - .NET Core 2 - - .NET 4.x + - .NET 6.x minimum-os-version: - Mac OS X 10.8 maximum-os-version: @@ -1643,4 +1644,4 @@ sdks: - Windows Server 2012 R2 Foundation - Windows Server 2012 R2 Essentials - Windows Server 2012 R2 Standard - - Windows Server 2012 R2 Datacenter + - Windows Server 2012 R2 Datacenter \ No newline at end of file diff --git a/src/Api/PubnubApi/Builder/UrlRequestBuilder.cs b/src/Api/PubnubApi/Builder/UrlRequestBuilder.cs index 09843e259..075568e1a 100644 --- a/src/Api/PubnubApi/Builder/UrlRequestBuilder.cs +++ b/src/Api/PubnubApi/Builder/UrlRequestBuilder.cs @@ -24,16 +24,14 @@ public sealed class UrlRequestBuilder : IUrlRequestBuilder private readonly IPubnubUnitTest pubnubUnitTest; private readonly IPubnubLog pubnubLog; private readonly string pubnubInstanceId; - private readonly EndPoint.TelemetryManager telemetryMgr; private readonly EndPoint.TokenManager tokenMgr; - public UrlRequestBuilder(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TelemetryManager pubnubTelemetryMgr, EndPoint.TokenManager pubnubTokenMgr, string pnInstanceId) + public UrlRequestBuilder(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TokenManager pubnubTokenMgr, string pnInstanceId) { pubnubConfig.AddOrUpdate(pnInstanceId, config, (k, o) => config); this.jsonLib = jsonPluggableLibrary; this.pubnubUnitTest = pubnubUnitTest; this.pubnubLog = log; - this.telemetryMgr = pubnubTelemetryMgr; this.tokenMgr = pubnubTokenMgr; this.pubnubInstanceId = string.IsNullOrEmpty(pnInstanceId) ? "" : pnInstanceId; } @@ -2076,18 +2074,6 @@ private Dictionary GenerateCommonQueryParams(PNOperationType typ ret.Add("instanceid", pubnubInstanceId); } - if (pubnubConfig.ContainsKey(pubnubInstanceId) && pubnubConfig[pubnubInstanceId].EnableTelemetry && telemetryMgr != null) - { - Dictionary opsLatency = telemetryMgr.GetOperationsLatency().ConfigureAwait(false).GetAwaiter().GetResult(); - if (opsLatency != null && opsLatency.Count > 0) - { - foreach (string key in opsLatency.Keys) - { - ret.Add(key, opsLatency[key]); - } - } - } - if (pubnubConfig.ContainsKey(pubnubInstanceId) && !string.IsNullOrEmpty(pubnubConfig[pubnubInstanceId].SecretKey)) { ret.Add("timestamp", timeStamp.ToString(CultureInfo.InvariantCulture)); diff --git a/src/Api/PubnubApi/ClientNetworkStatus.cs b/src/Api/PubnubApi/ClientNetworkStatus.cs index d706e6b9a..d034a37b1 100644 --- a/src/Api/PubnubApi/ClientNetworkStatus.cs +++ b/src/Api/PubnubApi/ClientNetworkStatus.cs @@ -209,7 +209,7 @@ private static async Task CheckSocketConnect(object internetState) pubnubCallback = state.PubnubCallbacck; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(pubnubConfig, jsonLib, unit, pubnubLog, null, null, ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(pubnubConfig, jsonLib, unit, pubnubLog, null, ""); Uri requestUri = urlBuilder.BuildTimeRequest("GET", "", null); try { diff --git a/src/Api/PubnubApi/EndPoint/Access/AuditOperation.cs b/src/Api/PubnubApi/EndPoint/Access/AuditOperation.cs index 2e4368e52..1abff04b0 100644 --- a/src/Api/PubnubApi/EndPoint/Access/AuditOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Access/AuditOperation.cs @@ -17,7 +17,6 @@ public class AuditOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string channelName; private string channelGroupName; @@ -25,13 +24,12 @@ public class AuditOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public AuditOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, null, instance) + public AuditOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, null, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public AuditOperation Channel(string channel) @@ -113,7 +111,7 @@ internal void AuditAccess(string channel, string channelGroup, string[] authKeys string authKeysCommaDelimited = (authKeys != null && authKeys.Length > 0) ? string.Join(",", authKeys.OrderBy(x => x).ToArray()) : ""; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildAuditAccessRequest("GET", "", channel, channelGroup, authKeysCommaDelimited, externalQueryParam); RequestState requestState = new RequestState(); @@ -154,7 +152,7 @@ internal async Task> AuditAccess(string cha string authKeysCommaDelimited = (authKeys != null && authKeys.Length > 0) ? string.Join(",", authKeys.OrderBy(x => x).ToArray()) : ""; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildAuditAccessRequest("GET", "", channel, channelGroup, authKeysCommaDelimited, externalQueryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/Access/GrantOperation.cs b/src/Api/PubnubApi/EndPoint/Access/GrantOperation.cs index d11eab87b..3cd1b31c4 100644 --- a/src/Api/PubnubApi/EndPoint/Access/GrantOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Access/GrantOperation.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Threading; using System.Net; @@ -18,7 +17,6 @@ public class GrantOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string[] pubnubChannelNames; private string[] pubnubChannelGroupNames; @@ -35,13 +33,12 @@ public class GrantOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GrantOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, null, instance) + public GrantOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, null, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public GrantOperation Channels(string[] channels) @@ -224,7 +221,7 @@ internal void GrantAccess(PNCallback callback) string targetUuidsCommaDelimited = string.Join(",", uuidList.OrderBy(x => x).ToArray()); string authKeysCommaDelimited = string.Join(",", authList.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGrantV2AccessRequest("GET", "", channelsCommaDelimited, channelGroupsCommaDelimited, targetUuidsCommaDelimited, authKeysCommaDelimited, this.grantRead, this.grantWrite, this.grantDelete, this.grantManage, this.grantGet, this.grantUpdate, this.grantJoin, this.grantTTL, this.queryParam); RequestState requestState = new RequestState(); @@ -290,7 +287,7 @@ internal async Task> GrantAccess() string targetUuidsCommaDelimited = string.Join(",", uuidList.OrderBy(x => x).ToArray()); string authKeysCommaDelimited = string.Join(",", authList.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGrantV2AccessRequest("GET", "", channelsCommaDelimited, channelGroupsCommaDelimited, targetUuidsCommaDelimited,authKeysCommaDelimited, this.grantRead, this.grantWrite, this.grantDelete, this.grantManage, this.grantGet, this.grantUpdate, this.grantJoin, this.grantTTL, this.queryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/Access/GrantTokenOperation.cs b/src/Api/PubnubApi/EndPoint/Access/GrantTokenOperation.cs index 5ab257582..40ad6e355 100644 --- a/src/Api/PubnubApi/EndPoint/Access/GrantTokenOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Access/GrantTokenOperation.cs @@ -18,7 +18,6 @@ public class GrantTokenOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNTokenResources pubnubResources = new PNTokenResources { @@ -44,13 +43,12 @@ public class GrantTokenOperation : PubnubCoreBase private string pubnubAuthorizedUuid = string.Empty; private string pubnubAuthorizedUserId = string.Empty; - public GrantTokenOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GrantTokenOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; InitializeDefaultVariableObjectStates(); @@ -326,7 +324,7 @@ internal void GrantAccess(PNCallback callback) string requestMethodName = "POST"; string postMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGrantV3AccessRequest(requestMethodName, postMessage, this.queryParam); UrlProcessRequest(request, requestState, false, postData).ContinueWith(r => @@ -458,7 +456,7 @@ internal async Task> GrantAccess() string requestMethodName = "POST"; string postMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGrantV3AccessRequest(requestMethodName, postMessage, this.queryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/Access/RevokeTokenOperation.cs b/src/Api/PubnubApi/EndPoint/Access/RevokeTokenOperation.cs index cddae2111..608f0230b 100644 --- a/src/Api/PubnubApi/EndPoint/Access/RevokeTokenOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Access/RevokeTokenOperation.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; #if !NET35 && !NET40 @@ -16,19 +14,17 @@ public class RevokeTokenOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string pnToken = string.Empty; private PNCallback savedCallbackRevokeToken; private Dictionary queryParam; - public RevokeTokenOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RevokeTokenOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; InitializeDefaultVariableObjectStates(); @@ -99,7 +95,7 @@ internal void RevokeAccess(PNCallback callback requestState.EndPointOperation = this; string requestMethodName = "DELETE"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRevokeV3AccessRequest(requestMethodName, null, pnToken, this.queryParam); UrlProcessRequest(request, requestState, false).ContinueWith(r => @@ -123,7 +119,7 @@ internal async Task> RevokeAccess() PNResult ret = new PNResult(); string requestMethodName = "DELETE"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRevokeV3AccessRequest(requestMethodName, null, pnToken, queryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/ChannelGroup/AddChannelsToChannelGroupOperation.cs b/src/Api/PubnubApi/EndPoint/ChannelGroup/AddChannelsToChannelGroupOperation.cs index e5b382245..218a71d8b 100644 --- a/src/Api/PubnubApi/EndPoint/ChannelGroup/AddChannelsToChannelGroupOperation.cs +++ b/src/Api/PubnubApi/EndPoint/ChannelGroup/AddChannelsToChannelGroupOperation.cs @@ -16,20 +16,18 @@ public class AddChannelsToChannelGroupOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pnTelemetryMgr; private string channelGroupName = ""; private string[] channelNames; private PNCallback savedCallback; private Dictionary queryParam; - public AddChannelsToChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public AddChannelsToChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pnTelemetryMgr = telemetryManager; } public AddChannelsToChannelGroupOperation ChannelGroup(string channelGroup) @@ -112,7 +110,7 @@ internal void AddChannelsToChannelGroup(string[] channels, string nameSpace, str throw new ArgumentException("Missing groupName"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pnTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); string channelsCommaDelimited = string.Join(",", channels.OrderBy(x => x).ToArray()); @@ -155,7 +153,7 @@ internal async Task> AddChannelsToChan } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pnTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); string channelsCommaDelimited = string.Join(",", channels.OrderBy(x => x).ToArray()); diff --git a/src/Api/PubnubApi/EndPoint/ChannelGroup/DeleteChannelGroupOperation.cs b/src/Api/PubnubApi/EndPoint/ChannelGroup/DeleteChannelGroupOperation.cs index af125b23f..dee1ba7c1 100644 --- a/src/Api/PubnubApi/EndPoint/ChannelGroup/DeleteChannelGroupOperation.cs +++ b/src/Api/PubnubApi/EndPoint/ChannelGroup/DeleteChannelGroupOperation.cs @@ -15,19 +15,17 @@ public class DeleteChannelGroupOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string channelGroupName = ""; private PNCallback savedCallback; private Dictionary queryParam; - public DeleteChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public DeleteChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public DeleteChannelGroupOperation ChannelGroup(string channelGroup) @@ -94,7 +92,7 @@ internal void DeleteChannelGroup(string groupName, Dictionary ex throw new ArgumentException("Missing groupName"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveChannelsFromChannelGroupRequest("GET", "", null, "", groupName, externalQueryParam); RequestState requestState = new RequestState(); @@ -124,7 +122,7 @@ internal async Task> DeleteChannelGro } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveChannelsFromChannelGroupRequest("GET", "", null, "", groupName, externalQueryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/ChannelGroup/ListAllChannelGroupOperation.cs b/src/Api/PubnubApi/EndPoint/ChannelGroup/ListAllChannelGroupOperation.cs index 36409c2c4..8acb26cdc 100644 --- a/src/Api/PubnubApi/EndPoint/ChannelGroup/ListAllChannelGroupOperation.cs +++ b/src/Api/PubnubApi/EndPoint/ChannelGroup/ListAllChannelGroupOperation.cs @@ -15,18 +15,16 @@ public class ListAllChannelGroupOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNCallback savedCallback; private Dictionary queryParam; - public ListAllChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ListAllChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public ListAllChannelGroupOperation QueryParam(Dictionary customQueryParam) @@ -82,7 +80,7 @@ internal void Retry() internal void GetAllChannelGroup(Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllChannelGroupRequest("GET", "", externalQueryParam); RequestState requestState = new RequestState(); @@ -106,7 +104,7 @@ internal async Task> GetAllChannelGroup(D { PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllChannelGroupRequest("GET", "", externalQueryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/ChannelGroup/ListChannelsForChannelGroupOperation.cs b/src/Api/PubnubApi/EndPoint/ChannelGroup/ListChannelsForChannelGroupOperation.cs index e939d0a03..81f268538 100644 --- a/src/Api/PubnubApi/EndPoint/ChannelGroup/ListChannelsForChannelGroupOperation.cs +++ b/src/Api/PubnubApi/EndPoint/ChannelGroup/ListChannelsForChannelGroupOperation.cs @@ -15,19 +15,17 @@ public class ListChannelsForChannelGroupOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string channelGroupName = ""; private PNCallback savedCallback; private Dictionary queryParam; - public ListChannelsForChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ListChannelsForChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } @@ -95,7 +93,7 @@ internal void GetChannelsForChannelGroup(string groupName, Dictionary> GetChannelsForCh } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetChannelsForChannelGroupRequest("GET", "", null, groupName, false, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/ChannelGroup/RemoveChannelsFromChannelGroupOperation.cs b/src/Api/PubnubApi/EndPoint/ChannelGroup/RemoveChannelsFromChannelGroupOperation.cs index cc6a2c8a1..8117c1ebe 100644 --- a/src/Api/PubnubApi/EndPoint/ChannelGroup/RemoveChannelsFromChannelGroupOperation.cs +++ b/src/Api/PubnubApi/EndPoint/ChannelGroup/RemoveChannelsFromChannelGroupOperation.cs @@ -16,20 +16,18 @@ public class RemoveChannelsFromChannelGroupOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string channelGroupName = ""; private string[] channelNames; private PNCallback savedCallback; private Dictionary queryParam; - public RemoveChannelsFromChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveChannelsFromChannelGroupOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public RemoveChannelsFromChannelGroupOperation ChannelGroup(string channelGroup) @@ -112,7 +110,7 @@ internal void RemoveChannelsFromChannelGroup(string[] channels, string nameSpace throw new ArgumentException("Missing groupName"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); string channelsCommaDelimited = string.Join(",", channels.OrderBy(x => x).ToArray()); @@ -156,7 +154,7 @@ internal async Task> RemoveChannels } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); string channelsCommaDelimited = string.Join(",", channels.OrderBy(x => x).ToArray()); diff --git a/src/Api/PubnubApi/EndPoint/Files/DeleteFileOperation.cs b/src/Api/PubnubApi/EndPoint/Files/DeleteFileOperation.cs index e24165d97..3f2e22026 100644 --- a/src/Api/PubnubApi/EndPoint/Files/DeleteFileOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Files/DeleteFileOperation.cs @@ -18,7 +18,6 @@ public class DeleteFileOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNCallback savedCallback; private Dictionary queryParam; @@ -27,13 +26,12 @@ public class DeleteFileOperation : PubnubCoreBase private string currentFileId; private string currentFileName; - public DeleteFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public DeleteFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -134,7 +132,7 @@ internal void Retry() private void ProcessDeleteFileRequest(Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetFileUrlOrDeleteReqest("DELETE", "", this.channelName, this.currentFileId, this.currentFileName, externalQueryParam, PNOperationType.PNDeleteFileOperation); @@ -187,7 +185,7 @@ private async Task> ProcessDeleteFileRequest(Dictio return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetFileUrlOrDeleteReqest("DELETE", "", this.channelName, this.currentFileId, this.currentFileName, externalQueryParam, PNOperationType.PNDeleteFileOperation); diff --git a/src/Api/PubnubApi/EndPoint/Files/DownloadFileOperation.cs b/src/Api/PubnubApi/EndPoint/Files/DownloadFileOperation.cs index 93896da53..b5ba61ec8 100644 --- a/src/Api/PubnubApi/EndPoint/Files/DownloadFileOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Files/DownloadFileOperation.cs @@ -21,7 +21,6 @@ public class DownloadFileOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNCallback savedCallback; private Dictionary queryParam; @@ -31,13 +30,12 @@ public class DownloadFileOperation : PubnubCoreBase private string currentFileName; private string currentFileCipherKey; - public DownloadFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public DownloadFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -141,7 +139,7 @@ internal void Retry() private void ProcessFileDownloadRequest(Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetFileUrlOrDeleteReqest("GET", "", this.channelName, this.currentFileId, this.currentFileName, externalQueryParam, PNOperationType.PNDownloadFileOperation); @@ -212,7 +210,7 @@ private async Task> ProcessFileDownloadRequest(Di } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetFileUrlOrDeleteReqest("GET", "", this.channelName, this.currentFileId, this.currentFileName, externalQueryParam, PNOperationType.PNDownloadFileOperation); diff --git a/src/Api/PubnubApi/EndPoint/Files/GenerateFileUploadUrlOperation.cs b/src/Api/PubnubApi/EndPoint/Files/GenerateFileUploadUrlOperation.cs index bed5b7551..28a89d795 100644 --- a/src/Api/PubnubApi/EndPoint/Files/GenerateFileUploadUrlOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Files/GenerateFileUploadUrlOperation.cs @@ -17,20 +17,18 @@ internal class GenerateFileUploadUrlOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private Dictionary queryParam; private string channelName; private string sendFileName; - public GenerateFileUploadUrlOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GenerateFileUploadUrlOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -116,7 +114,7 @@ private void GenerateFileUploadUrl(Dictionary externalQueryParam string postMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGenerateFileUploadUrlRequest("POST", postMessage, this.channelName, externalQueryParam); UrlProcessRequest(request, requestState, false, postData).ContinueWith(r => @@ -155,7 +153,7 @@ private async Task> GenerateFileUploadUr string postMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGenerateFileUploadUrlRequest("POST", postMessage, this.channelName, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, postData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Files/GetFileUrlOperation.cs b/src/Api/PubnubApi/EndPoint/Files/GetFileUrlOperation.cs index 15f71572a..76df298b7 100644 --- a/src/Api/PubnubApi/EndPoint/Files/GetFileUrlOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Files/GetFileUrlOperation.cs @@ -18,7 +18,6 @@ public class GetFileUrlOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNCallback savedCallback; private Dictionary queryParam; @@ -27,13 +26,12 @@ public class GetFileUrlOperation : PubnubCoreBase private string currentFileId; private string currentFileName; - public GetFileUrlOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetFileUrlOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -130,7 +128,7 @@ internal void Retry() private void ProcessGetFileUrl(Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetFileUrlOrDeleteReqest("GET", "", this.channelName, this.currentFileId, this.currentFileName, externalQueryParam, PNOperationType.PNFileUrlOperation); @@ -160,7 +158,7 @@ private async Task> ProcessGetFileUrl(Dictionary savedCallback; private Dictionary queryParam; @@ -27,13 +26,12 @@ public class ListFilesOperation : PubnubCoreBase private string nextFileBatchToken; private int limitFileCount=-1; - public ListFilesOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ListFilesOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -126,7 +124,7 @@ internal void Retry() private void ProcessListFilesRequest(Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildListFilesReqest("GET", "", this.channelName, this.limitFileCount, this.nextFileBatchToken, externalQueryParam, PNOperationType.PNListFilesOperation); @@ -166,7 +164,7 @@ private async Task> ProcessListFilesRequest(Dictiona return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildListFilesReqest("GET", "", this.channelName, this.limitFileCount, this.nextFileBatchToken, externalQueryParam, PNOperationType.PNListFilesOperation); diff --git a/src/Api/PubnubApi/EndPoint/Files/PublishFileMessage.cs b/src/Api/PubnubApi/EndPoint/Files/PublishFileMessage.cs index 5fc623dee..4751bfb61 100644 --- a/src/Api/PubnubApi/EndPoint/Files/PublishFileMessage.cs +++ b/src/Api/PubnubApi/EndPoint/Files/PublishFileMessage.cs @@ -17,7 +17,6 @@ public class PublishFileMessageOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNCallback savedCallback; private Dictionary queryParam; @@ -30,13 +29,12 @@ public class PublishFileMessageOperation : PubnubCoreBase private Dictionary userMetadata; private int ttl = -1; - public PublishFileMessageOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public PublishFileMessageOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -179,7 +177,7 @@ private void ProcessFileMessagePublish(Dictionary externalQueryP requestState.EndPointOperation = this; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishFileMessageRequest("GET", "", this.channelName, publishPayload, this.storeInHistory, this.ttl, this.userMetadata, null, externalQueryParam); string json = ""; @@ -247,7 +245,7 @@ private async Task> ProcessFileMessagePubli requestState.Reconnect = false; requestState.EndPointOperation = this; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishFileMessageRequest("GET", "", this.channelName, publishPayload, this.storeInHistory, this.ttl, this.userMetadata, null, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs b/src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs index b6101ed69..d70294f0a 100644 --- a/src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs @@ -21,7 +21,6 @@ public class SendFileOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private Dictionary queryParam; @@ -36,13 +35,12 @@ public class SendFileOperation : PubnubCoreBase private Dictionary userMetadata; private int ttl = -1; - public SendFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SendFileOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -386,7 +384,7 @@ private async Task> GenerateFileUploadUr string postMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGenerateFileUploadUrlRequest("POST", postMessage, this.channelName, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, postData, "application/json").ConfigureAwait(false); @@ -410,7 +408,7 @@ private async Task> PublishFileMessage(obje { PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishFileMessageRequest("GET", "", this.channelName, message, this.storeInHistory, this.ttl, this.userMetadata, null, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetAllChannelMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetAllChannelMetadataOperation.cs index 530c21fcf..e7da7111d 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetAllChannelMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetAllChannelMetadataOperation.cs @@ -15,7 +15,6 @@ public class GetAllChannelMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private int limit = -1; private bool includeCount; @@ -27,13 +26,12 @@ public class GetAllChannelMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetAllChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetAllChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -143,7 +141,7 @@ private void GetAllChannelMetadataList(PNPageObject page, int limit, bool includ if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllChannelMetadataRequest("GET", "", internalPage.Next, internalPage.Prev, limit, includeCount, includeCustom, filter, sort, externalQueryParam); RequestState requestState = new RequestState(); @@ -172,7 +170,7 @@ private async Task> GetAllChannelMetadat if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllChannelMetadataRequest("GET", "", internalPage.Next, internalPage.Prev, limit, includeCount, includeCustom, filter, sort, externalQueryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetAllUuidMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetAllUuidMetadataOperation.cs index 9770d9f3c..ced0c018c 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetAllUuidMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetAllUuidMetadataOperation.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; -using System.Text; using System.Threading; using System.Threading.Tasks; #if !NET35 && !NET40 @@ -17,7 +15,6 @@ public class GetAllUuidMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private int limit = -1; private bool includeCount; @@ -29,13 +26,12 @@ public class GetAllUuidMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetAllUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetAllUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -144,7 +140,7 @@ private void GetUuidMetadataList(PNPageObject page, int limit, bool includeCount if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllUuidMetadataRequest("GET", "", internalPage.Next, internalPage.Prev, limit, includeCount, includeCustom, filter, sort, externalQueryParam); RequestState requestState = new RequestState(); @@ -173,7 +169,7 @@ private async Task> GetUuidMetadataList(PNP if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllUuidMetadataRequest("GET", "", internalPage.Next, internalPage.Prev, limit, includeCount, includeCustom, filter, sort, externalQueryParam); RequestState requestState = new RequestState(); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetChannelMembersOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetChannelMembersOperation.cs index c4e52998e..503b0a411 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetChannelMembersOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetChannelMembersOperation.cs @@ -16,7 +16,6 @@ public class GetChannelMembersOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string channelMetadataId = ""; private int limit = -1; @@ -29,13 +28,12 @@ public class GetChannelMembersOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -156,7 +154,7 @@ private void GetMembersList(string spaceId, PNPageObject page, int limit, bool i if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllMembersRequest("GET", "", spaceId, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, filter, sort, externalQueryParam); @@ -193,7 +191,7 @@ private async Task> GetMembersList(string space if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllMembersRequest("GET", "", spaceId, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, filter, sort, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetChannelMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetChannelMetadataOperation.cs index 0abc78dfd..584365f7d 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetChannelMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetChannelMetadataOperation.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Threading; using System.Net; @@ -17,7 +15,6 @@ public class GetChannelMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetadataId = ""; private bool includeCustom; @@ -25,13 +22,12 @@ public class GetChannelMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -118,7 +114,7 @@ internal void Retry() private void GetSingleChannelMetadata(string spaceId, bool includeCustom, Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetSingleChannelMetadataRequest("GET", "", spaceId, includeCustom, externalQueryParam); @@ -158,7 +154,7 @@ private async Task> GetSingleChannelMetadat return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetSingleChannelMetadataRequest("GET", "", spaceId, includeCustom, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetMembershipsOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetMembershipsOperation.cs index 6ffd8db66..813d46636 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetMembershipsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetMembershipsOperation.cs @@ -16,7 +16,6 @@ public class GetMembershipsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string uuidMetadataId = ""; private int limit = -1; @@ -29,13 +28,12 @@ public class GetMembershipsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -161,7 +159,7 @@ private void GetMembershipsList(string uuid, PNPageObject page, int limit, bool if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllMembershipsRequest("GET", "", uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, filter, sort, externalQueryParam); @@ -204,7 +202,7 @@ private async Task> GetMembershipsList(string uuid if (page == null) { internalPage = new PNPageObject(); } else { internalPage = page; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetAllMembershipsRequest("GET", "", uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, filter, sort, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/GetUuidMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/GetUuidMetadataOperation.cs index ebb029bab..e275fd005 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/GetUuidMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/GetUuidMetadataOperation.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; -using System.Text; using System.Threading; using System.Threading.Tasks; #if !NET35 && !NET40 @@ -17,7 +15,6 @@ public class GetUuidMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private bool includeCustom; private string usrUuid = ""; @@ -25,13 +22,12 @@ public class GetUuidMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -118,7 +114,7 @@ private void GetSingleUuidMetadata(string uuid, bool includeCustom, Dictionary> GetSingleUuidMetadata(stri } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetSingleUuidMetadataRequest("GET", "", uuid, includeCustom, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/ManageChannelMembersOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/ManageChannelMembersOperation.cs index 82002c736..8083ae45c 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/ManageChannelMembersOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/ManageChannelMembersOperation.cs @@ -18,7 +18,6 @@ public class ManageChannelMembersOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetadataId = ""; private List setMember; @@ -32,13 +31,12 @@ public class ManageChannelMembersOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public ManageChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ManageChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -221,7 +219,7 @@ private void ProcessMembersOperationRequest(string spaceId, List @@ -310,7 +308,7 @@ private async Task> ProcessMembersOperationRequ string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMemberAddUpdateRemoveChannelRequest("PATCH", patchMessage, channel, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/ManageMembershipsOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/ManageMembershipsOperation.cs index 134f81e59..5ec84b990 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/ManageMembershipsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/ManageMembershipsOperation.cs @@ -18,7 +18,6 @@ public class ManageMembershipsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string uuidMetadataId = ""; private List addMembership; @@ -32,13 +31,12 @@ public class ManageMembershipsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public ManageMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ManageMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -221,7 +219,7 @@ private void ManageChannelMembershipWithUuid(string uuid, List set string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); UrlProcessRequest(request, requestState, false, patchData).ContinueWith(r => @@ -307,7 +305,7 @@ private async Task> ManageChannelMembershipWithUui string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMembersOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMembersOperation.cs index 3cfa60ced..44f1fdb86 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMembersOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMembersOperation.cs @@ -18,7 +18,6 @@ public class RemoveChannelMembersOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetadataId = ""; private List delMember; @@ -31,13 +30,12 @@ public class RemoveChannelMembersOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemoveChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -196,7 +194,7 @@ private void ProcessRemoveChannelMembersOperationRequest(string spaceId, List @@ -267,7 +265,7 @@ private async Task> ProcessRemoveChannelMembers string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMemberAddUpdateRemoveChannelRequest("PATCH", patchMessage, channel, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMetadataOperation.cs index 7529a38e2..fc72d6cc0 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/RemoveChannelMetadataOperation.cs @@ -17,7 +17,6 @@ public class RemoveChannelMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetadataId = ""; @@ -25,13 +24,12 @@ public class RemoveChannelMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemoveChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -119,7 +117,7 @@ internal void Retry() private void RemoveChannelMetadata(string spaceId, Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildDeleteChannelMetadataRequest("DELETE", "", spaceId, externalQueryParam); @@ -158,7 +156,7 @@ private async Task> RemoveChannelMetadat return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildDeleteChannelMetadataRequest("DELETE", "", spaceId, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/RemoveMembershipsOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/RemoveMembershipsOperation.cs index 6cde2d341..331695206 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/RemoveMembershipsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/RemoveMembershipsOperation.cs @@ -18,7 +18,6 @@ public class RemoveMembershipsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string uuidMetadataId = ""; private List delMembership; @@ -30,13 +29,12 @@ public class RemoveMembershipsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemoveMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -195,7 +193,7 @@ private void RemoveUuidMemberships(string uuid, List removeMembership, P string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); UrlProcessRequest(request, requestState, false, patchData).ContinueWith(r => @@ -263,7 +261,7 @@ private async Task> RemoveUuidMemberships(string u string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/RemoveUuidMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/RemoveUuidMetadataOperation.cs index c68183d31..3403bd0d0 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/RemoveUuidMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/RemoveUuidMetadataOperation.cs @@ -17,20 +17,18 @@ public class RemoveUuidMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string usrUuid = ""; private PNCallback savedCallback; private Dictionary queryParam; - public RemoveUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -118,7 +116,7 @@ private void RemoveUuidMetadata(string uuid, Dictionary external uuid = config.UserId; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildDeleteUuidMetadataRequest("DELETE", "", uuid, externalQueryParam); @@ -157,7 +155,7 @@ private async Task> RemoveUuidMetadata(stri return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildDeleteUuidMetadataRequest("DELETE", "", uuid, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/SetChannelMembersOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/SetChannelMembersOperation.cs index 0f0cdb95c..46caa3d0a 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/SetChannelMembersOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/SetChannelMembersOperation.cs @@ -18,7 +18,6 @@ public class SetChannelMembersOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetadataId = ""; private List setMember; @@ -31,13 +30,12 @@ public class SetChannelMembersOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public SetChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SetChannelMembersOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -197,7 +195,7 @@ private void ProcessMembersOperationRequest(string spaceId, List @@ -269,7 +267,7 @@ private async Task> ProcessMembersOperationRequ string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMemberAddUpdateRemoveChannelRequest("PATCH", patchMessage, channel, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/SetChannelMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/SetChannelMetadataOperation.cs index 7a54951a1..ed91c8761 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/SetChannelMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/SetChannelMetadataOperation.cs @@ -17,7 +17,6 @@ public class SetChannelMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string chMetaId = ""; private string chMetaName; @@ -28,13 +27,12 @@ public class SetChannelMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public SetChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SetChannelMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -171,7 +169,7 @@ private void SetChannelMetadata(string channelMetaId, bool includeCustom, Dictio string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSetChannelMetadataRequest("PATCH", patchMessage, channelMetaId, includeCustom, externalQueryParam); @@ -227,7 +225,7 @@ private async Task> SetChannelMetadata(stri string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSetChannelMetadataRequest("PATCH", patchMessage, channelMetaId, includeCustom, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Objects/SetMembershipsOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/SetMembershipsOperation.cs index 34c0c6495..80c6655e0 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/SetMembershipsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/SetMembershipsOperation.cs @@ -18,7 +18,6 @@ public class SetMembershipsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string uuidMetadataId = ""; private List addMembership; @@ -31,13 +30,12 @@ public class SetMembershipsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public SetMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SetMembershipsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -197,7 +195,7 @@ private void SetChannelMembershipWithUuid(string uuid, List setMem string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); UrlProcessRequest(request, requestState, false, patchData).ContinueWith(r => @@ -266,7 +264,7 @@ private async Task> SetChannelMembershipWithUuid(s string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMembershipSetRemoveManageUserRequest(requestState.ResponseType, "PATCH", patchMessage, uuid, internalPage.Next, internalPage.Prev, limit, includeCount, includeOptions, sort, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/Objects/SetUuidMetadataOperation.cs b/src/Api/PubnubApi/EndPoint/Objects/SetUuidMetadataOperation.cs index 539378e5d..1423284af 100644 --- a/src/Api/PubnubApi/EndPoint/Objects/SetUuidMetadataOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Objects/SetUuidMetadataOperation.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; using System.Text; using System.Threading; @@ -17,7 +16,6 @@ public class SetUuidMetadataOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string uuidId; private string uuidName; @@ -31,13 +29,12 @@ public class SetUuidMetadataOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public SetUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SetUuidMetadataOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -189,7 +186,7 @@ private void SetUuidMetadata(string uuid, bool includeCustom, Dictionary @@ -239,7 +236,7 @@ private async Task> SetUuidMetadata(string uui string patchMessage = jsonLibrary.SerializeToJsonString(messageEnvelope); byte[] patchData = Encoding.UTF8.GetBytes(patchMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSetUuidMetadataRequest("PATCH", patchMessage, uuid, includeCustom, externalQueryParam); Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, patchData).ConfigureAwait(false); diff --git a/src/Api/PubnubApi/EndPoint/OtherOperation.cs b/src/Api/PubnubApi/EndPoint/OtherOperation.cs index 67e7efb8b..f335897fc 100644 --- a/src/Api/PubnubApi/EndPoint/OtherOperation.cs +++ b/src/Api/PubnubApi/EndPoint/OtherOperation.cs @@ -17,15 +17,13 @@ internal class OtherOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; - public OtherOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public OtherOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public void ChangeUserId(UserId newUserId) @@ -53,7 +51,7 @@ public void ChangeUserId(UserId newUserId) if (channels.Length > 0 || channelGroups.Length > 0) { string channelsJsonState = BuildJsonUserState(channels.ToArray(), channelGroups.ToArray(), false); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMultiChannelLeaveRequest("GET", "", channels, channelGroups, channelsJsonState, null); diff --git a/src/Api/PubnubApi/EndPoint/Presence/GetStateOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/GetStateOperation.cs index d3673c217..b0ef29857 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/GetStateOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/GetStateOperation.cs @@ -17,7 +17,6 @@ public class GetStateOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string[] channelNames; private string[] channelGroupNames; @@ -25,13 +24,12 @@ public class GetStateOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetStateOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetStateOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public GetStateOperation Channels(string[] channels) @@ -122,7 +120,7 @@ internal void GetUserState(string[] channels, string[] channelGroups, string uui string channelsCommaDelimited = (channels != null && channels.Length > 0) ? string.Join(",", channels.OrderBy(x => x).ToArray()) : ""; string channelGroupsCommaDelimited = (channelGroups != null && channelGroups.Length > 0) ? string.Join(",", channelGroups.OrderBy(x => x).ToArray()) : ""; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetUserStateRequest("GET", "", channelsCommaDelimited, channelGroupsCommaDelimited, internalUuid, externalQueryParam); @@ -167,7 +165,7 @@ internal async Task> GetUserState(string[] channels, string channelsCommaDelimited = (channels != null && channels.Length > 0) ? string.Join(",", channels.OrderBy(x => x).ToArray()) : ""; string channelGroupsCommaDelimited = (channelGroups != null && channelGroups.Length > 0) ? string.Join(",", channelGroups.OrderBy(x => x).ToArray()) : ""; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetUserStateRequest("GET", "", channelsCommaDelimited, channelGroupsCommaDelimited, internalUuid, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Presence/HeartbeatOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/HeartbeatOperation.cs index 23493811f..782dbb7dc 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/HeartbeatOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/HeartbeatOperation.cs @@ -12,16 +12,13 @@ public class HeartbeatOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly TelemetryManager pubnubTelemetryMgr; - public HeartbeatOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public HeartbeatOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; - PubnubInstance = instance; } @@ -33,7 +30,7 @@ internal async Task HeartbeatRequest(string[] channels, string[] ch if (config.MaintainPresenceState) presenceState = BuildJsonUserState(channels, channelGroups, true); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, ""); Uri request = urlBuilder.BuildPresenceHeartbeatRequest("GET", "", channels, channelGroups, presenceState); RequestState pubnubRequestState = new RequestState(); pubnubRequestState.Channels = channels; diff --git a/src/Api/PubnubApi/EndPoint/Presence/HereNowOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/HereNowOperation.cs index d872b2e31..7ed48f780 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/HereNowOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/HereNowOperation.cs @@ -15,7 +15,7 @@ public class HereNowOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; + private string[] channelNames; private string[] channelGroupNames; private bool includeUserState; @@ -23,13 +23,12 @@ public class HereNowOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public HereNowOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public HereNowOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public HereNowOperation Channels(string[] channels) @@ -107,7 +106,7 @@ internal void Retry() internal void HereNow(string[] channels, string[] channelGroups, bool showUUIDList, bool includeUserState, Dictionary externalQueryParam, PNCallback callback) { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildHereNowRequest("GET", "", channels, channelGroups, showUUIDList, includeUserState, externalQueryParam); @@ -132,7 +131,7 @@ internal async Task> HereNow(string[] channels, string { PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildHereNowRequest("GET", "", channels, channelGroups, showUUIDList, includeUserState, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Presence/LeaveOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/LeaveOperation.cs index 6fdd8d250..cd65d7eb5 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/LeaveOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/LeaveOperation.cs @@ -11,15 +11,13 @@ public class LeaveOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly TelemetryManager pubnubTelemetryManager; - public LeaveOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public LeaveOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryManager = telemetryManager; PubnubInstance = instance; } @@ -27,7 +25,7 @@ internal async Task LeaveRequest(string[] channels, string[] channe { PNStatus resp = null; try { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryManager, null, string.Empty); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, string.Empty); Uri request = urlBuilder.BuildMultiChannelLeaveRequest("GET", string.Empty, channels, channelGroups, string.Empty, null); RequestState pubnubRequestState = new RequestState(); pubnubRequestState.Channels = channels; diff --git a/src/Api/PubnubApi/EndPoint/Presence/PresenceOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/PresenceOperation.cs index d09a8c9c4..6d5c02b7e 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/PresenceOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/PresenceOperation.cs @@ -15,7 +15,7 @@ public class PresenceOperation private IPubnubUnitTest unit; private IPubnubLog pubnubLog; - public PresenceOperation(Pubnub instance, string instanceId, IPubnubLog pubnubLog, PNConfiguration configuration, TelemetryManager telemetryManager, TokenManager tokenManager, IPubnubUnitTest unit, PresenceEventEngineFactory presenceEventEngineFactory) + public PresenceOperation(Pubnub instance, string instanceId, IPubnubLog pubnubLog, PNConfiguration configuration, TokenManager tokenManager, IPubnubUnitTest unit, PresenceEventEngineFactory presenceEventEngineFactory) { this.pubnubLog = pubnubLog; this.unit = unit; @@ -26,7 +26,7 @@ public PresenceOperation(Pubnub instance, string instanceId, IPubnubLog pubnubLo if (this.presenceEventEngineFactory.HasEventEngine(instanceId)) { presenceEventEngine = this.presenceEventEngineFactory.GetEventEngine(instanceId); } else { - presenceEventEngine = this.presenceEventEngineFactory.InitializeEventEngine(instanceId, instance, pubnubLog, telemetryManager, tokenManager); + presenceEventEngine = this.presenceEventEngineFactory.InitializeEventEngine(instanceId, instance, pubnubLog, tokenManager); presenceEventEngine.OnEffectDispatch += OnEffectDispatch; presenceEventEngine.OnEventQueued += OnEventQueued; } diff --git a/src/Api/PubnubApi/EndPoint/Presence/SetStateOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/SetStateOperation.cs index 3889f196a..b15121720 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/SetStateOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/SetStateOperation.cs @@ -18,7 +18,6 @@ public class SetStateOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string[] channelNames; private string[] channelGroupNames; @@ -27,13 +26,12 @@ public class SetStateOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public SetStateOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SetStateOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -362,7 +360,7 @@ private void SharedSetUserState(string[] channels, string[] channelGroups, strin string jsonUserState = GetJsonSharedSetUserStateInternal(channels, channelGroups, jsonChannelUserState, jsonChannelGroupUserState); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSetUserStateRequest("GET", "", commaDelimitedChannels, commaDelimitedChannelGroups, currentUuid, jsonUserState, externalQueryParam); @@ -420,7 +418,7 @@ private async Task> SharedSetUserState(string[] chann string jsonUserState = GetJsonSharedSetUserStateInternal(channels, channelGroups, jsonChannelUserState, jsonChannelGroupUserState); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSetUserStateRequest("GET", "", commaDelimitedChannels, commaDelimitedChannelGroups, currentUuid, jsonUserState, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Presence/WhereNowOperation.cs b/src/Api/PubnubApi/EndPoint/Presence/WhereNowOperation.cs index e8056d7e4..476141ffa 100644 --- a/src/Api/PubnubApi/EndPoint/Presence/WhereNowOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Presence/WhereNowOperation.cs @@ -17,19 +17,17 @@ public class WhereNowOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string whereNowUUID = ""; private PNCallback savedCallback; private Dictionary queryParam; - public WhereNowOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public WhereNowOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public WhereNowOperation Uuid(string uuid) @@ -106,7 +104,7 @@ internal void WhereNow(string uuid, Dictionary externalQueryPara currentUuid = uuid; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildWhereNowRequest("GET", "", currentUuid, externalQueryParam); @@ -146,7 +144,7 @@ internal async Task> WhereNow(string uuid, Dictionary currentUuid = uuid; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildWhereNowRequest("GET", "", currentUuid, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/AddMessageActionOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/AddMessageActionOperation.cs index 926036467..6a5c19aa8 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/AddMessageActionOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/AddMessageActionOperation.cs @@ -17,7 +17,6 @@ public class AddMessageActionOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string msgActionChannelName = ""; private long messageTimetoken; @@ -25,13 +24,12 @@ public class AddMessageActionOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public AddMessageActionOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public AddMessageActionOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -162,7 +160,7 @@ private void Publish(string channel, long messageTimetoken, PNMessageAction mess string requestMethodName = "POST"; string postMessage = jsonLibrary.SerializeToJsonString(messageAction); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildAddMessageActionRequest(requestMethodName, postMessage, channel, messageTimetoken, externalQueryParam); @@ -212,7 +210,7 @@ private async Task> Publish(string channel, l string requestMethodName = "POST"; string postMessage = jsonLibrary.SerializeToJsonString(messageAction); byte[] postData = Encoding.UTF8.GetBytes(postMessage); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildAddMessageActionRequest(requestMethodName, postMessage, channel, messageTimetoken, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/FireOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/FireOperation.cs index e51c10e30..bc49666c1 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/FireOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/FireOperation.cs @@ -17,7 +17,6 @@ public class FireOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private object msg; private string channelName = ""; @@ -28,13 +27,12 @@ public class FireOperation : PubnubCoreBase private bool syncRequest; private Dictionary queryParam; - public FireOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public FireOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public FireOperation Message(object message) @@ -178,7 +176,7 @@ private void Fire(string channel, object message, bool storeInHistory, int ttl, urlParam.Add("norep", "true"); string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, urlParam, externalQueryParam); @@ -261,7 +259,7 @@ private async Task> Fire(string channel, object messag urlParam.Add("norep", "true"); string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, urlParam, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/GetMessageActionsOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/GetMessageActionsOperation.cs index 163c30bf1..b8c908614 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/GetMessageActionsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/GetMessageActionsOperation.cs @@ -17,7 +17,6 @@ public class GetMessageActionsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string messageActionChannelName = ""; private long startTT = -1; @@ -26,13 +25,12 @@ public class GetMessageActionsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public GetMessageActionsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public GetMessageActionsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -159,7 +157,7 @@ private void GetMessageActions(string channel, long start, long end, int limit, return; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetMessageActionsRequest("GET", "", channel, start, end, limit, externalQueryParam); @@ -206,7 +204,7 @@ private async Task> GetMessageActions(string return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetMessageActionsRequest("GET", "", channel, start, end, limit, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/ListenerManager.cs b/src/Api/PubnubApi/EndPoint/PubSub/ListenerManager.cs index f31dfcf5e..34ba64eb5 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/ListenerManager.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/ListenerManager.cs @@ -16,7 +16,7 @@ public class ListenerManager : PubnubCoreBase private readonly PNConfiguration pubnubConfig; private readonly IPubnubLog pubnubLog; - public ListenerManager(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(config, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public ListenerManager(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(config, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { this.pubnubConfig = config; this.pubnubLog = log; diff --git a/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs index de3e175f1..b3cddc15e 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs @@ -19,7 +19,6 @@ public class PublishOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private object msg; private string channelName = ""; @@ -31,13 +30,12 @@ public class PublishOperation : PubnubCoreBase private bool syncRequest; private Dictionary queryParam; - public PublishOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public PublishOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } @@ -213,7 +211,7 @@ internal void Publish(string channel, object message, bool storeInHistory, int t try { string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); @@ -312,7 +310,7 @@ internal async Task> Publish(string channel, object me try { string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/RemoveMessageActionOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/RemoveMessageActionOperation.cs index e7da08f46..450361a35 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/RemoveMessageActionOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/RemoveMessageActionOperation.cs @@ -17,7 +17,6 @@ public class RemoveMessageActionOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private string msgActionChannelName = ""; private long messageTimetoken; @@ -26,13 +25,12 @@ public class RemoveMessageActionOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemoveMessageActionOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveMessageActionOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -169,7 +167,7 @@ private void RemoveMessageAction(string channel, long messageTimetoken, long act return; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveMessageActionRequest("DELETE", "", channel, messageTimetoken, actionTimetoken, messageActionUuid, externalQueryParam); @@ -216,7 +214,7 @@ private async Task> RemoveMessageAction(st return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveMessageActionRequest("DELETE", "", channel, messageTimetoken, actionTimetoken, messageActionUuid, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SignalOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/SignalOperation.cs index ba2610a85..d9cb9a7da 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SignalOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SignalOperation.cs @@ -17,20 +17,18 @@ public class SignalOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private object msg; private string channelName = ""; private PNCallback savedCallback; private Dictionary queryParam; - public SignalOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SignalOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; if (instance != null) { @@ -165,7 +163,7 @@ private void Signal(string channel, object message, Dictionary m return; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSignalRequest("GET", "", channel, message, metaData, externalQueryParam); @@ -234,7 +232,7 @@ private async Task> Signal(string channel, object mess return ret; } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildSignalRequest("GET", "", channel, message, metaData, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeEndpoint.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeEndpoint.cs index 133ec8eae..5e13ca538 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeEndpoint.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeEndpoint.cs @@ -15,7 +15,6 @@ public class SubscribeEndpoint: ISubscribeOperation private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private readonly EndPoint.TokenManager pubnubTokenMgr; private List subscribeChannelNames = new List(); @@ -36,14 +35,13 @@ public List SubscribeListenerList set; } = new List(); - public SubscribeEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager,SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceOperation presenceOperation , string instanceId, Pubnub instance) + public SubscribeEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager,SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceOperation presenceOperation , string instanceId, Pubnub instance) { PubnubInstance = instance; config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; pubnubTokenMgr = tokenManager; this.subscribeEventEngineFactory = subscribeEventEngineFactory; this.presenceOperation = presenceOperation; @@ -125,7 +123,7 @@ private void Subscribe(string[] channels, string[] channelGroups, SubscriptionCu if (subscribeEventEngineFactory.HasEventEngine(instanceId)) { subscribeEventEngine = subscribeEventEngineFactory.GetEventEngine(instanceId); } else { - var subscribeManager = new SubscribeManager2(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + var subscribeManager = new SubscribeManager2(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); subscribeEventEngine = subscribeEventEngineFactory.InitializeEventEngine(instanceId, PubnubInstance, config, subscribeManager, this.EventEmitter, jsonLibrary, StatusEmitter); subscribeEventEngine.OnStateTransition += SubscribeEventEngine_OnStateTransition; subscribeEventEngine.OnEventQueued += SubscribeEventEngine_OnEventQueued; diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs index 01801cbe9..4b192cb23 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs @@ -17,19 +17,17 @@ internal class SubscribeManager : PubnubCoreBase, IDisposable private static IJsonPluggableLibrary jsonLibrary; private static IPubnubUnitTest unit; private static IPubnubLog pubnubLog; - private static EndPoint.TelemetryManager pubnubTelemetryMgr; private static Timer SubscribeHeartbeatCheckTimer; private Timer multiplexExceptionTimer; private Dictionary customQueryParam; - public SubscribeManager(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SubscribeManager(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config.AddOrUpdate(instance.InstanceId, pubnubConfig, (k, o) => pubnubConfig); jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } #pragma warning disable @@ -80,7 +78,7 @@ internal void MultiChannelUnSubscribeAll(PNOperationType type, Dictionary(PNOperationType type, string channe { //just fire leave() event to REST API for safeguard string channelsJsonState = BuildJsonUserState(validChannels.ToArray(), validChannelGroups.ToArray(), false); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config[PubnubInstance.InstanceId], jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config[PubnubInstance.InstanceId], jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMultiChannelLeaveRequest("GET", "", validChannels.ToArray(), validChannelGroups.ToArray(), channelsJsonState, externalQueryParam); @@ -665,7 +663,7 @@ private void MultiChannelSubscribeRequest(PNOperationType type, string[] chan // Build URL string channelsJsonState = BuildJsonUserState(channels, channelGroups, false); config[PubnubInstance.InstanceId].UserId = CurrentUserId[PubnubInstance.InstanceId]; // to make sure we capture if UUID is changed - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config[PubnubInstance.InstanceId], jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config[PubnubInstance.InstanceId], jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMultiChannelSubscribeRequest("GET", "", channels, channelGroups, (Convert.ToInt64(timetoken.ToString(), CultureInfo.InvariantCulture) == 0) ? Convert.ToInt64(timetoken.ToString(), CultureInfo.InvariantCulture) : lastTimetoken, region, channelsJsonState, initialSubscribeUrlParams, externalQueryParam); @@ -1411,7 +1409,7 @@ void OnPresenceHeartbeatIntervalTimeout(System.Object presenceHeartbeatState) if ((subscriberChannels != null && subscriberChannels.Length > 0) || (subscriberChannelGroups != null && subscriberChannelGroups.Length > 0)) { string channelsJsonState = BuildJsonUserState(subscriberChannels, subscriberChannelGroups, false); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config.ContainsKey(PubnubInstance.InstanceId) ? config[PubnubInstance.InstanceId] : null, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config.ContainsKey(PubnubInstance.InstanceId) ? config[PubnubInstance.InstanceId] : null, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildPresenceHeartbeatRequest("GET", "", subscriberChannels, subscriberChannelGroups, channelsJsonState); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager2.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager2.cs index d6c809293..753d6b6f0 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager2.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager2.cs @@ -22,7 +22,6 @@ internal class SubscribeManager2 : IDisposable private IJsonPluggableLibrary jsonLibrary; private IPubnubUnitTest unit; private IPubnubLog pubnubLog; - private EndPoint.TelemetryManager pubnubTelemetryMgr; private IPubnubHttp pubnubHttp; private Timer SubscribeHeartbeatCheckTimer; @@ -34,13 +33,12 @@ internal class SubscribeManager2 : IDisposable #else private HttpWebRequest httpSubscribe { get; set; } #endif - public SubscribeManager2(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) + public SubscribeManager2(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; //PubnubInstance = instance; #if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10 @@ -86,9 +84,9 @@ public SubscribeManager2(PNConfiguration pubnubConfig, IJsonPluggableLibrary jso httpNonsubscribe.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); httpNonsubscribe.Timeout = TimeSpan.FromSeconds(config.NonSubscribeRequestTimeout); } - pubnubHttp = new PubnubHttp(config, jsonLibrary, log, pubnubTelemetryMgr, httpSubscribe, httpNonsubscribe); + pubnubHttp = new PubnubHttp(config, jsonLibrary, log, httpSubscribe, httpNonsubscribe); #else - pubnubHttp = new PubnubHttp(config, jsonLibrary, log, pubnubTelemetryMgr); + pubnubHttp = new PubnubHttp(config, jsonLibrary, log); #endif } @@ -99,7 +97,7 @@ public async Task> HandshakeRequest(PNOperati string presenceState = string.Empty; if (config.MaintainPresenceState) presenceState = BuildJsonUserState(channels, channelGroups, true); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, ""); Uri request = urlBuilder.BuildMultiChannelSubscribeRequest("GET", "", channels, channelGroups, timetoken.GetValueOrDefault(), region.GetValueOrDefault(), presenceState, initialSubscribeUrlParams, externalQueryParam); RequestState pubnubRequestState = new RequestState(); @@ -153,7 +151,7 @@ internal async Task, PNStatus>> ReceiveRequest> pubnubRequestState = new RequestState>(); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs index a5c129c0a..ebe19e8eb 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs @@ -18,7 +18,6 @@ public class SubscribeOperation : PubnubCoreBase, ISubscribeOperation private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private readonly EndPoint.TokenManager pubnubTokenMgr; private List subscribeChannelNames = new List(); @@ -28,13 +27,12 @@ public class SubscribeOperation : PubnubCoreBase, ISubscribeOperation private SubscribeManager manager; private Dictionary queryParam; - public SubscribeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public SubscribeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; pubnubTokenMgr = tokenManager; PubnubInstance = instance; @@ -210,14 +208,14 @@ private void Subscribe(string[] channels, string[] channelGroups, Dictionary { - manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelSubscribeInit(PNOperationType.PNSubscribeOperation, channels, channelGroups, initialSubscribeUrlParams, externalQueryParam); }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); #else new Thread(() => { - manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelSubscribeInit(PNOperationType.PNSubscribeOperation, channels, channelGroups, initialSubscribeUrlParams, externalQueryParam); }) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllEndpoint.cs b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllEndpoint.cs index c483698e4..4e46bb0eb 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllEndpoint.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllEndpoint.cs @@ -9,19 +9,17 @@ public class UnsubscribeAllEndpoint: UnsubscribeAllOperation private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryManager; private readonly EndPoint.TokenManager pubnubTokenManager; private readonly SubscribeEventEngineFactory subscribeEventEngineFactory; private readonly PresenceEventEngineFactory presenceEventEngineFactory; private readonly string instanceId; - public UnsubscribeAllEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceEventEngineFactory presenceEventEngineFactory ,Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public UnsubscribeAllEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceEventEngineFactory presenceEventEngineFactory ,Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryManager = telemetryManager; pubnubTokenManager = tokenManager; this.subscribeEventEngineFactory = subscribeEventEngineFactory; this.presenceEventEngineFactory = presenceEventEngineFactory; diff --git a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllOperation.cs index 6d507649d..9c7de2963 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeAllOperation.cs @@ -15,17 +15,15 @@ public class UnsubscribeAllOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private readonly EndPoint.TokenManager pubnubTokenMgr; private Dictionary queryParam; - public UnsubscribeAllOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public UnsubscribeAllOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; pubnubTokenMgr = tokenManager; CurrentPubnubInstance(instance); @@ -43,14 +41,14 @@ private void UnsubscribeAll() #if NETFX_CORE || WINDOWS_UWP || UAP || NETSTANDARD10 || NETSTANDARD11 || NETSTANDARD12 Task.Factory.StartNew(() => { - SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelUnSubscribeAll(PNOperationType.PNUnsubscribeOperation, this.queryParam); }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); #else new Thread(() => { - SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelUnSubscribeAll(PNOperationType.PNUnsubscribeOperation, this.queryParam); }) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeEndpoint.cs b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeEndpoint.cs index ef2efddb3..0352926b2 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeEndpoint.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeEndpoint.cs @@ -14,7 +14,6 @@ public class UnsubscribeEndpoint : PubnubCoreBase, IUnsubscribeOperation private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private readonly EndPoint.TokenManager pubnubTokenMgr; private string[] subscribeChannelNames; @@ -26,14 +25,13 @@ public class UnsubscribeEndpoint : PubnubCoreBase, IUnsubscribeOperation private PresenceEventEngineFactory presenceEventEngineFactory; private string instanceId { get; set; } - public UnsubscribeEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceEventEngineFactory presenceEventEngineFactory, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public UnsubscribeEndpoint(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, SubscribeEventEngineFactory subscribeEventEngineFactory, PresenceEventEngineFactory presenceEventEngineFactory, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { pubnubInstance = instance; config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; pubnubTokenMgr = tokenManager; this.subscribeEventEngineFactory = subscribeEventEngineFactory; this.presenceEventEngineFactory = presenceEventEngineFactory; diff --git a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeOperation.cs index 1bbc9990a..291d0ed2d 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/UnsubscribeOperation.cs @@ -18,20 +18,18 @@ public class UnsubscribeOperation : PubnubCoreBase, IUnsubscribeOperation private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private readonly EndPoint.TokenManager pubnubTokenMgr; private string[] subscribeChannelNames; private string[] subscribeChannelGroupNames; private Dictionary queryParam; - public UnsubscribeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public UnsubscribeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; pubnubTokenMgr = tokenManager; } @@ -73,14 +71,14 @@ private void Unsubscribe(string[] channels, string[] channelGroups) #if NETFX_CORE || WINDOWS_UWP || UAP || NETSTANDARD10 || NETSTANDARD11 || NETSTANDARD12 Task.Factory.StartNew(() => { - SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelUnSubscribeInit(PNOperationType.PNUnsubscribeOperation, channel, channelGroup, this.queryParam); }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); #else new Thread(() => { - SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, pubnubTokenMgr, PubnubInstance); + SubscribeManager manager = new SubscribeManager(config, jsonLibrary, unit, pubnubLog, pubnubTokenMgr, PubnubInstance); manager.CurrentPubnubInstance(PubnubInstance); manager.MultiChannelUnSubscribeInit(PNOperationType.PNUnsubscribeOperation, channel, channelGroup, this.queryParam); }) diff --git a/src/Api/PubnubApi/EndPoint/Push/AddPushChannelOperation.cs b/src/Api/PubnubApi/EndPoint/Push/AddPushChannelOperation.cs index 3c3f2a2c8..698471a9e 100644 --- a/src/Api/PubnubApi/EndPoint/Push/AddPushChannelOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Push/AddPushChannelOperation.cs @@ -16,7 +16,6 @@ public class AddPushChannelOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNPushType pubnubPushType; private string[] channelNames; @@ -26,13 +25,12 @@ public class AddPushChannelOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public AddPushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public AddPushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -160,7 +158,7 @@ internal void RegisterDevice(string[] channels, PNPushType pushType, string push string channel = string.Join(",", channels.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRegisterDevicePushRequest("GET", "", channel, pushType, pushToken, environment, deviceTopic, externalQueryParam); @@ -202,7 +200,7 @@ internal async Task> RegisterDevice(string[] ch string channel = string.Join(",", channels.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRegisterDevicePushRequest("GET", "", channel, pushType, pushToken, environment, deviceTopic, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Push/AuditPushChannelOperation.cs b/src/Api/PubnubApi/EndPoint/Push/AuditPushChannelOperation.cs index 4b23a95cf..aab3a94f3 100644 --- a/src/Api/PubnubApi/EndPoint/Push/AuditPushChannelOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Push/AuditPushChannelOperation.cs @@ -15,7 +15,6 @@ public class AuditPushChannelOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNPushType pubnubPushType; private string deviceTokenId = ""; @@ -24,13 +23,12 @@ public class AuditPushChannelOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public AuditPushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public AuditPushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public AuditPushChannelOperation PushType(PNPushType pushType) @@ -130,7 +128,7 @@ internal void GetChannelsForDevice(PNPushType pushType, string pushToken, PushEn throw new ArgumentException("Missing Topic"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetChannelsPushRequest("GET", "", pushType, pushToken, environment, deviceTopic, externalQueryParam); @@ -164,7 +162,7 @@ internal async Task> GetChannelsForDevice(P } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildGetChannelsPushRequest("GET", "", pushType, pushToken, environment, deviceTopic, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Push/RemoveAllPushChannelsOperation.cs b/src/Api/PubnubApi/EndPoint/Push/RemoveAllPushChannelsOperation.cs index dd90ab6ee..b4436153f 100644 --- a/src/Api/PubnubApi/EndPoint/Push/RemoveAllPushChannelsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Push/RemoveAllPushChannelsOperation.cs @@ -15,7 +15,6 @@ public class RemoveAllPushChannelsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNPushType pubnubPushType; private string deviceTokenId = ""; @@ -24,13 +23,12 @@ public class RemoveAllPushChannelsOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemoveAllPushChannelsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemoveAllPushChannelsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public RemoveAllPushChannelsOperation PushType(PNPushType pushType) @@ -130,7 +128,7 @@ internal void RemoveAllChannelsForDevice(PNPushType pushType, string pushToken, throw new ArgumentException("Missing Topic"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildUnregisterDevicePushRequest("GET", "", pushType, pushToken, environment, deviceTopic, externalQueryParam); @@ -164,7 +162,7 @@ internal async Task> RemoveAllChannelsFo } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildUnregisterDevicePushRequest("GET", "", pushType, pushToken, environment, deviceTopic, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/Push/RemovePushChannelOperation.cs b/src/Api/PubnubApi/EndPoint/Push/RemovePushChannelOperation.cs index a95e65653..2ee8f2185 100644 --- a/src/Api/PubnubApi/EndPoint/Push/RemovePushChannelOperation.cs +++ b/src/Api/PubnubApi/EndPoint/Push/RemovePushChannelOperation.cs @@ -16,7 +16,6 @@ public class RemovePushChannelOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private PNPushType pubnubPushType; private string[] channelNames; @@ -26,13 +25,12 @@ public class RemovePushChannelOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public RemovePushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public RemovePushChannelOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -160,7 +158,7 @@ internal void RemoveChannelForDevice(string[] channels, PNPushType pushType, str string channel = string.Join(",", channels.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveChannelPushRequest("GET", "", channel, pushType, pushToken, environment, deviceTopic, externalQueryParam); @@ -202,7 +200,7 @@ internal async Task> RemoveChannelForDevice( string channel = string.Join(",", channels.OrderBy(x => x).ToArray()); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildRemoveChannelPushRequest("GET", "", channel, pushType, pushToken, environment, deviceTopic, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/StoragePlayback/DeleteMessageOperation.cs b/src/Api/PubnubApi/EndPoint/StoragePlayback/DeleteMessageOperation.cs index 411892f2f..ab9cf4a72 100644 --- a/src/Api/PubnubApi/EndPoint/StoragePlayback/DeleteMessageOperation.cs +++ b/src/Api/PubnubApi/EndPoint/StoragePlayback/DeleteMessageOperation.cs @@ -17,7 +17,6 @@ public class DeleteMessageOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private long startTimetoken = -1; private long endTimetoken = -1; @@ -26,13 +25,12 @@ public class DeleteMessageOperation : PubnubCoreBase private PNCallback savedCallback; private Dictionary queryParam; - public DeleteMessageOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public DeleteMessageOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -137,7 +135,7 @@ internal void DeleteMessage(string channel, long start, long end, Dictionary> DeleteMessage(string channe } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildDeleteMessageRequest("DELETE", "", channel, start, end, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/StoragePlayback/FetchHistoryOperation.cs b/src/Api/PubnubApi/EndPoint/StoragePlayback/FetchHistoryOperation.cs index 6a7f9c072..29a992ebd 100644 --- a/src/Api/PubnubApi/EndPoint/StoragePlayback/FetchHistoryOperation.cs +++ b/src/Api/PubnubApi/EndPoint/StoragePlayback/FetchHistoryOperation.cs @@ -17,7 +17,6 @@ public class FetchHistoryOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private bool reverseOption; private bool withMetaOption; @@ -32,13 +31,12 @@ public class FetchHistoryOperation : PubnubCoreBase private string[] channelNames; private PNCallback savedCallback; - public FetchHistoryOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public FetchHistoryOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -194,7 +192,7 @@ internal void History(PNCallback callback) } string channel = string.Join(",", this.channelNames); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildFetchRequest("GET", "", this.channelNames, this.startTimetoken, this.endTimetoken, this.perChannelCount, this.reverseOption, this.withMetaOption, this.withMessageActionsOption, this.withUuidOption, this.includeMessageType, this.queryParam); @@ -225,7 +223,7 @@ internal async Task> History() PNResult ret = new PNResult(); string channel = string.Join(",", this.channelNames); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildFetchRequest("GET", "", this.channelNames, this.startTimetoken, this.endTimetoken, this.perChannelCount, this.reverseOption, this.withMetaOption, this.withMessageActionsOption, this.withUuidOption, this.includeMessageType, this.queryParam); diff --git a/src/Api/PubnubApi/EndPoint/StoragePlayback/HistoryOperation.cs b/src/Api/PubnubApi/EndPoint/StoragePlayback/HistoryOperation.cs index 871d56f71..d6258af28 100644 --- a/src/Api/PubnubApi/EndPoint/StoragePlayback/HistoryOperation.cs +++ b/src/Api/PubnubApi/EndPoint/StoragePlayback/HistoryOperation.cs @@ -17,7 +17,6 @@ public class HistoryOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private bool reverseOption; private bool includeTimetokenOption; @@ -30,13 +29,12 @@ public class HistoryOperation : PubnubCoreBase private string channelName = ""; private PNCallback savedCallback; - public HistoryOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public HistoryOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; PubnubInstance = instance; @@ -165,7 +163,7 @@ internal void History(PNCallback callback) throw new ArgumentException("Missing Channel"); } - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildHistoryRequest("GET", "", this.channelName, this.startTimetoken, this.endTimetoken, this.historyCount, this.reverseOption, this.includeTimetokenOption, this.withMetaOption, this.queryParam); @@ -196,7 +194,7 @@ internal async Task> History() PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildHistoryRequest("GET", "", this.channelName, this.startTimetoken, this.endTimetoken, this.historyCount, this.reverseOption, this.includeTimetokenOption, this.withMetaOption, this.queryParam); diff --git a/src/Api/PubnubApi/EndPoint/StoragePlayback/MessageCountsOperation.cs b/src/Api/PubnubApi/EndPoint/StoragePlayback/MessageCountsOperation.cs index a765608a3..b77f2c02d 100644 --- a/src/Api/PubnubApi/EndPoint/StoragePlayback/MessageCountsOperation.cs +++ b/src/Api/PubnubApi/EndPoint/StoragePlayback/MessageCountsOperation.cs @@ -17,7 +17,6 @@ public class MessageCountsOperation : PubnubCoreBase private readonly IJsonPluggableLibrary jsonLibrary; private readonly IPubnubUnitTest unit; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; private Dictionary queryParam; @@ -25,13 +24,12 @@ public class MessageCountsOperation : PubnubCoreBase private long[] msgCountArrayTimetoken; private PNCallback savedCallback; - public MessageCountsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, tokenManager, instance) + public MessageCountsOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, tokenManager, instance) { config = pubnubConfig; jsonLibrary = jsonPluggableLibrary; unit = pubnubUnit; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; } public MessageCountsOperation Channels(string[] channels) @@ -114,7 +112,7 @@ internal void MessageCounts(string[] channels, long[] timetokens, Dictionary> MessageCounts(string[] chann } PNResult ret = new PNResult(); - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri request = urlBuilder.BuildMessageCountsRequest("GET", "", channels, timetokens, externalQueryParam); diff --git a/src/Api/PubnubApi/EndPoint/TelemetryManager.cs b/src/Api/PubnubApi/EndPoint/TelemetryManager.cs deleted file mode 100644 index d5d510b16..000000000 --- a/src/Api/PubnubApi/EndPoint/TelemetryManager.cs +++ /dev/null @@ -1,315 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Globalization; -using System.Threading.Tasks; -#if !NET35 && !NET40 -using System.Collections.Concurrent; -#endif - -namespace PubnubApi.EndPoint -{ - public class TelemetryManager: IDisposable - { - private const int TELEMETRY_TIMER_IN_SEC = 60; - - private PNConfiguration pubnubConfig; - private IPubnubLog pubnubLog; - - private static ConcurrentDictionary> dicEndpointLatency - { - get; - set; - } = new ConcurrentDictionary>(); - - private System.Threading.Timer telemetryTimer { get; set; } - - public TelemetryManager(PNConfiguration config, IPubnubLog log) - { - this.pubnubConfig = config; - this.pubnubLog = log; - if (config != null && config.EnableTelemetry) - { - StartTelemetryTimer(); - } - } - - private void StartTelemetryTimer() - { - StopTelemetryTimer(); - telemetryTimer = new Timer(OnTelemetryIntervalTimeout, null, 0, TELEMETRY_TIMER_IN_SEC * 1000); - } - - private void OnTelemetryIntervalTimeout(System.Object telemetryState) - { - CleanupTelemetryData(); - } - - private void StopTelemetryTimer() - { - try - { - if (telemetryTimer != null) - { - telemetryTimer.Change(Timeout.Infinite, Timeout.Infinite); - telemetryTimer.Dispose(); - } - } - catch { /* Ignore exception caused by dispose */ } - finally { telemetryTimer = null; } - } - - private static string EndpointNameForOperation(PNOperationType type) - { - string endpoint = ""; - switch (type) - { - case PNOperationType.PNPublishOperation: - endpoint = "l_pub"; - break; - case PNOperationType.PNHistoryOperation: - case PNOperationType.PNFetchHistoryOperation: - case PNOperationType.PNFireOperation: - case PNOperationType.PNDeleteMessageOperation: - endpoint = "l_hist"; - break; - case PNOperationType.PNUnsubscribeOperation: - case PNOperationType.PNWhereNowOperation: - case PNOperationType.PNHereNowOperation: - case PNOperationType.PNHeartbeatOperation: - case PNOperationType.PNSetStateOperation: - case PNOperationType.PNGetStateOperation: - endpoint = "l_pres"; - break; - case PNOperationType.PNAddChannelsToGroupOperation: - case PNOperationType.PNRemoveChannelsFromGroupOperation: - case PNOperationType.PNChannelGroupsOperation: - case PNOperationType.PNRemoveGroupOperation: - case PNOperationType.PNChannelsForGroupOperation: - endpoint = "l_cg"; - break; - case PNOperationType.PushGet: - case PNOperationType.PushRegister: - case PNOperationType.PushRemove: - case PNOperationType.PushUnregister: - endpoint = "l_push"; - break; - case PNOperationType.PNAccessManagerGrantToken: - case PNOperationType.PNAccessManagerRevokeToken: - endpoint = "l_pamv3"; - break; - case PNOperationType.PNAccessManagerAudit: - case PNOperationType.PNAccessManagerGrant: - endpoint = "l_pam"; - break; - case PNOperationType.PNTimeOperation: - endpoint = "l_time"; - break; - case PNOperationType.PNMessageCountsOperation: - endpoint = "l_mc"; - break; - case PNOperationType.PNSignalOperation: - endpoint = "l_sig"; - break; - case PNOperationType.PNSetUuidMetadataOperation: - case PNOperationType.PNDeleteUuidMetadataOperation: - case PNOperationType.PNGetAllUuidMetadataOperation: - case PNOperationType.PNGetUuidMetadataOperation: - case PNOperationType.PNSetChannelMetadataOperation: - case PNOperationType.PNDeleteChannelMetadataOperation: - case PNOperationType.PNGetAllChannelMetadataOperation: - case PNOperationType.PNGetChannelMetadataOperation: - case PNOperationType.PNGetMembershipsOperation: - case PNOperationType.PNManageMembershipsOperation: - case PNOperationType.PNSetMembershipsOperation: - case PNOperationType.PNRemoveMembershipsOperation: - case PNOperationType.PNGetChannelMembersOperation: - case PNOperationType.PNManageChannelMembersOperation: - case PNOperationType.PNSetChannelMembersOperation: - case PNOperationType.PNRemoveChannelMembersOperation: - endpoint = "l_obj"; - break; - case PNOperationType.PNAddMessageActionOperation: - case PNOperationType.PNRemoveMessageActionOperation: - case PNOperationType.PNGetMessageActionsOperation: - endpoint = "l_msga"; - break; - case PNOperationType.PNGenerateFileUploadUrlOperation: - case PNOperationType.PNPublishFileMessageOperation: - case PNOperationType.PNDownloadFileOperation: - endpoint = "l_file"; - break; - default: - endpoint = ""; - break; - } - - return endpoint; - } - - private static readonly object operationLatencyDataLock = new object(); - public async Task StoreLatency(long latencyMillisec, PNOperationType type) - { - await Task.Factory.StartNew(() => - { - try - { - string latencyEndPoint = EndpointNameForOperation(type); - if (latencyMillisec > 0 && !string.IsNullOrEmpty(latencyEndPoint)) - { - if (dicEndpointLatency == null) - { - dicEndpointLatency = new ConcurrentDictionary>(); - } - - double epochMillisec = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds; - if (dicEndpointLatency.ContainsKey(latencyEndPoint) && dicEndpointLatency[latencyEndPoint] != null && dicEndpointLatency[latencyEndPoint].Keys.Count > 0) - { - if (epochMillisec - dicEndpointLatency[latencyEndPoint].Keys.Max() > 500) - { - lock (operationLatencyDataLock) - { - dicEndpointLatency[latencyEndPoint].AddOrUpdate(epochMillisec, latencyMillisec, (key, oldValue) => latencyMillisec); - } - } - } - else - { - lock (operationLatencyDataLock) - { - ConcurrentDictionary elapsedInfo = new ConcurrentDictionary(); - elapsedInfo.AddOrUpdate(epochMillisec, latencyMillisec, (o, n) => latencyMillisec); - dicEndpointLatency.AddOrUpdate(latencyEndPoint, elapsedInfo, (o, n) => elapsedInfo); - } - } - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - StoreLatency {1} latency = {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), type, latencyMillisec), pubnubConfig.LogVerbosity); - } - } - catch (Exception ex) - { - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - StoreLatency error: {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), ex), pubnubConfig.LogVerbosity); - } - }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); - } - - public async Task> GetOperationsLatency() - { - return await Task>.Factory.StartNew(() => - { - Dictionary dictionaryOpsLatency = new Dictionary(); - try - { - lock (operationLatencyDataLock) - { - if (dicEndpointLatency != null) - { - foreach (string key in dicEndpointLatency.Keys) - { - if (dicEndpointLatency[key] != null && dicEndpointLatency[key].Count > 0) - { - - dictionaryOpsLatency.Add(key, Math.Round(((double)dicEndpointLatency[key].Average(kvp => kvp.Value) / 1000.0), 10).ToString(CultureInfo.InvariantCulture)); //Convert millisec to sec - } - } - } - } - } - catch (Exception ex) - { - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - GetOperationsLatency error: {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), ex), pubnubConfig.LogVerbosity); - } - return dictionaryOpsLatency; - }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).ConfigureAwait(false); - } - - private void CleanupTelemetryData() - { - Task.Factory.StartNew(() => - { - lock (operationLatencyDataLock) - { - try - { - double currentEpochMillisec = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds; - string[] latencyOpKeys = (dicEndpointLatency != null) ? dicEndpointLatency.Keys.ToArray() : new string[]{ }; - for (int keyIndex = 0; keyIndex < latencyOpKeys.Length; keyIndex++) - { - string opKey = latencyOpKeys[keyIndex]; - ConcurrentDictionary outdatedLatencyValue = null; - dicEndpointLatency.TryGetValue(opKey, out outdatedLatencyValue); - if (outdatedLatencyValue != null) - { - IEnumerable> enumerableOutdatedLatencies = outdatedLatencyValue.Where(dt => currentEpochMillisec - dt.Key >= 60000); - if (enumerableOutdatedLatencies != null) - { - Dictionary dicOutdatedLatencies = enumerableOutdatedLatencies.ToDictionary(item => item.Key, item => item.Value); - if (dicOutdatedLatencies != null && dicOutdatedLatencies.Count > 0) - { - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - CleanupTelemetryData => {1} dicOutdatedLatencies count = {2}", DateTime.Now.ToString(CultureInfo.InvariantCulture), opKey, dicOutdatedLatencies.Count), pubnubConfig.LogVerbosity); - double[] outLatencyKeys = dicOutdatedLatencies.Keys.ToArray(); - for (int outdateIndex = 0; outdateIndex < outLatencyKeys.Length; outdateIndex++) - { - double outKey = outLatencyKeys[outdateIndex]; - ConcurrentDictionary currentEndPointLatency = null; - dicEndpointLatency.TryGetValue(opKey, out currentEndPointLatency); - if (currentEndPointLatency != null && currentEndPointLatency.ContainsKey(outKey)) - { - long removeOutdatedLatency; - if (!currentEndPointLatency.TryRemove(outKey, out removeOutdatedLatency)) - { - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - CleanupTelemetryData => removed failed for key = {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), outKey), pubnubConfig.LogVerbosity); - } - } - } - } - } - } - } - } - catch (Exception ex) - { - LoggingMethod.WriteToLog(pubnubLog, string.Format(CultureInfo.InvariantCulture, "DateTime {0}, TelemetryManager - CleanupTelemetryData => Exception = {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), ex), pubnubConfig.LogVerbosity); - } - } - }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); - - } - - public void Destroy() - { - StopTelemetryTimer(); - dicEndpointLatency.Clear(); - dicEndpointLatency = null; - pubnubConfig = null; - pubnubLog = null; - } - - #region IDisposable Support - private bool disposedValue; - - protected virtual void DisposeInternal(bool disposing) - { - if (!disposedValue) - { - dicEndpointLatency.Clear(); - pubnubConfig = null; - pubnubLog = null; - if (telemetryTimer != null) - { - telemetryTimer.Dispose(); - telemetryTimer = null; - } - - disposedValue = true; - } - } - - void IDisposable.Dispose() - { - DisposeInternal(true); - } - #endregion - } -} - diff --git a/src/Api/PubnubApi/EndPoint/TimeOperation.cs b/src/Api/PubnubApi/EndPoint/TimeOperation.cs index a2a9f5dea..ddc682380 100644 --- a/src/Api/PubnubApi/EndPoint/TimeOperation.cs +++ b/src/Api/PubnubApi/EndPoint/TimeOperation.cs @@ -11,41 +11,39 @@ namespace PubnubApi.EndPoint { - public class TimeOperation: PubnubCoreBase - { - private readonly PNConfiguration config; - private readonly IJsonPluggableLibrary jsonLibrary; - private readonly IPubnubUnitTest unit; - private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; - - private Dictionary queryParam; - - private PNCallback savedCallback; - - public TimeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, null, instance) - { - config = pubnubConfig; - jsonLibrary = jsonPluggableLibrary; - unit = pubnubUnit; - pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; - } - - public TimeOperation QueryParam(Dictionary customQueryParam) - { - this.queryParam = customQueryParam; - return this; - } - - [Obsolete("Async is deprecated, please use Execute instead.")] - public void Async(PNCallback callback) - { - Execute(callback); - } - - public void Execute(PNCallback callback) - { + public class TimeOperation : PubnubCoreBase + { + private readonly PNConfiguration config; + private readonly IJsonPluggableLibrary jsonLibrary; + private readonly IPubnubUnitTest unit; + private readonly IPubnubLog pubnubLog; + + private Dictionary queryParam; + + private PNCallback savedCallback; + + public TimeOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, null, instance) + { + config = pubnubConfig; + jsonLibrary = jsonPluggableLibrary; + unit = pubnubUnit; + pubnubLog = log; + } + + public TimeOperation QueryParam(Dictionary customQueryParam) + { + this.queryParam = customQueryParam; + return this; + } + + [Obsolete("Async is deprecated, please use Execute instead.")] + public void Async(PNCallback callback) + { + Execute(callback); + } + + public void Execute(PNCallback callback) + { #if NETFX_CORE || WINDOWS_UWP || UAP || NETSTANDARD10 || NETSTANDARD11 || NETSTANDARD12 Task.Factory.StartNew(() => { @@ -53,110 +51,98 @@ public void Execute(PNCallback callback) Time(this.queryParam, callback); }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); #else - new Thread(() => - { - this.savedCallback = callback; - Time(this.queryParam, callback); - }) - { IsBackground = true }.Start(); + new Thread(() => { + this.savedCallback = callback; + Time(this.queryParam, callback); + }) { IsBackground = true }.Start(); #endif - } + } - public async Task> ExecuteAsync() - { - return await Time(this.queryParam).ConfigureAwait(false); - } + public async Task> ExecuteAsync() + { + return await Time(this.queryParam).ConfigureAwait(false); + } - internal void Retry() - { + internal void Retry() + { #if NETFX_CORE || WINDOWS_UWP || UAP || NETSTANDARD10 || NETSTANDARD11 || NETSTANDARD12 Task.Factory.StartNew(() => { Time(this.queryParam, savedCallback); }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); #else - new Thread(() => - { - Time(this.queryParam, savedCallback); - }) - { IsBackground = true }.Start(); + new Thread(() => { + Time(this.queryParam, savedCallback); + }) { IsBackground = true }.Start(); #endif - } - - internal void Time(Dictionary externalQueryParam, PNCallback callback) - { - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - - Uri request = urlBuilder.BuildTimeRequest("GET", "", externalQueryParam); - - RequestState requestState = new RequestState(); - requestState.Channels = null; - requestState.ResponseType = PNOperationType.PNTimeOperation; - requestState.PubnubCallback = callback; - requestState.Reconnect = false; - requestState.EndPointOperation = this; - - UrlProcessRequest(request, requestState, false).ContinueWith(r => - { - string json = r.Result.Item1; - if (!string.IsNullOrEmpty(json)) - { - List result = ProcessJsonResponse(requestState, json); - ProcessResponseCallbacks(result, requestState); - } - }, TaskContinuationOptions.ExecuteSynchronously).Wait(); - } - - internal async Task> Time(Dictionary externalQueryParam) - { - PNResult ret = new PNResult(); - - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - - Uri request = urlBuilder.BuildTimeRequest("GET", "", externalQueryParam); - - RequestState requestState = new RequestState(); - requestState.Channels = null; - requestState.ResponseType = PNOperationType.PNTimeOperation; - requestState.Reconnect = false; - requestState.EndPointOperation = this; - - Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false); - ret.Status = JsonAndStatusTuple.Item2; - string json = JsonAndStatusTuple.Item1; - if (!string.IsNullOrEmpty(json)) - { - List resultList = ProcessJsonResponse(requestState, json); - if (resultList != null && resultList.Count > 0) - { - ResponseBuilder responseBuilder = new ResponseBuilder(config, jsonLibrary, pubnubLog); - PNTimeResult responseResult = responseBuilder.JsonToObject(resultList, true); - if (responseResult != null) - { - ret.Result = responseResult; - } - } - } - - return ret; - } - - internal void CurrentPubnubInstance(Pubnub instance) - { - PubnubInstance = instance; - - if (!ChannelRequest.ContainsKey(instance.InstanceId)) - { - ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); - } - if (!ChannelInternetStatus.ContainsKey(instance.InstanceId)) - { - ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); - } - if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId)) - { - ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); - } - } - } + } + + internal void Time(Dictionary externalQueryParam, PNCallback callback) + { + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + + Uri request = urlBuilder.BuildTimeRequest("GET", "", externalQueryParam); + + RequestState requestState = new RequestState(); + requestState.Channels = null; + requestState.ResponseType = PNOperationType.PNTimeOperation; + requestState.PubnubCallback = callback; + requestState.Reconnect = false; + requestState.EndPointOperation = this; + + UrlProcessRequest(request, requestState, false).ContinueWith(r => { + string json = r.Result.Item1; + if (!string.IsNullOrEmpty(json)) { + List result = ProcessJsonResponse(requestState, json); + ProcessResponseCallbacks(result, requestState); + } + }, TaskContinuationOptions.ExecuteSynchronously).Wait(); + } + + internal async Task> Time(Dictionary externalQueryParam) + { + PNResult ret = new PNResult(); + + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + + Uri request = urlBuilder.BuildTimeRequest("GET", "", externalQueryParam); + + RequestState requestState = new RequestState(); + requestState.Channels = null; + requestState.ResponseType = PNOperationType.PNTimeOperation; + requestState.Reconnect = false; + requestState.EndPointOperation = this; + + Tuple JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false); + ret.Status = JsonAndStatusTuple.Item2; + string json = JsonAndStatusTuple.Item1; + if (!string.IsNullOrEmpty(json)) { + List resultList = ProcessJsonResponse(requestState, json); + if (resultList != null && resultList.Count > 0) { + ResponseBuilder responseBuilder = new ResponseBuilder(config, jsonLibrary, pubnubLog); + PNTimeResult responseResult = responseBuilder.JsonToObject(resultList, true); + if (responseResult != null) { + ret.Result = responseResult; + } + } + } + + return ret; + } + + internal void CurrentPubnubInstance(Pubnub instance) + { + PubnubInstance = instance; + + if (!ChannelRequest.ContainsKey(instance.InstanceId)) { + ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); + } + if (!ChannelInternetStatus.ContainsKey(instance.InstanceId)) { + ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); + } + if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId)) { + ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary()); + } + } + } } diff --git a/src/Api/PubnubApi/EventEngine/Common/EventEmitter.cs b/src/Api/PubnubApi/EventEngine/Common/EventEmitter.cs index a56cfb132..3f142def4 100644 --- a/src/Api/PubnubApi/EventEngine/Common/EventEmitter.cs +++ b/src/Api/PubnubApi/EventEngine/Common/EventEmitter.cs @@ -253,7 +253,7 @@ public void EmitEvent(object e) if (fileObjDic != null && fileObjDic.ContainsKey("id") && fileObjDic.ContainsKey("name")) { fileMessage.File = new PNFile { Id = fileObjDic["id"].ToString(), Name = fileObjDic["name"].ToString() }; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(configuration, jsonLibrary, null, log, null, tokenManager, (instance != null) ? instance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(configuration, jsonLibrary, null, log, tokenManager, (instance != null) ? instance.InstanceId : ""); Uri fileUrlRequest = urlBuilder.BuildGetFileUrlOrDeleteReqest("GET", "", fileMessage.Channel, fileMessage.File.Id, fileMessage.File.Name, null, PNOperationType.PNGenerateFileUploadUrlOperation); fileMessage.File.Url = fileUrlRequest.ToString(); } diff --git a/src/Api/PubnubApi/EventEngine/Presence/PresenceEventEngineFactory.cs b/src/Api/PubnubApi/EventEngine/Presence/PresenceEventEngineFactory.cs index 53afdd87f..631729f3e 100644 --- a/src/Api/PubnubApi/EventEngine/Presence/PresenceEventEngineFactory.cs +++ b/src/Api/PubnubApi/EventEngine/Presence/PresenceEventEngineFactory.cs @@ -25,10 +25,10 @@ internal PresenceEventEngine GetEventEngine(string instanceId) } internal PresenceEventEngine InitializeEventEngine(string instanceId, - Pubnub pubnubInstance, IPubnubLog pubnubLog, TelemetryManager telemetryManager, TokenManager tokenManager) + Pubnub pubnubInstance, IPubnubLog pubnubLog, TokenManager tokenManager) { - HeartbeatOperation heartbeatOperation = new HeartbeatOperation(pubnubInstance.PNConfig, pubnubInstance.JsonPluggableLibrary, pubnubInstance.PubnubUnitTest, pubnubLog, telemetryManager, tokenManager, pubnubInstance); - LeaveOperation leaveOperation = new LeaveOperation(pubnubInstance.PNConfig, pubnubInstance.JsonPluggableLibrary, pubnubInstance.PubnubUnitTest, pubnubLog, telemetryManager, tokenManager, pubnubInstance); + HeartbeatOperation heartbeatOperation = new HeartbeatOperation(pubnubInstance.PNConfig, pubnubInstance.JsonPluggableLibrary, pubnubInstance.PubnubUnitTest, pubnubLog, tokenManager, pubnubInstance); + LeaveOperation leaveOperation = new LeaveOperation(pubnubInstance.PNConfig, pubnubInstance.JsonPluggableLibrary, pubnubInstance.PubnubUnitTest, pubnubLog, tokenManager, pubnubInstance); var presenceEventEngine = new PresenceEventEngine(pubnubInstance.PNConfig, heartbeatOperation, leaveOperation); if (engineInstances.TryAdd(instanceId, presenceEventEngine)) { return presenceEventEngine; diff --git a/src/Api/PubnubApi/Pubnub.cs b/src/Api/PubnubApi/Pubnub.cs index c0b88703b..52d7a3131 100644 --- a/src/Api/PubnubApi/Pubnub.cs +++ b/src/Api/PubnubApi/Pubnub.cs @@ -24,7 +24,6 @@ public class Pubnub private IPubnubUnitTest pubnubUnitTest; private IPubnubLog pubnubLog; private EndPoint.ListenerManager listenerManager; - private readonly EndPoint.TelemetryManager telemetryManager; private readonly EndPoint.TokenManager tokenManager; private object savedSubscribeOperation; private readonly string savedSdkVerion; @@ -71,9 +70,9 @@ public ISubscribeOperation Subscribe() if (pubnubConfig[InstanceId].EnableEventEngine) { if (pubnubConfig[InstanceId].PresenceInterval > 0) { - presenceOperation = new PresenceOperation(this, InstanceId, pubnubLog, pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null ,telemetryManager, tokenManager, pubnubUnitTest ,presenceEventengineFactory); + presenceOperation = new PresenceOperation(this, InstanceId, pubnubLog, pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null , tokenManager, pubnubUnitTest ,presenceEventengineFactory); } - EndPoint.SubscribeEndpoint subscribeOperation = new EndPoint.SubscribeEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this.subscribeEventEngineFactory, presenceOperation, InstanceId ,this); + EndPoint.SubscribeEndpoint subscribeOperation = new EndPoint.SubscribeEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this.subscribeEventEngineFactory, presenceOperation, InstanceId ,this); subscribeOperation.EventEmitter = this.eventEmitter; subscribeOperation.SubscribeListenerList = subscribeCallbackListenerList; savedSubscribeOperation = subscribeOperation; @@ -81,7 +80,7 @@ public ISubscribeOperation Subscribe() } else { - EndPoint.SubscribeOperation subscribeOperation = new EndPoint.SubscribeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.SubscribeOperation subscribeOperation = new EndPoint.SubscribeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); savedSubscribeOperation = subscribeOperation; return subscribeOperation; } @@ -91,12 +90,12 @@ public IUnsubscribeOperation Unsubscribe() { if (pubnubConfig[InstanceId].EnableEventEngine) { - EndPoint.UnsubscribeEndpoint unsubscribeOperation = new EndPoint.UnsubscribeEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, subscribeEventEngineFactory, presenceEventengineFactory, this); + EndPoint.UnsubscribeEndpoint unsubscribeOperation = new EndPoint.UnsubscribeEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, subscribeEventEngineFactory, presenceEventengineFactory, this); return unsubscribeOperation; } else { - EndPoint.UnsubscribeOperation unsubscribeOperation = new EndPoint.UnsubscribeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.UnsubscribeOperation unsubscribeOperation = new EndPoint.UnsubscribeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); unsubscribeOperation.CurrentPubnubInstance(this); return unsubscribeOperation; } @@ -106,256 +105,256 @@ public EndPoint.UnsubscribeAllOperation UnsubscribeAll() { if (pubnubConfig[InstanceId].EnableEventEngine) { - EndPoint.UnsubscribeAllEndpoint unsubscribeAllEndpoint = new EndPoint.UnsubscribeAllEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, subscribeEventEngineFactory, presenceEventengineFactory, this); + EndPoint.UnsubscribeAllEndpoint unsubscribeAllEndpoint = new EndPoint.UnsubscribeAllEndpoint(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, subscribeEventEngineFactory, presenceEventengineFactory, this); return unsubscribeAllEndpoint; } else { - EndPoint.UnsubscribeAllOperation unSubscribeAllOperation = new EndPoint.UnsubscribeAllOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.UnsubscribeAllOperation unSubscribeAllOperation = new EndPoint.UnsubscribeAllOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return unSubscribeAllOperation; } } public EndPoint.PublishOperation Publish() { - EndPoint.PublishOperation publishOperation = new EndPoint.PublishOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.PublishOperation publishOperation = new EndPoint.PublishOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); publishOperation.CurrentPubnubInstance(this); return publishOperation; } public EndPoint.FireOperation Fire() { - EndPoint.FireOperation fireOperation = new EndPoint.FireOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.FireOperation fireOperation = new EndPoint.FireOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); fireOperation.CurrentPubnubInstance(this); return fireOperation; } public EndPoint.SignalOperation Signal() { - EndPoint.SignalOperation signalOperation = new EndPoint.SignalOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SignalOperation signalOperation = new EndPoint.SignalOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return signalOperation; } public EndPoint.HistoryOperation History() { - EndPoint.HistoryOperation historyOperaton = new EndPoint.HistoryOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.HistoryOperation historyOperaton = new EndPoint.HistoryOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return historyOperaton; } public EndPoint.FetchHistoryOperation FetchHistory() { - EndPoint.FetchHistoryOperation historyOperaton = new EndPoint.FetchHistoryOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.FetchHistoryOperation historyOperaton = new EndPoint.FetchHistoryOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return historyOperaton; } public EndPoint.DeleteMessageOperation DeleteMessages() { - EndPoint.DeleteMessageOperation deleteMessageOperaton = new EndPoint.DeleteMessageOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.DeleteMessageOperation deleteMessageOperaton = new EndPoint.DeleteMessageOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return deleteMessageOperaton; } public EndPoint.MessageCountsOperation MessageCounts() { - EndPoint.MessageCountsOperation messageCount = new EndPoint.MessageCountsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.MessageCountsOperation messageCount = new EndPoint.MessageCountsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); messageCount.CurrentPubnubInstance(this); return messageCount; } public EndPoint.HereNowOperation HereNow() { - EndPoint.HereNowOperation hereNowOperation = new EndPoint.HereNowOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.HereNowOperation hereNowOperation = new EndPoint.HereNowOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); hereNowOperation.CurrentPubnubInstance(this); return hereNowOperation; } public EndPoint.WhereNowOperation WhereNow() { - EndPoint.WhereNowOperation whereNowOperation = new EndPoint.WhereNowOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.WhereNowOperation whereNowOperation = new EndPoint.WhereNowOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); whereNowOperation.CurrentPubnubInstance(this); return whereNowOperation; } public EndPoint.TimeOperation Time() { - EndPoint.TimeOperation timeOperation = new EndPoint.TimeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, this); + EndPoint.TimeOperation timeOperation = new EndPoint.TimeOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, this); timeOperation.CurrentPubnubInstance(this); return timeOperation; } public EndPoint.AuditOperation Audit() { - EndPoint.AuditOperation auditOperation = new EndPoint.AuditOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, this); + EndPoint.AuditOperation auditOperation = new EndPoint.AuditOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, this); auditOperation.CurrentPubnubInstance(this); return auditOperation; } public EndPoint.GrantTokenOperation GrantToken() { - EndPoint.GrantTokenOperation grantOperation = new EndPoint.GrantTokenOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GrantTokenOperation grantOperation = new EndPoint.GrantTokenOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return grantOperation; } public EndPoint.RevokeTokenOperation RevokeToken() { - EndPoint.RevokeTokenOperation revokeTokenOperation = new EndPoint.RevokeTokenOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RevokeTokenOperation revokeTokenOperation = new EndPoint.RevokeTokenOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return revokeTokenOperation; } public EndPoint.GrantOperation Grant() { - EndPoint.GrantOperation grantOperation = new EndPoint.GrantOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, this); + EndPoint.GrantOperation grantOperation = new EndPoint.GrantOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, this); grantOperation.CurrentPubnubInstance(this); return grantOperation; } public EndPoint.SetStateOperation SetPresenceState() { - EndPoint.SetStateOperation setStateOperation = new EndPoint.SetStateOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SetStateOperation setStateOperation = new EndPoint.SetStateOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return setStateOperation; } public EndPoint.GetStateOperation GetPresenceState() { - EndPoint.GetStateOperation getStateOperation = new EndPoint.GetStateOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetStateOperation getStateOperation = new EndPoint.GetStateOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); getStateOperation.CurrentPubnubInstance(this); return getStateOperation; } public EndPoint.AddPushChannelOperation AddPushNotificationsOnChannels() { - EndPoint.AddPushChannelOperation addPushChannelOperation = new EndPoint.AddPushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.AddPushChannelOperation addPushChannelOperation = new EndPoint.AddPushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return addPushChannelOperation; } public EndPoint.RemovePushChannelOperation RemovePushNotificationsFromChannels() { - EndPoint.RemovePushChannelOperation removePushChannelOperation = new EndPoint.RemovePushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemovePushChannelOperation removePushChannelOperation = new EndPoint.RemovePushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removePushChannelOperation; } public EndPoint.RemoveAllPushChannelsOperation RemoveAllPushNotificationsFromDeviceWithPushToken() { - EndPoint.RemoveAllPushChannelsOperation removeAllPushChannelsOperation = new EndPoint.RemoveAllPushChannelsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveAllPushChannelsOperation removeAllPushChannelsOperation = new EndPoint.RemoveAllPushChannelsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); removeAllPushChannelsOperation.CurrentPubnubInstance(this); return removeAllPushChannelsOperation; } public EndPoint.AuditPushChannelOperation AuditPushChannelProvisions() { - EndPoint.AuditPushChannelOperation auditPushChannelOperation = new EndPoint.AuditPushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.AuditPushChannelOperation auditPushChannelOperation = new EndPoint.AuditPushChannelOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); auditPushChannelOperation.CurrentPubnubInstance(this); return auditPushChannelOperation; } public EndPoint.SetUuidMetadataOperation SetUuidMetadata() { - EndPoint.SetUuidMetadataOperation setUuidMetadataOperation = new EndPoint.SetUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SetUuidMetadataOperation setUuidMetadataOperation = new EndPoint.SetUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return setUuidMetadataOperation; } public EndPoint.RemoveUuidMetadataOperation RemoveUuidMetadata() { - EndPoint.RemoveUuidMetadataOperation removeUuidMetadataOperation = new EndPoint.RemoveUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveUuidMetadataOperation removeUuidMetadataOperation = new EndPoint.RemoveUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removeUuidMetadataOperation; } public EndPoint.GetAllUuidMetadataOperation GetAllUuidMetadata() { - EndPoint.GetAllUuidMetadataOperation getAllUuidMetadataOperation = new EndPoint.GetAllUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetAllUuidMetadataOperation getAllUuidMetadataOperation = new EndPoint.GetAllUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getAllUuidMetadataOperation; } public EndPoint.GetUuidMetadataOperation GetUuidMetadata() { - EndPoint.GetUuidMetadataOperation getUuidMetadataOperation = new EndPoint.GetUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetUuidMetadataOperation getUuidMetadataOperation = new EndPoint.GetUuidMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getUuidMetadataOperation; } public EndPoint.SetChannelMetadataOperation SetChannelMetadata() { - EndPoint.SetChannelMetadataOperation setChannelMetadataOperation = new EndPoint.SetChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SetChannelMetadataOperation setChannelMetadataOperation = new EndPoint.SetChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return setChannelMetadataOperation; } public EndPoint.RemoveChannelMetadataOperation RemoveChannelMetadata() { - EndPoint.RemoveChannelMetadataOperation removeChannelMetadataOperation = new EndPoint.RemoveChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveChannelMetadataOperation removeChannelMetadataOperation = new EndPoint.RemoveChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removeChannelMetadataOperation; } public EndPoint.GetAllChannelMetadataOperation GetAllChannelMetadata() { - EndPoint.GetAllChannelMetadataOperation getAllChannelMetadataOperation = new EndPoint.GetAllChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetAllChannelMetadataOperation getAllChannelMetadataOperation = new EndPoint.GetAllChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getAllChannelMetadataOperation; } public EndPoint.GetChannelMetadataOperation GetChannelMetadata() { - EndPoint.GetChannelMetadataOperation getSingleSpaceOperation = new EndPoint.GetChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetChannelMetadataOperation getSingleSpaceOperation = new EndPoint.GetChannelMetadataOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getSingleSpaceOperation; } public EndPoint.GetMembershipsOperation GetMemberships() { - EndPoint.GetMembershipsOperation getMembershipOperation = new EndPoint.GetMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetMembershipsOperation getMembershipOperation = new EndPoint.GetMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getMembershipOperation; } public EndPoint.SetMembershipsOperation SetMemberships() { - EndPoint.SetMembershipsOperation setMembershipsOperation = new EndPoint.SetMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SetMembershipsOperation setMembershipsOperation = new EndPoint.SetMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return setMembershipsOperation; } public EndPoint.RemoveMembershipsOperation RemoveMemberships() { - EndPoint.RemoveMembershipsOperation removeMembershipsOperation = new EndPoint.RemoveMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveMembershipsOperation removeMembershipsOperation = new EndPoint.RemoveMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removeMembershipsOperation; } public EndPoint.ManageMembershipsOperation ManageMemberships() { - EndPoint.ManageMembershipsOperation manageMembershipsOperation = new EndPoint.ManageMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.ManageMembershipsOperation manageMembershipsOperation = new EndPoint.ManageMembershipsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return manageMembershipsOperation; } public EndPoint.GetChannelMembersOperation GetChannelMembers() { - EndPoint.GetChannelMembersOperation getChannelMembersOperation = new EndPoint.GetChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetChannelMembersOperation getChannelMembersOperation = new EndPoint.GetChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getChannelMembersOperation; } public EndPoint.SetChannelMembersOperation SetChannelMembers() { - EndPoint.SetChannelMembersOperation setChannelMembersOperation = new EndPoint.SetChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SetChannelMembersOperation setChannelMembersOperation = new EndPoint.SetChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return setChannelMembersOperation; } public EndPoint.RemoveChannelMembersOperation RemoveChannelMembers() { - EndPoint.RemoveChannelMembersOperation removeChannelMembersOperation = new EndPoint.RemoveChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveChannelMembersOperation removeChannelMembersOperation = new EndPoint.RemoveChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removeChannelMembersOperation; } public EndPoint.ManageChannelMembersOperation ManageChannelMembers() { - EndPoint.ManageChannelMembersOperation channelMembersOperation = new EndPoint.ManageChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.ManageChannelMembersOperation channelMembersOperation = new EndPoint.ManageChannelMembersOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return channelMembersOperation; } public EndPoint.AddMessageActionOperation AddMessageAction() { - EndPoint.AddMessageActionOperation addMessageActionOperation = new EndPoint.AddMessageActionOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.AddMessageActionOperation addMessageActionOperation = new EndPoint.AddMessageActionOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return addMessageActionOperation; } public EndPoint.RemoveMessageActionOperation RemoveMessageAction() { - EndPoint.RemoveMessageActionOperation removeMessageActionOperation = new EndPoint.RemoveMessageActionOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveMessageActionOperation removeMessageActionOperation = new EndPoint.RemoveMessageActionOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return removeMessageActionOperation; } public EndPoint.GetMessageActionsOperation GetMessageActions() { - EndPoint.GetMessageActionsOperation getMessageActionsOperation = new EndPoint.GetMessageActionsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetMessageActionsOperation getMessageActionsOperation = new EndPoint.GetMessageActionsOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getMessageActionsOperation; } @@ -365,35 +364,35 @@ public EndPoint.GetMessageActionsOperation GetMessageActions() public EndPoint.AddChannelsToChannelGroupOperation AddChannelsToChannelGroup() { - EndPoint.AddChannelsToChannelGroupOperation addChannelToChannelGroupOperation = new EndPoint.AddChannelsToChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.AddChannelsToChannelGroupOperation addChannelToChannelGroupOperation = new EndPoint.AddChannelsToChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); addChannelToChannelGroupOperation.CurrentPubnubInstance(this); return addChannelToChannelGroupOperation; } public EndPoint.RemoveChannelsFromChannelGroupOperation RemoveChannelsFromChannelGroup() { - EndPoint.RemoveChannelsFromChannelGroupOperation removeChannelsFromChannelGroupOperation = new EndPoint.RemoveChannelsFromChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.RemoveChannelsFromChannelGroupOperation removeChannelsFromChannelGroupOperation = new EndPoint.RemoveChannelsFromChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); removeChannelsFromChannelGroupOperation.CurrentPubnubInstance(this); return removeChannelsFromChannelGroupOperation; } public EndPoint.DeleteChannelGroupOperation DeleteChannelGroup() { - EndPoint.DeleteChannelGroupOperation deleteChannelGroupOperation = new EndPoint.DeleteChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.DeleteChannelGroupOperation deleteChannelGroupOperation = new EndPoint.DeleteChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); deleteChannelGroupOperation.CurrentPubnubInstance(this); return deleteChannelGroupOperation; } public EndPoint.ListChannelsForChannelGroupOperation ListChannelsForChannelGroup() { - EndPoint.ListChannelsForChannelGroupOperation listChannelsForChannelGroupOperation = new EndPoint.ListChannelsForChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.ListChannelsForChannelGroupOperation listChannelsForChannelGroupOperation = new EndPoint.ListChannelsForChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); listChannelsForChannelGroupOperation.CurrentPubnubInstance(this); return listChannelsForChannelGroupOperation; } public EndPoint.ListAllChannelGroupOperation ListChannelGroups() { - EndPoint.ListAllChannelGroupOperation listAllChannelGroupOperation = new EndPoint.ListAllChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.ListAllChannelGroupOperation listAllChannelGroupOperation = new EndPoint.ListAllChannelGroupOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); listAllChannelGroupOperation.CurrentPubnubInstance(this); return listAllChannelGroupOperation; } @@ -409,7 +408,7 @@ public bool AddListener(SubscribeCallback listener) { if (listenerManager == null) { - listenerManager = new EndPoint.ListenerManager(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + listenerManager = new EndPoint.ListenerManager(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); } return listenerManager.AddListener(listener); } @@ -428,44 +427,44 @@ public bool RemoveListener(SubscribeCallback listener) public EndPoint.SendFileOperation SendFile() { - EndPoint.SendFileOperation uploadFileOperation = new EndPoint.SendFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.SendFileOperation uploadFileOperation = new EndPoint.SendFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return uploadFileOperation; } public EndPoint.GetFileUrlOperation GetFileUrl() { - EndPoint.GetFileUrlOperation getFileUrlOperation = new EndPoint.GetFileUrlOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.GetFileUrlOperation getFileUrlOperation = new EndPoint.GetFileUrlOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return getFileUrlOperation; } public EndPoint.DownloadFileOperation DownloadFile() { - EndPoint.DownloadFileOperation downloadFileOperation = new EndPoint.DownloadFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.DownloadFileOperation downloadFileOperation = new EndPoint.DownloadFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return downloadFileOperation; } public EndPoint.ListFilesOperation ListFiles() { - EndPoint.ListFilesOperation listFilesOperation = new EndPoint.ListFilesOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.ListFilesOperation listFilesOperation = new EndPoint.ListFilesOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return listFilesOperation; } public EndPoint.DeleteFileOperation DeleteFile() { - EndPoint.DeleteFileOperation deleteFileOperation = new EndPoint.DeleteFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.DeleteFileOperation deleteFileOperation = new EndPoint.DeleteFileOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return deleteFileOperation; } public EndPoint.PublishFileMessageOperation PublishFileMessage() { - EndPoint.PublishFileMessageOperation publshFileMessageOperation = new EndPoint.PublishFileMessageOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.PublishFileMessageOperation publshFileMessageOperation = new EndPoint.PublishFileMessageOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); return publshFileMessageOperation; } #region "PubNub API Other Methods" public void TerminateCurrentSubscriberRequest() { - EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endpoint.CurrentPubnubInstance(this); endpoint.TerminateCurrentSubscriberRequest(); } @@ -501,7 +500,7 @@ public void ChangeUserId(UserId newUserId) } throw new MissingMemberException("UserId cannot be null/empty"); } - EndPoint.OtherOperation endPoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.OtherOperation endPoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endPoint.CurrentPubnubInstance(this); endPoint.ChangeUserId(newUserId); } @@ -523,21 +522,21 @@ public static DateTime TranslatePubnubUnixNanoSecondsToDateTime(string unixNanoS public UserId GetCurrentUserId() { - EndPoint.OtherOperation endPoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this); + EndPoint.OtherOperation endPoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endPoint.CurrentPubnubInstance(this); return endPoint.GetCurrentUserId(); } public List GetSubscribedChannels() { - EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endpoint.CurrentPubnubInstance(this); return endpoint.GetSubscribedChannels(); } public List GetSubscribedChannelGroups() { - EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endpoint.CurrentPubnubInstance(this); return endpoint.GetSubscribedChannelGroups(); } @@ -545,7 +544,7 @@ public List GetSubscribedChannelGroups() public void Destroy() { savedSubscribeOperation = null; - EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, null, tokenManager, this); + EndPoint.OtherOperation endpoint = new EndPoint.OtherOperation(pubnubConfig.ContainsKey(InstanceId) ? pubnubConfig[InstanceId] : null, JsonPluggableLibrary, pubnubUnitTest, pubnubLog, tokenManager, this); endpoint.CurrentPubnubInstance(this); endpoint.EndPendingRequests(); } @@ -1002,10 +1001,6 @@ public Pubnub(PNConfiguration config) PNPlatform.Print(config, pubnubLog); } - if (config.EnableTelemetry) - { - telemetryManager = new EndPoint.TelemetryManager(pubnubConfig[InstanceId], pubnubLog); - } CheckAndInitializeEmptyStringValues(config); tokenManager = new EndPoint.TokenManager(pubnubConfig[InstanceId], JsonPluggableLibrary, pubnubLog, this.InstanceId); diff --git a/src/Api/PubnubApi/PubnubCoreBase.cs b/src/Api/PubnubApi/PubnubCoreBase.cs index 625cc4369..d837a4e93 100644 --- a/src/Api/PubnubApi/PubnubCoreBase.cs +++ b/src/Api/PubnubApi/PubnubCoreBase.cs @@ -46,7 +46,6 @@ public abstract class PubnubCoreBase private static IJsonPluggableLibrary jsonLib; private static IPubnubUnitTest unitTest; private static ConcurrentDictionary pubnubLog { get; } = new ConcurrentDictionary(); - private static EndPoint.TelemetryManager pubnubTelemetryMgr; protected static ConcurrentDictionary PubnubTokenMgrCollection { get; } = new ConcurrentDictionary(); private static EndPoint.DuplicationManager pubnubSubscribeDuplicationManager { get; set; } #if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10 @@ -149,7 +148,7 @@ protected static ConcurrentDictionary SubscribeRequestTracker set; } = new ConcurrentDictionary(); - protected PubnubCoreBase(PNConfiguration pubnubConfiguation, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) + protected PubnubCoreBase(PNConfiguration pubnubConfiguation, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) { if (pubnubConfiguation == null) { @@ -158,15 +157,15 @@ protected PubnubCoreBase(PNConfiguration pubnubConfiguation, IJsonPluggableLibra if (jsonPluggableLibrary == null) { - InternalConstructor(pubnubConfiguation, new NewtonsoftJsonDotNet(pubnubConfiguation,log), pubnubUnitTest, log, telemetryManager, tokenManager, instance); + InternalConstructor(pubnubConfiguation, new NewtonsoftJsonDotNet(pubnubConfiguation,log), pubnubUnitTest, log, tokenManager, instance); } else { - InternalConstructor(pubnubConfiguation, jsonPluggableLibrary, pubnubUnitTest, log, telemetryManager, tokenManager, instance); + InternalConstructor(pubnubConfiguation, jsonPluggableLibrary, pubnubUnitTest, log, tokenManager, instance); } } - private void InternalConstructor(PNConfiguration pubnubConfiguation, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, EndPoint.TokenManager tokenManager, Pubnub instance) + private void InternalConstructor(PNConfiguration pubnubConfiguation, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnitTest, IPubnubLog log, EndPoint.TokenManager tokenManager, Pubnub instance) { PubnubInstance = instance; pubnubConfig.AddOrUpdate(instance.InstanceId, pubnubConfiguation, (k,o)=> pubnubConfiguation); @@ -174,7 +173,6 @@ private void InternalConstructor(PNConfiguration pubnubConfiguation, IJsonPlugga unitTest = pubnubUnitTest; pubnubLog.AddOrUpdate(instance.InstanceId, log, (k, o) => log); PubnubTokenMgrCollection.AddOrUpdate(instance.InstanceId, tokenManager, (k,o)=> tokenManager); - pubnubTelemetryMgr = telemetryManager; pubnubSubscribeDuplicationManager = new EndPoint.DuplicationManager(pubnubConfiguation, jsonPluggableLibrary, log); CurrentUserId.AddOrUpdate(instance.InstanceId, pubnubConfiguation.UserId, (k,o) => pubnubConfiguation.UserId); @@ -222,9 +220,9 @@ private void InternalConstructor(PNConfiguration pubnubConfiguation, IJsonPlugga httpClientNonsubscribe.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); httpClientNonsubscribe.Timeout = TimeSpan.FromSeconds(pubnubConfiguation.NonSubscribeRequestTimeout); } - pubnubHttp = new PubnubHttp(pubnubConfiguation, jsonLib, log, pubnubTelemetryMgr, httpClientSubscribe, httpClientNonsubscribe); + pubnubHttp = new PubnubHttp(pubnubConfiguation, jsonLib, log, httpClientSubscribe, httpClientNonsubscribe); #else - pubnubHttp = new PubnubHttp(pubnubConfiguation, jsonLib, log, pubnubTelemetryMgr); + pubnubHttp = new PubnubHttp(pubnubConfiguation, jsonLib, log); #endif @@ -836,7 +834,7 @@ private void ResponseToUserCallback(List result, PNOperationType type if (fileObjDic != null && fileObjDic.ContainsKey("id") && fileObjDic.ContainsKey("name")) { fileMessage.File = new PNFile { Id = fileObjDic["id"].ToString(), Name = fileObjDic["name"].ToString() }; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(currentConfig, jsonLib, unitTest, currentLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(currentConfig, jsonLib, unitTest, currentLog, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); Uri fileUrlRequest = urlBuilder.BuildGetFileUrlOrDeleteReqest("GET", "", fileMessage.Channel, fileMessage.File.Id, fileMessage.File.Name, null, type); fileMessage.File.Url = fileUrlRequest.ToString(); } @@ -2109,14 +2107,6 @@ protected static void TerminatePresenceHeartbeatTimer() } } - protected static void TerminateTelemetry() - { - if (pubnubTelemetryMgr != null) - { - pubnubTelemetryMgr.Destroy(); - } - } - protected void TerminateTokenManagerCollection() { if (PubnubTokenMgrCollection != null && PubnubTokenMgrCollection.Count > 0) @@ -2310,7 +2300,6 @@ internal void EndPendingRequests() TerminateReconnectTimer(); RemoveUserState(); PubnubCoreBase.TerminatePresenceHeartbeatTimer(); - TerminateTelemetry(); TerminateDedupeManager(); TerminateTokenManagerCollection(); diff --git a/src/Api/PubnubApi/PubnubHttp.cs b/src/Api/PubnubApi/PubnubHttp.cs index 818e23166..407e33314 100644 --- a/src/Api/PubnubApi/PubnubHttp.cs +++ b/src/Api/PubnubApi/PubnubHttp.cs @@ -20,22 +20,20 @@ public class PubnubHttp : IPubnubHttp private readonly PNConfiguration pubnubConfig; private readonly IJsonPluggableLibrary jsonLib; private readonly IPubnubLog pubnubLog; - private readonly EndPoint.TelemetryManager pubnubTelemetryMgr; #if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10 private static HttpClient httpClientSubscribe; private static HttpClient httpClientNonsubscribe; #endif #if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10 - public PubnubHttp(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, HttpClient refHttpClientSubscribe, HttpClient refHttpClientNonsubscribe) + public PubnubHttp(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubLog log, HttpClient refHttpClientSubscribe, HttpClient refHttpClientNonsubscribe) #else - public PubnubHttp(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubLog log, EndPoint.TelemetryManager telemetryManager) + public PubnubHttp(PNConfiguration config, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubLog log) #endif { pubnubConfig = config; jsonLib = jsonPluggableLibrary; pubnubLog = log; - pubnubTelemetryMgr = telemetryManager; #if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10 httpClientSubscribe = refHttpClientSubscribe; httpClientNonsubscribe = refHttpClientNonsubscribe; @@ -227,10 +225,6 @@ async Task SendRequestAndGetJsonResponseHttpClient(Uri requestUri, Re { var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType); - } using (StreamReader streamReader = new StreamReader(stream)) { jsonString = await streamReader.ReadToEndAsync().ConfigureAwait(false); @@ -307,10 +301,6 @@ async Task SendRequestAndGetStreamResponseHttpClient(Uri requestUri, { var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType); - } using (MemoryStream ms = new MemoryStream()) { stream.CopyTo(ms); @@ -402,10 +392,6 @@ async Task SendRequestAndGetJsonResponseHttpClientWithPOST(Uri reques if (response.IsSuccessStatusCode || response.Content != null) { stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Got POST HttpResponseMessage for {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), requestUri)); if ((int)response.StatusCode == 204 && pubnubRequestState.ResponseType == PNOperationType.PNFileUploadOperation) { @@ -514,10 +500,6 @@ async Task SendRequestAndGetJsonResponseHttpClientWithPATCH(Uri reque { var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } using (StreamReader streamReader = new StreamReader(stream)) { jsonString = await streamReader.ReadToEndAsync().ConfigureAwait(false); @@ -591,10 +573,6 @@ async Task SendRequestAndGetJsonResponseTaskFactory(RequestState p var _ = new Timer(OnPubnubWebRequestTimeout, pubnubRequestState, GetTimeoutInSecondsForResponseType(pubnubRequestState.ResponseType) * 1000, Timeout.Infinite); response = await Task.Factory.FromAsync(request.BeginGetResponse, asyncPubnubResult => (HttpWebResponse)request.EndGetResponse(asyncPubnubResult), pubnubRequestState).ConfigureAwait(false); stopWatch.Stop(); - if (pubnubConfig.EnableTelemetry && pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } if (response != null) { pubnubRequestState.Response = response; @@ -675,10 +653,6 @@ async Task SendRequestAndGetStreamResponseTaskFactory(RequestState stopWatch.Start(); response = await Task.Factory.FromAsync(request.BeginGetResponse, asyncPubnubResult => (HttpWebResponse)request.EndGetResponse(asyncPubnubResult), pubnubRequestState).ConfigureAwait(false); stopWatch.Stop(); - if (pubnubConfig.EnableTelemetry && pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } pubnubRequestState.Response = response; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Got PubnubWebResponse for {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), request.RequestUri.ToString())); int statusCode = (int)pubnubRequestState.Response.StatusCode; @@ -766,10 +740,6 @@ async Task SendRequestAndGetJsonResponseTaskFactoryWithPOST(RequestSt WebResponse response = await Task.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, pubnubRequestState).ConfigureAwait(false); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } pubnubRequestState.Response = response as HttpWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Got PubnubWebResponse With POST for {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), request.RequestUri.ToString())); int statusCode = (int)pubnubRequestState.Response.StatusCode; @@ -867,10 +837,6 @@ async Task SendRequestAndGetJsonResponseTaskFactoryWithPATCH(RequestS WebResponse response = await Task.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, pubnubRequestState).ConfigureAwait(false); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } pubnubRequestState.Response = response as HttpWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Got PubnubWebResponse With PATCH for {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), request.RequestUri.ToString())); using (StreamReader streamReader = new StreamReader(response.GetResponseStream())) @@ -950,10 +916,6 @@ async Task SendRequestAndGetJsonResponseClassicHttp(Uri requestUri, R System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Before EndGetResponse", DateTime.Now.ToString(CultureInfo.InvariantCulture))); HttpWebResponse asyncWebResponse = (HttpWebResponse)asyncWebRequest.EndGetResponse(asynchronousResult); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } asyncRequestState.Response = asyncWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, After EndGetResponse", DateTime.Now.ToString(CultureInfo.InvariantCulture))); using (StreamReader streamReader = new StreamReader(asyncWebResponse.GetResponseStream())) @@ -1037,10 +999,6 @@ async Task SendRequestAndGetStreamResponseClassicHttp(RequestState System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Before EndGetResponse", DateTime.Now.ToString(CultureInfo.InvariantCulture))); HttpWebResponse asyncWebResponse = (HttpWebResponse)asyncWebRequest.EndGetResponse(asynchronousResult); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } asyncRequestState.Response = asyncWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, After EndGetResponse", DateTime.Now.ToString(CultureInfo.InvariantCulture))); using (StreamReader streamReader = new StreamReader(asyncWebResponse.GetResponseStream())) @@ -1139,10 +1097,6 @@ async Task SendRequestAndGetJsonResponseClassicHttpWithPOST(RequestSt System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Before EndGetResponse With POST ", DateTime.Now.ToString(CultureInfo.InvariantCulture))); HttpWebResponse asyncWebResponse = (HttpWebResponse)asyncWebRequest.EndGetResponse(asynchronousResult); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } asyncRequestState.Response = asyncWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, After EndGetResponse With POST ", DateTime.Now.ToString(CultureInfo.InvariantCulture))); using (StreamReader streamReader = new StreamReader(asyncWebResponse.GetResponseStream())) @@ -1242,10 +1196,6 @@ async Task SendRequestAndGetJsonResponseClassicHttpWithPATCH(RequestS System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, Before EndGetResponse With PATCH ", DateTime.Now.ToString(CultureInfo.InvariantCulture))); HttpWebResponse asyncWebResponse = (HttpWebResponse)asyncWebRequest.EndGetResponse(asynchronousResult); stopWatch.Stop(); - if (pubnubTelemetryMgr != null) - { - await pubnubTelemetryMgr.StoreLatency(stopWatch.ElapsedMilliseconds, pubnubRequestState.ResponseType).ConfigureAwait(false); - } asyncRequestState.Response = asyncWebResponse; System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "DateTime {0}, After EndGetResponse With PATCH ", DateTime.Now.ToString(CultureInfo.InvariantCulture))); using (StreamReader streamReader = new StreamReader(asyncWebResponse.GetResponseStream())) diff --git a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj index aae15f3e8..20ec2dca8 100644 --- a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj +++ b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj @@ -187,7 +187,6 @@ - EndPoint\TimeOperation.cs diff --git a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj index 4c9355528..e61a17e51 100644 --- a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj +++ b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj @@ -302,7 +302,6 @@ - EndPoint\TimeOperation.cs diff --git a/src/Api/PubnubApiUnity/PubnubApiUnity.csproj b/src/Api/PubnubApiUnity/PubnubApiUnity.csproj index ce6284f87..00a9a69ee 100644 --- a/src/Api/PubnubApiUnity/PubnubApiUnity.csproj +++ b/src/Api/PubnubApiUnity/PubnubApiUnity.csproj @@ -249,7 +249,6 @@ - EndPoint\TimeOperation.cs