public Task OnNotificationAsync(Notification notification)
        {
            Stopwatch stopwatch = new Stopwatch();

            try
            {
                stopwatch.Start();
                if (notification.get_SourceInstanceProperties() == null)
                {
                    throw new ArgumentNullException("sourceInstanceProperties");
                }
                if (DowntimeMonitoringNotificationSubscriber.log.get_IsDebugEnabled())
                {
                    DowntimeMonitoringNotificationSubscriber.log.Debug((object)this.DetailInfo(notification.get_SubscriptionId(), notification.get_IndicationType(), notification.get_IndicationProperties(), notification.get_SourceInstanceProperties()));
                }
                object obj1 = (object)null;
                notification.get_SourceInstanceProperties().TryGetValue("InstanceType", out obj1);
                if (obj1 == null)
                {
                    notification.get_SourceInstanceProperties().TryGetValue("SourceInstanceType", out obj1);
                }
                if (!(obj1 is string instanceType))
                {
                    DowntimeMonitoringNotificationSubscriber.log.Error((object)"Wrong PropertyBag data. InstanceType or SourceInstanceType are null");
                    return(Task.CompletedTask);
                }
                string columnForSwisEntity = this.GetNetObjectIdColumnForSwisEntity(instanceType);
                if (columnForSwisEntity == null)
                {
                    DowntimeMonitoringNotificationSubscriber.log.DebugFormat("Not a supported instance type: {0}", (object)instanceType);
                    return(Task.CompletedTask);
                }
                object obj2;
                if (!notification.get_SourceInstanceProperties().TryGetValue(columnForSwisEntity, out obj2))
                {
                    DowntimeMonitoringNotificationSubscriber.log.DebugFormat("Unable to get Entity ID. InstanceType : {0}, ID Field: {1}", (object)instanceType, (object)columnForSwisEntity);
                    return(Task.CompletedTask);
                }
                if (notification.get_IndicationType() == IndicationHelper.GetIndicationType((IndicationType)2) || notification.get_IndicationType() == IndicationHelper.GetIndicationType((IndicationType)0))
                {
                    object statusObject1;
                    notification.get_SourceInstanceProperties().TryGetValue("Status", out statusObject1);
                    if (statusObject1 == null)
                    {
                        DowntimeMonitoringNotificationSubscriber.log.DebugFormat("No Status reported for InstanceType : {0}", (object)instanceType);
                        return(Task.CompletedTask);
                    }
                    if (this._nodeNetObjectIdColumn == null)
                    {
                        this._nodeNetObjectIdColumn = this.GetNetObjectIdColumnForSwisEntity("Orion.Nodes");
                    }
                    object statusObject2;
                    notification.get_SourceInstanceProperties().TryGetValue(this._nodeNetObjectIdColumn, out statusObject2);
                    if (statusObject2 == null)
                    {
                        DowntimeMonitoringNotificationSubscriber.log.DebugFormat("SourceBag must include NodeId. InstanceType : {0}", (object)instanceType);
                        return(Task.CompletedTask);
                    }
                    INetObjectDowntimeDAL objectDowntimeDal = this._netObjectDowntimeDal;
                    NetObjectDowntime     netObjectDowntime = new NetObjectDowntime();
                    netObjectDowntime.set_EntityID(obj2.ToString());
                    netObjectDowntime.set_NodeID(this.ExtractStatusID(statusObject2));
                    netObjectDowntime.set_EntityType(instanceType);
                    netObjectDowntime.set_DateTimeFrom((DateTime)notification.get_IndicationProperties()[(string)IndicationConstants.IndicationTime]);
                    netObjectDowntime.set_StatusID(this.ExtractStatusID(statusObject1));
                    objectDowntimeDal.Insert(netObjectDowntime);
                }
                else if (notification.get_IndicationType() == IndicationHelper.GetIndicationType((IndicationType)1))
                {
                    this._netObjectDowntimeDal.DeleteDowntimeObjects(obj2.ToString(), instanceType);
                }
            }
            catch (Exception ex)
            {
                DowntimeMonitoringNotificationSubscriber.log.Error((object)string.Format("Exception occured when processing incoming indication of type \"{0}\"", (object)notification.get_IndicationType()), ex);
            }
            finally
            {
                stopwatch.Stop();
                DowntimeMonitoringNotificationSubscriber.log.DebugFormat("Downtime notification has been processed in {0} miliseconds.", (object)stopwatch.ElapsedMilliseconds);
            }
            return(Task.CompletedTask);
        }