// Token: 0x0600036F RID: 879 RVA: 0x00015764 File Offset: 0x00013964
 private void Subscribe(object state)
 {
     OrionCoreNotificationSubscriber.log.Debug("Subscribing indications..");
     try
     {
         OrionCoreNotificationSubscriber.DeleteOldSubscriptions();
     }
     catch (Exception ex)
     {
         OrionCoreNotificationSubscriber.log.Warn("Exception deleting old subscriptions:", ex);
     }
     try
     {
         string text = InformationServiceSubscriptionProviderShared.Instance().Subscribe("SUBSCRIBE System.InstanceDeleted", this, new SubscriptionOptions
         {
             Description = "OrionCoreIndications"
         });
         if (OrionCoreNotificationSubscriber.log.IsDebugEnabled)
         {
             OrionCoreNotificationSubscriber.log.DebugFormat("PubSub Subscription succeeded. uri:'{0}'", text);
         }
         Scheduler.Instance.Remove("OrionCoreIndications");
     }
     catch (Exception ex2)
     {
         OrionCoreNotificationSubscriber.log.Error("Subscription did not succeed, retrying .. (Is SWIS v3 running ?)", ex2);
     }
 }
 // Token: 0x06000607 RID: 1543 RVA: 0x00024248 File Offset: 0x00022448
 private void Unsubscribe()
 {
     if (this.subscriptionUris.Count == 0)
     {
         return;
     }
     try
     {
         foreach (string text in this.subscriptionUris)
         {
             InformationServiceSubscriptionProviderShared.Instance().Unsubscribe(text);
         }
         this.subscriptionUris.Clear();
     }
     catch (Exception ex)
     {
         DowntimeMonitoringNotificationSubscriber.log.ErrorFormat("Unsubscribe failed: '{0}'", ex);
         throw;
     }
 }
 // Token: 0x06000608 RID: 1544 RVA: 0x000242DC File Offset: 0x000224DC
 private void Subscribe(object state)
 {
     DowntimeMonitoringNotificationSubscriber.log.Debug("Subscribing Managed Entity changed indications..");
     try
     {
         try
         {
             this.DeleteOldSubscriptions();
         }
         catch (Exception ex)
         {
             DowntimeMonitoringNotificationSubscriber.log.Warn("Exception deleting old subscriptions:", ex);
         }
         if (this.subscriptionUris.Count > 0)
         {
             this.Unsubscribe();
         }
         foreach (string text in new string[]
         {
             "SUBSCRIBE System.InstanceDeleted WHEN InstanceType ISA 'System.ManagedEntity' OR SourceInstanceType ISA 'System.ManagedEntity'",
             "SUBSCRIBE System.InstanceCreated WHEN InstanceType ISA 'System.ManagedEntity' OR SourceInstanceType ISA 'System.ManagedEntity'",
             "SUBSCRIBE CHANGES TO System.ManagedEntity WHEN Status CHANGES"
         })
         {
             string text2 = InformationServiceSubscriptionProviderShared.Instance().Subscribe(text, this, new SubscriptionOptions
             {
                 Description = "NetObjectDowntimeIndication"
             });
             this.subscriptionUris.Add(text2);
             DowntimeMonitoringNotificationSubscriber.log.InfoFormat("Pub/sub subscription succeeded. uri:'{0}'", text2);
         }
         Scheduler.Instance.Remove("NetObjectDowntimeIndication");
     }
     catch (Exception ex2)
     {
         DowntimeMonitoringNotificationSubscriber.log.ErrorFormat("{0} in Subscribe: {1}\r\n{2}", ex2.GetType(), ex2.Message, ex2.StackTrace);
     }
 }
Exemple #4
0
 // Token: 0x060005F4 RID: 1524 RVA: 0x000239A8 File Offset: 0x00021BA8
 public DowntimeMonitoringEnableSubscriber(DowntimeMonitoringNotificationSubscriber downtimeMonitoringSubscriber) : this(InformationServiceSubscriptionProviderShared.Instance(), downtimeMonitoringSubscriber)
 {
 }
 // Token: 0x0600058D RID: 1421 RVA: 0x00021C78 File Offset: 0x0001FE78
 public MaintenanceIndicationSubscriber() : this(new MaintenanceManager(InformationServiceProxyPoolCreatorFactory.GetSystemCreator(), new MaintenanceModePlanDAL()), InformationServiceSubscriptionProviderShared.Instance())
 {
 }
        // Token: 0x0600002C RID: 44 RVA: 0x00002D00 File Offset: 0x00000F00
        private void Subscribe(object state)
        {
            AuditingNotificationSubscriber.log.Debug("Subscribing auditing indications..");
            try
            {
                AuditingNotificationSubscriber.DeleteOldSubscriptions();
            }
            catch (Exception ex)
            {
                AuditingNotificationSubscriber.log.Warn("Exception deleting old subscriptions:", ex);
            }
            HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            foreach (IAuditing2 auditing in this.auditingPlugins.AuditingInstances)
            {
                IAuditingMultiSubscription auditingMultiSubscription = auditing as IAuditingMultiSubscription;
                if (auditingMultiSubscription != null)
                {
                    foreach (string item in auditingMultiSubscription.GetSubscriptionQueries())
                    {
                        hashSet.Add(item);
                    }
                }
                else
                {
                    hashSet.Add(auditing.GetSubscriptionQuery());
                }
            }
            foreach (string text in hashSet)
            {
                try
                {
                    AuditingNotificationSubscriber.log.DebugFormat("Subscribing '{0}'", text);
                    string key = InformationServiceSubscriptionProviderShared.Instance().Subscribe(text, this, new SubscriptionOptions
                    {
                        Description = "AuditingIndications"
                    });
                    string query1 = text;
                    this.subscriptionIdToAuditingInstances.TryAdd(key, this.auditingPlugins.AuditingInstances.Where(delegate(IAuditing2 instance)
                    {
                        bool result;
                        try
                        {
                            result = (string.Compare(query1, instance.GetSubscriptionQuery(), StringComparison.OrdinalIgnoreCase) == 0);
                        }
                        catch (NotImplementedException)
                        {
                            IAuditingMultiSubscription auditingMultiSubscription2 = instance as IAuditingMultiSubscription;
                            result = (auditingMultiSubscription2 != null && auditingMultiSubscription2.GetSubscriptionQueries().Contains(query1));
                        }
                        return(result);
                    }));
                    AuditingNotificationSubscriber.log.DebugFormat("Subscribed '{0}' with {1} number of auditing instances.", text, this.subscriptionIdToAuditingInstances[key].Count <IAuditing2>());
                }
                catch (Exception ex2)
                {
                    AuditingNotificationSubscriber.log.ErrorFormat("Unable to subscribe auditing instance with query '{0}'. {1}", text, ex2);
                }
            }
            AuditingNotificationSubscriber.log.InfoFormat("Auditing pub/sub subscription succeeded.", Array.Empty <object>());
            Scheduler.Instance.Remove("AuditingIndications");
        }
 // Token: 0x06000925 RID: 2341 RVA: 0x00042020 File Offset: 0x00040220
 public AgentNotificationSubscriber(Action <int> onIndication) : this(onIndication, InformationServiceSubscriptionProviderShared.Instance())
 {
 }