/// <summary> /// Shows the license summary dialog to the user as their license has expired. /// </summary> /// <param name="host"></param> /// <param name="now"></param> /// <param name="expiryDate">Should be expressed in local time.</param> /// <param name="createAlert"></param> /// <param name="popupLicenseMgr"></param> private void showLicenseSummaryExpired(Host host, DateTime now, DateTime expiryDate, bool createAlert, bool popupLicenseMgr) { Program.AssertOnEventThread(); log.InfoFormat("Server {0} has expired ({1}). Show License Summary if needed", host.Name(), HelpersGUI.DateTimeToString(expiryDate, Messages.DATEFORMAT_DMY_HMS, true)); if (createAlert) { var alert = new LicenseAlert(host.Name(), now, expiryDate) { LicenseManagerLauncher = licenseManagerLauncher }; Alert.AddAlert(alert); } if (!popupLicenseMgr) { return; } if (Program.RunInAutomatedTestMode) { log.Debug("In automated test mode: quashing license expiry warning"); } else { licenseManagerLauncher.LaunchIfRequired(true, ConnectionsManager.XenConnections); } }
internal static void PerformIQNCheck() { List <Host> missingIQNs = HelpersGUI.CheckHostIQNsExist(); Dictionary <Host, Host> repeatedIQNs = HelpersGUI.CheckHostIQNsDiffer(); foreach (Host host in missingIQNs) { MissingIqnAlert alert = new MissingIqnAlert(host); if (Alert.FindAlert(alert) == null) { Alert.AddAlert(alert); } } foreach (Host host in repeatedIQNs.Keys) { Program.Invoke(Program.MainWindow, delegate() { DuplicateIqnAlert alert = new DuplicateIqnAlert(host, repeatedIQNs); if (Alert.FindAlert(alert) == null) { Alert.AddAlert(alert); } }); } }
public static void CheckHotfixEligibility(IXenConnection connection) { var master = Helpers.GetMaster(connection); if (master == null) { return; } var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion); if (!HotfixEligibilityAlert.IsAlertNeeded(hotfixEligibility, xenServerVersion, !master.IsFreeLicenseOrExpired())) { Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection)); return; } var alertIndex = Alert.FindAlertIndex(a => a is HotfixEligibilityAlert alert && connection.Equals(alert.Connection) && xenServerVersion == alert.Version); if (alertIndex == -1) { Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection)); // ensure that there is no other alert for this connection Alert.AddAlert(new HotfixEligibilityAlert(connection, xenServerVersion)); } else { Alert.RefreshAlertAt(alertIndex); } }
/// <summary> /// Shows the license summary dialog to the user as their license will soon expire. /// </summary> private void showLicenseSummaryWarning(String hostname, DateTime now, DateTime expiryDate) { Program.AssertOnEventThread(); log.InfoFormat("Server {0} is within 30 days of expiry ({1}). Show License Summary if needed", hostname, HelpersGUI.DateTimeToString(expiryDate, Messages.DATEFORMAT_DMY_HMS, true)); var alert = new LicenseAlert(hostname, now, expiryDate) { LicenseManagerLauncher = licenseManagerLauncher }; Alert.AddAlert(alert); if (Program.RunInAutomatedTestMode) { log.DebugFormat("In automated test mode: quashing license expiry warning '{0}'", alert.Description); } else { licenseManagerLauncher.Parent = Program.MainWindow; licenseManagerLauncher.LaunchIfRequired(true, ConnectionsManager.XenConnections); } }
public static void CheckServerVersion() { if (!AllowUpdates || !Properties.Settings.Default.AllowXenServerUpdates) { return; } XenServerUpdateAlert alert = NewServerVersionAlert(XenServerVersions, true); if (alert == null) { return; } Alert existingAlert = Alert.FindAlert(alert); if (existingAlert != null && alert.CanIgnore) { Alert.RemoveAlert(existingAlert); } else if (existingAlert != null) { ((XenServerUpdateAlert)existingAlert).CopyConnectionsAndHosts(alert); } else if (!alert.CanIgnore) { Alert.AddAlert(alert); } }
public static void CheckServerPatches() { if (!AllowUpdates || !Properties.Settings.Default.AllowPatchesUpdates) { return; } List <XenServerPatchAlert> alerts = GetServerPatchesAlerts(XenServerVersions, XenServerPatches, true); foreach (var alert in alerts) { Alert existingAlert = Alert.FindAlert(alert); if (existingAlert != null && alert.CanIgnore) { Alert.RemoveAlert(existingAlert); } else if (existingAlert != null) { ((XenServerPatchAlert)existingAlert).CopyConnectionsAndHosts(alert); } else if (!alert.CanIgnore) { Alert.AddAlert(alert); } } }
private static void CheckXenCenterVersion() { if (!AllowUpdates || !Properties.Settings.Default.AllowXenCenterUpdates) { return; } XenCenterUpdateAlert alert = NewXenCenterVersionAlert(XenCenterVersions, true); if (alert != null) { Alert.AddAlert(alert); } }