Beispiel #1
0
        // Token: 0x06001077 RID: 4215 RVA: 0x0003F1EC File Offset: 0x0003D3EC
        public void Add(string subscriptionId, string channelId, string user, NotificationType notificationType, string remoteEndpointOverride, out bool subscriptionExists)
        {
            ArgumentValidator.ThrowIfNullOrWhiteSpace("subscriptionId", subscriptionId);
            ArgumentValidator.ThrowIfNullOrWhiteSpace("channelId", channelId);
            ArgumentValidator.ThrowIfNullOrWhiteSpace("user", user);
            RemoteSubscriptionsInfo.NotificationTypeAndChannelInfo notificationTypeAndChannelInfo;
            if (!this.remoteSubscriptions.TryGetValue(subscriptionId, out notificationTypeAndChannelInfo))
            {
                notificationTypeAndChannelInfo = (this.remoteSubscriptions[subscriptionId] = new RemoteSubscriptionsInfo.NotificationTypeAndChannelInfo(notificationType));
            }
            HashSet <RemoteChannelInfo> channels          = notificationTypeAndChannelInfo.Channels;
            RemoteChannelInfo           remoteChannelInfo = new RemoteChannelInfo(channelId, user);

            if (!string.IsNullOrEmpty(remoteEndpointOverride) && AppConfigLoader.GetConfigBoolValue("Test_OwaAllowHeaderOverride", false))
            {
                remoteChannelInfo.EndpointTestOverride = remoteEndpointOverride;
            }
            subscriptionExists = !channels.Add(remoteChannelInfo);
            if (subscriptionExists)
            {
                SubscriberConcurrencyTracker.Instance.OnResubscribe(this.Mailbox, notificationType);
            }
            else
            {
                SubscriberConcurrencyTracker.Instance.OnSubscribe(this.Mailbox, notificationType);
            }
            this.AddSubscriptionToPerChannelList(channelId, subscriptionId);
        }
Beispiel #2
0
 // Token: 0x0600107C RID: 4220 RVA: 0x0003F484 File Offset: 0x0003D684
 private void Remove(string subscriptionId, RemoteChannelInfo channelInfo)
 {
     RemoteSubscriptionsInfo.NotificationTypeAndChannelInfo notificationTypeAndChannelInfo;
     if (this.remoteSubscriptions.TryGetValue(subscriptionId, out notificationTypeAndChannelInfo))
     {
         if (notificationTypeAndChannelInfo.Channels.Remove(channelInfo))
         {
             SubscriberConcurrencyTracker.Instance.OnUnsubscribe(this.Mailbox, notificationTypeAndChannelInfo.Type);
         }
         this.RemoveSubscriptionFromPerChannelList(channelInfo.ChannelId, subscriptionId);
         if (notificationTypeAndChannelInfo.Channels.Count == 0)
         {
             this.remoteSubscriptions.Remove(subscriptionId);
             this.RaiseEventsIfNeeded(subscriptionId);
             return;
         }
     }
     else
     {
         ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RemoteSubscriptionInfo.Remove - Subscription not active. SubscriptionId: {0}", subscriptionId);
     }
 }