use of com.sun.pkg.client.SystemInfo.UpdateCheckFrequency in project Payara by payara.
the class UpdateCenterHandlers method getUpdateComponentCount.
@Handler(id = "getUpdateComponentCount")
public static void getUpdateComponentCount(HandlerContext handlerCtx) {
boolean donotPing = false;
// If user set NO_NETWORK system properties, don't try to do anything.
boolean noNetwork = (Boolean) GuiUtil.getSessionValue("_noNetwork");
if (noNetwork) {
GuiUtil.getLogger().info(GuiUtil.getMessage(BUNDLE, "noNetworkDetected"));
donotPing = true;
} else {
UpdateCheckFrequency userPreference = SystemInfo.getUpdateCheckFrequency();
if (userPreference == UpdateCheckFrequency.NEVER) {
GuiUtil.getLogger().info(GuiUtil.getMessage(BUNDLE, "noCheckPerformed"));
GuiUtil.setSessionValue("_doNotPing", "true");
donotPing = true;
}
}
if (donotPing) {
GuiUtil.setSessionValue("_hideUpdateMsg", Boolean.TRUE);
return;
}
GuiUtil.setSessionValue("_hideUpdateMsg", Boolean.FALSE);
GuiUtil.setSessionValue("_updateCountMsg", "");
UcThread thread = new UcThread((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false));
thread.start();
}
Aggregations