Exemplo n.º 1
0
 // Token: 0x0600092F RID: 2351 RVA: 0x00042200 File Offset: 0x00040400
 public void OnIndication(string subscriptionId, string indicationType, PropertyBag indicationProperties, PropertyBag sourceInstanceProperties)
 {
     try
     {
         AgentStatus agentStatus;
         string      agentId;
         if (RemoteCollectorConnectedNotificationSubscriber.GetRequiredProperties(sourceInstanceProperties, out agentId, out agentStatus))
         {
             RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector on Agent #{0} has changed status", agentId);
             using (CoreSwisContext coreSwisContext = this._swisContextFactory.Create())
             {
                 int?num = (from x in coreSwisContext.Entity <EngineProperties>()
                            where x.PropertyName == "AgentId" && x.PropertyValue == agentId && x.Engine.MasterEngineID == (int?)this._masterEngineId
                            select x.EngineID).FirstOrDefault <int?>();
                 if (num != null)
                 {
                     RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector engine #{0} on Agent #{1} changes status to {2}", num, agentId, agentStatus);
                     RemoteCollectorConnectedNotificationSubscriber.EngineComponent obj = new RemoteCollectorConnectedNotificationSubscriber.EngineComponent(num.Value, agentStatus);
                     this._onRemoteCollectorStatusChanged(obj);
                 }
                 else
                 {
                     RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector on Agent #{0} in not connected to local master engine #{1}", agentId, this._masterEngineId);
                 }
                 goto IL_212;
             }
         }
         RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector Agent connection indication does not have all the required properties (AgentId and AgentStatus)", Array.Empty <object>());
         IL_212 :;
     }
     catch (Exception ex)
     {
         RemoteCollectorConnectedNotificationSubscriber.Log.Error("Unexpected error in processing Agent Remote Collector Agent connection indication", ex);
     }
 }
 public void OnIndication(
     string subscriptionId,
     string indicationType,
     PropertyBag indicationProperties,
     PropertyBag sourceInstanceProperties)
 {
     try
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         RemoteCollectorConnectedNotificationSubscriber.\u003C\u003Ec__DisplayClass7_0 cDisplayClass70 = new RemoteCollectorConnectedNotificationSubscriber.\u003C\u003Ec__DisplayClass7_0();
         // ISSUE: reference to a compiler-generated field
         cDisplayClass70.\u003C\u003E4__this = this;
         AgentStatus agentStatus;
         // ISSUE: reference to a compiler-generated field
         if (RemoteCollectorConnectedNotificationSubscriber.GetRequiredProperties(sourceInstanceProperties, out cDisplayClass70.agentId, out agentStatus))
         {
             // ISSUE: reference to a compiler-generated field
             RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector on Agent #{0} has changed status", (object)cDisplayClass70.agentId);
             using (CoreSwisContext coreSwisContext = this._swisContextFactory.Create())
             {
                 ParameterExpression parameterExpression1;
                 ParameterExpression parameterExpression2;
                 // ISSUE: method reference
                 // ISSUE: method reference
                 // ISSUE: field reference
                 // ISSUE: method reference
                 // ISSUE: method reference
                 // ISSUE: field reference
                 // ISSUE: method reference
                 int?nullable = ((IQueryable <EngineProperties>)((SwisContext)coreSwisContext).Entity <EngineProperties>()).Where <EngineProperties>(Expression.Lambda <Func <EngineProperties, bool> >((Expression)Expression.AndAlso((Expression)Expression.AndAlso((Expression)Expression.Equal((Expression)Expression.Property((Expression)parameterExpression1, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(EngineProperties.get_PropertyName))), (Expression)Expression.Constant((object)"AgentId", typeof(string))), (Expression)Expression.Equal((Expression)Expression.Property((Expression)parameterExpression1, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(EngineProperties.get_PropertyValue))), (Expression)Expression.Field((Expression)Expression.Constant((object)cDisplayClass70, typeof(RemoteCollectorConnectedNotificationSubscriber.\u003C\u003Ec__DisplayClass7_0)), FieldInfo.GetFieldFromHandle(__fieldref(RemoteCollectorConnectedNotificationSubscriber.\u003C\u003Ec__DisplayClass7_0.agentId))))), (Expression)Expression.Equal((Expression)Expression.Property((Expression)Expression.Property((Expression)parameterExpression1, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(EngineProperties.get_Engine))), (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(SolarWinds.InformationService.Linq.Plugins.Core.Orion.Engines.get_MasterEngineID))), (Expression)Expression.Convert((Expression)Expression.Field((Expression)Expression.Constant((object)this, typeof(RemoteCollectorConnectedNotificationSubscriber)), FieldInfo.GetFieldFromHandle(__fieldref(RemoteCollectorConnectedNotificationSubscriber._masterEngineId))), typeof(int?)))), parameterExpression1)).Select <EngineProperties, int?>(Expression.Lambda <Func <EngineProperties, int?> >((Expression)Expression.Property((Expression)parameterExpression2, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(EngineProperties.get_EngineID))), parameterExpression2)).FirstOrDefault <int?>();
                 if (nullable.HasValue)
                 {
                     // ISSUE: reference to a compiler-generated field
                     RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector engine #{0} on Agent #{1} changes status to {2}", (object)nullable, (object)cDisplayClass70.agentId, (object)agentStatus);
                     this._onRemoteCollectorStatusChanged((IEngineComponent) new RemoteCollectorConnectedNotificationSubscriber.EngineComponent(nullable.Value, agentStatus));
                 }
                 else
                 {
                     // ISSUE: reference to a compiler-generated field
                     RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector on Agent #{0} in not connected to local master engine #{1}", (object)cDisplayClass70.agentId, (object)this._masterEngineId);
                 }
             }
         }
         else
         {
             RemoteCollectorConnectedNotificationSubscriber.Log.DebugFormat("Remote Collector Agent connection indication does not have all the required properties (AgentId and AgentStatus)", Array.Empty <object>());
         }
     }
     catch (Exception ex)
     {
         RemoteCollectorConnectedNotificationSubscriber.Log.Error((object)"Unexpected error in processing Agent Remote Collector Agent connection indication", ex);
     }
 }