Ejemplo n.º 1
0
        private void RemoveNewVersionAvailableAlertIfNecessary()
        {
            var buildNumber = ServerVersion.Build;

            var id = AlertRaised.GetKey(AlertType.Server_NewVersionAvailable, null);

            using (Read(id, out var ntv))
            {
                if (ntv == null)
                {
                    return;
                }

                var delete = true;

                if (buildNumber != ServerVersion.DevBuildNumber)
                {
                    if (ntv.Json.TryGetMember(nameof(AlertRaised.Details), out var o) &&
                        o is BlittableJsonReaderObject detailsJson)
                    {
                        if (detailsJson.TryGetMember(nameof(NewVersionAvailableDetails.VersionInfo), out o) &&
                            o is BlittableJsonReaderObject newVersionDetailsJson)
                        {
                            var value = JsonDeserializationServer.LatestVersionCheckVersionInfo(newVersionDetailsJson);
                            delete = value.BuildNumber <= buildNumber;
                        }
                    }
                }

                if (delete)
                {
                    Delete(id);
                }
            }
        }
Ejemplo n.º 2
0
        public T GetAlert <T>(string processTag, string processName, AlertType etlAlertType) where T : INotificationDetails, new()
        {
            Debug.Assert(etlAlertType == AlertType.Etl_LoadError || etlAlertType == AlertType.Etl_TransformationError);

            var key = $"{processTag}/{processName}";

            var id = AlertRaised.GetKey(etlAlertType, key);

            using (_notificationsStorage.Read(id, out NotificationTableValue ntv))
            {
                return(GetDetails <T>(ntv));
            }
        }
Ejemplo n.º 3
0
        private AlertRaised GetOrCreateAlert <T>(string processTag, string processName, AlertType etlAlertType, string message, out T details) where T : INotificationDetails, new()
        {
            Debug.Assert(etlAlertType == AlertType.Etl_LoadError || etlAlertType == AlertType.Etl_TransformationError);

            var key = $"{processTag}/{processName}";

            var id = AlertRaised.GetKey(etlAlertType, key);

            using (_notificationsStorage.Read(id, out NotificationTableValue ntv))
            {
                details = GetDetails <T>(ntv);

                return(AlertRaised.Create(
                           _databaseName,
                           $"{processTag}: '{processName}'",
                           message,
                           etlAlertType,
                           NotificationSeverity.Warning,
                           key: key,
                           details: details));
            }
        }
Ejemplo n.º 4
0
 public static void DismissLicenseLimitNotification(NotificationCenter notificationCenter, LimitType type)
 {
     notificationCenter.Dismiss(AlertRaised.GetKey(AlertType.LicenseManager_LicenseLimit, type.ToString()));
 }