Issue #2704 fix alertviz connectivity checks

Former-commit-id: 0c4de50218 [formerly 0c4de50218 [formerly adfb9c293456aeced60e3ab41575d8b3b0f635b8]]
Former-commit-id: 4d68994525
Former-commit-id: 228ab8dd60
This commit is contained in:
Nate Jensen 2014-02-17 17:10:07 -06:00
parent e6dae7a23c
commit 944df080f4
2 changed files with 23 additions and 6 deletions

View file

@ -68,6 +68,7 @@ import com.raytheon.uf.viz.core.comm.IConnectivityCallback;
* Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking. * Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking.
* Feb 04, 2014 2704 njensen Shifted some private fields/methods to protected, * Feb 04, 2014 2704 njensen Shifted some private fields/methods to protected,
* Added status and details, better site validation * Added status and details, better site validation
* Feb 17, 2014 2704 njensen Changed some alertviz fields to protected
* *
* </pre> * </pre>
* *
@ -117,15 +118,15 @@ public class ConnectivityPreferenceDialog extends Dialog {
private Label localizationLabel; private Label localizationLabel;
private Text localizationText; protected Text localizationText;
private String localization = ""; private String localization = "";
private boolean localizationGood = false; private boolean localizationGood = false;
private Text alertVizText; protected Text alertVizText;
private String alertVizServer = null; protected String alertVizServer = null;
private boolean alertVizGood = true; private boolean alertVizGood = true;
@ -460,7 +461,7 @@ public class ConnectivityPreferenceDialog extends Dialog {
localizationCallback); localizationCallback);
} }
private void validateAlertviz() { protected void validateAlertviz() {
ConnectivityManager.checkAlertService(alertVizServer, alertCallback); ConnectivityManager.checkAlertService(alertVizServer, alertCallback);
} }
@ -657,8 +658,8 @@ public class ConnectivityPreferenceDialog extends Dialog {
if (status != null) { if (status != null) {
statusLabel.setText(status); statusLabel.setText(status);
} else { } else {
throw new IllegalStateException( // shoudln't be able to reach this but just in case
"Connectivity dialog received non-good status without status message"); statusLabel.setText("Connection error");
} }
} }
} }

View file

@ -61,6 +61,7 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
* Nov 23, 2011 bsteffen Initial creation * Nov 23, 2011 bsteffen Initial creation
* Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking. * Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking.
* Feb 04, 2014 2704 njensen Refactored * Feb 04, 2014 2704 njensen Refactored
* Feb 17, 2014 2704 njensen Added checks for alertviz connectivity
* *
* </pre> * </pre>
* *
@ -303,6 +304,16 @@ public class ThinClientConnectivityDialog extends ConnectivityPreferenceDialog {
siteText.setBackground(getTextColor(isSiteGood())); siteText.setBackground(getTextColor(isSiteGood()));
} }
// validate alertviz
// apparently alertvizserver == null means it's alertviz itself
if (alertVizServer != null) {
if (alertVizText != null && !alertVizText.isDisposed()) {
setAlertVizServer(alertVizText.getText());
super.validateAlertviz();
alertVizText.setBackground(getTextColor(isAlertVizGood()));
}
}
boolean everythingGood = servicesGood && pypiesGood && isSiteGood() boolean everythingGood = servicesGood && pypiesGood && isSiteGood()
&& isAlertVizGood() && jmsGood; && isAlertVizGood() && jmsGood;
updateStatus(everythingGood, status, details); updateStatus(everythingGood, status, details);
@ -326,6 +337,11 @@ public class ThinClientConnectivityDialog extends ConnectivityPreferenceDialog {
useProxy = useProxyCheck.getSelection(); useProxy = useProxyCheck.getSelection();
proxyText.setEnabled(useProxy); proxyText.setEnabled(useProxy);
super.setLocalizationEnabled(!useProxy); super.setLocalizationEnabled(!useProxy);
if (useProxy) {
if (localizationText != null && !localizationText.isDisposed()) {
localizationText.setBackground(getTextColor(true));
}
}
validate(); validate();
} }