Merge "Issue #1396 fix thin client" into development
Former-commit-id:f844311001
[formerly206e288594
] [formerly01c27ce5aa
] [formerlyf844311001
[formerly206e288594
] [formerly01c27ce5aa
] [formerlyf577fc578d
[formerly01c27ce5aa
[formerly 4ec3746745f0983226db5e0b9e4969ef0885c44f]]]] Former-commit-id:f577fc578d
Former-commit-id:2afce25dae
[formerly94bc1dc9ae
] [formerly ebc1ad236803924927d5fa606cb7719944c83330 [formerly7257650eea
]] Former-commit-id: 6b9aa6166ec15f5c5507c8bfb391099a346e64c1 [formerlyfa676a5cf1
] Former-commit-id:df8e16bd63
This commit is contained in:
commit
0895623c80
2 changed files with 27 additions and 15 deletions
|
@ -110,6 +110,16 @@ public class LocalizationInitializer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processGetServers();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a GetServersRequest and sets the references that hold the various
|
||||||
|
* server addresses
|
||||||
|
*
|
||||||
|
* @throws VizException
|
||||||
|
*/
|
||||||
|
protected final void processGetServers() throws VizException {
|
||||||
GetServersRequest req = new GetServersRequest();
|
GetServersRequest req = new GetServersRequest();
|
||||||
GetServersResponse resp = (GetServersResponse) ThriftClient
|
GetServersResponse resp = (GetServersResponse) ThriftClient
|
||||||
.sendLocalizationRequest(req);
|
.sendLocalizationRequest(req);
|
||||||
|
|
|
@ -19,12 +19,16 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.thinclient.localization;
|
package com.raytheon.uf.viz.thinclient.localization;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.map.DefaultedMap;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
|
||||||
import com.raytheon.uf.common.comm.HttpClient;
|
import com.raytheon.uf.common.comm.HttpClient;
|
||||||
import com.raytheon.uf.common.localization.msgs.GetServersRequest;
|
import com.raytheon.uf.common.localization.msgs.GetServersRequest;
|
||||||
import com.raytheon.uf.common.localization.msgs.GetServersResponse;
|
import com.raytheon.uf.common.localization.msgs.GetServersResponse;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.VizServers;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
|
@ -34,7 +38,8 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
||||||
import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog;
|
import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Initializer that does work of checking localization settings and configuring
|
||||||
|
* the servers to use based on the preferences.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -43,6 +48,7 @@ import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 23, 2011 bsteffen Initial creation
|
* Nov 23, 2011 bsteffen Initial creation
|
||||||
|
* Dec 06, 2012 1396 njensen Added setting VizServers
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -77,10 +83,9 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
||||||
.getBoolean(ThinClientPreferenceConstants.P_DISABLE_JMS);
|
.getBoolean(ThinClientPreferenceConstants.P_DISABLE_JMS);
|
||||||
|
|
||||||
if (store.getBoolean(ThinClientPreferenceConstants.P_USE_PROXIES)) {
|
if (store.getBoolean(ThinClientPreferenceConstants.P_USE_PROXIES)) {
|
||||||
LocalizationManager
|
String servicesProxy = store
|
||||||
.getInstance()
|
.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY);
|
||||||
.setCurrentServer(
|
LocalizationManager.getInstance().setCurrentServer(servicesProxy);
|
||||||
store.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY));
|
|
||||||
String dataDir = VizApp.getServerDataDir();
|
String dataDir = VizApp.getServerDataDir();
|
||||||
if (dataDir == null || dataDir.isEmpty()) {
|
if (dataDir == null || dataDir.isEmpty()) {
|
||||||
dataDir = store
|
dataDir = store
|
||||||
|
@ -96,23 +101,20 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
||||||
VizApp.setJmsServer(resp.getJmsServer());
|
VizApp.setJmsServer(resp.getJmsServer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VizApp.setHttpServer(store
|
VizApp.setHttpServer(servicesProxy);
|
||||||
.getString(ThinClientPreferenceConstants.P_SERVICES_PROXY));
|
|
||||||
VizApp.setPypiesServer(store
|
VizApp.setPypiesServer(store
|
||||||
.getString(ThinClientPreferenceConstants.P_PYPIES_PROXY));
|
.getString(ThinClientPreferenceConstants.P_PYPIES_PROXY));
|
||||||
boolean compressRequests = store
|
boolean compressRequests = store
|
||||||
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION);
|
.getBoolean(ThinClientPreferenceConstants.P_ENABLE_REQUEST_COMPRESSION);
|
||||||
HttpClient.getInstance().setCompressRequests(compressRequests);
|
HttpClient.getInstance().setCompressRequests(compressRequests);
|
||||||
|
|
||||||
|
// use the proxy for all servers in VizServers
|
||||||
|
Map<String, String> serversMap = new DefaultedMap(servicesProxy);
|
||||||
|
VizServers.getInstance().setServerLocations(serversMap);
|
||||||
} else {
|
} else {
|
||||||
GetServersRequest req = new GetServersRequest();
|
processGetServers();
|
||||||
GetServersResponse resp = (GetServersResponse) ThriftClient
|
if (disableJMS) {
|
||||||
.sendLocalizationRequest(req);
|
VizApp.setJmsServer(null);
|
||||||
VizApp.setHttpServer(resp.getHttpServer());
|
|
||||||
VizApp.setPypiesServer(resp.getPypiesServer());
|
|
||||||
VizApp.setServerDataDir(resp.getServerDataDir());
|
|
||||||
if (!disableJMS) {
|
|
||||||
VizApp.setJmsServer(resp.getJmsServer());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
store.setValue(ThinClientPreferenceConstants.P_SERVER_DATA_DIR,
|
store.setValue(ThinClientPreferenceConstants.P_SERVER_DATA_DIR,
|
||||||
|
|
Loading…
Add table
Reference in a new issue