Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-11-14 21:55:04 +0000
committerGerrit Code Review @ Eclipse.org2013-12-04 18:05:11 +0000
commit591706db2db166a4d3cd6b4b2f7d2885d7265c62 (patch)
tree013fc47ccbc420434edb9ad41ee2f28c17c411f1 /plugins/org.eclipse.osee.framework.core.client
parentc1c1d3d3113031df4e9661e25e16ffab2c963134 (diff)
downloadorg.eclipse.osee-591706db2db166a4d3cd6b4b2f7d2885d7265c62.tar.gz
org.eclipse.osee-591706db2db166a4d3cd6b4b2f7d2885d7265c62.tar.xz
org.eclipse.osee-591706db2db166a4d3cd6b4b2f7d2885d7265c62.zip
feature[ats_SHB3P]: Remove arbitration code
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.client')
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java24
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ArbitrationServer.java86
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java15
4 files changed, 10 insertions, 136 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
index d967a760ed6..6bc726108db 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
@@ -33,7 +33,6 @@ public class OseeClientProperties extends OseeProperties {
private static final String HEADER_TAG = "OSEE-Client-Property-Init";
private static final String OSEE_APPLICATION_SERVER = "osee.application.server";
- private static final String OSEE_ARBITRATION_SERVER = "osee.arbitration.server";
private static final String OSEE_LOCAL_APPLICATION_SERVER = "osee.local.application.server";
private static final String OSEE_LOCAL_HTTP_WORKER_PORT = "osee.local.http.worker.port";
@@ -177,12 +176,12 @@ public class OseeClientProperties extends OseeProperties {
/**
* <pre>
* Sets the application server address and port to use. This system property sets the URL used to reference
- * the application server. Arbitration is bypassed.
+ * the application server.
* </pre>
*
* <b>Format: </b> <code>http://address:port</code>
*
- * @param application server URL to use instead going through the arbitration server
+ * @param application server URL to use
*/
public static void setOseeApplicationServer(String value) {
System.setProperty(OSEE_APPLICATION_SERVER, value);
@@ -191,32 +190,17 @@ public class OseeClientProperties extends OseeProperties {
/**
* <pre>
* Retrieves the application server address and port to use. When specified, this system property sets the URL used to reference
- * the application server. Arbitration is bypassed.
+ * the application server.
* </pre>
*
* <b>Format: </b> <code>http://address:port</code>
*
- * @return application server URL to use instead going through the arbitration server
+ * @return application server URL
*/
public static String getOseeApplicationServer() {
return getProperty(OSEE_APPLICATION_SERVER);
}
- /**
- * <pre>
- * Retrieves the arbitration server address and port to use. This system property must be specified for the system to
- * gain access to OSEE data. If the application server property is set then that address takes precedence and
- * arbitration is bypassed.
- * </pre>
- *
- * <b>Format: </b> <code>http://address:port</code>
- *
- * @return default arbitration server URL to set preferences.
- */
- public static String getOseeArbitrationServer() {
- return getProperty(OSEE_ARBITRATION_SERVER);
- }
-
private static String getProperty(String name) {
return getProperty(name, "");
}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ArbitrationServer.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ArbitrationServer.java
deleted file mode 100644
index 7a683cd8567..00000000000
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ArbitrationServer.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.client.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
-import org.eclipse.osee.framework.core.data.OseeCodeVersion;
-import org.eclipse.osee.framework.core.data.OseeServerContext;
-import org.eclipse.osee.framework.core.data.OseeServerInfo;
-import org.eclipse.osee.framework.core.util.HttpProcessor;
-import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-public class ArbitrationServer extends OseeServer {
-
- private static final int TEN_SEC_TIMEOUT = 1000 * 10;
-
- public ArbitrationServer() {
- super("Arbitration Server");
- }
-
- public OseeServerInfo getViaArbitration() {
- OseeServerInfo serverInfo = null;
- resetStatus();
- ByteArrayOutputStream outputStream = null;
- AcquireResult result = null;
- try {
- Map<String, String> parameters = new HashMap<String, String>();
- parameters.put("version", OseeCodeVersion.getVersion());
- String url =
- HttpUrlBuilderClient.getInstance().getOsgiArbitrationServiceUrl(OseeServerContext.LOOKUP_CONTEXT,
- parameters);
-
- outputStream = new ByteArrayOutputStream();
- result = HttpProcessor.acquire(new URL(url), outputStream, TEN_SEC_TIMEOUT);
- setAlive(true);
- set(Level.INFO, null, HttpUrlBuilderClient.getInstance().getArbitrationServerPrefix());
- if (result.getCode() == HttpURLConnection.HTTP_OK) {
- serverInfo = getServerInfo(outputStream, result);
- } else {
- String arbitrationServerMessage = result.getResult();
- if (Strings.isValid(arbitrationServerMessage)) {
- set(Level.SEVERE, null, arbitrationServerMessage);
- } else {
- set(Level.SEVERE, null, "Error requesting application server for version [%s]",
- OseeCodeVersion.getVersion());
- }
- }
- } catch (Exception ex) {
- OseeLog.log(CoreClientActivator.class, Level.SEVERE, ex);
- set(Level.SEVERE, ex, "Error connecting to arbitration server - [%s]", ex.getLocalizedMessage());
- } finally {
- Lib.close(outputStream);
- }
- return serverInfo;
- }
-
- private OseeServerInfo getServerInfo(ByteArrayOutputStream outputStream, AcquireResult result) {
- OseeServerInfo serverInfo = null;
- try {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- serverInfo = OseeServerInfo.fromXml(inputStream);
- } catch (Exception ex) {
- OseeLog.log(CoreClientActivator.class, Level.SEVERE, ex);
- set(Level.SEVERE, ex, "Error parsing arbitration server response - [%s]", ex.getLocalizedMessage());
- }
- return serverInfo;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
index 435ee995eed..893e2cf142d 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
@@ -15,6 +15,7 @@ import java.sql.Timestamp;
import java.util.Date;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.client.OseeClientProperties;
+import org.eclipse.osee.framework.core.data.OseeCodeVersion;
import org.eclipse.osee.framework.core.data.OseeServerInfo;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -27,7 +28,6 @@ import org.eclipse.osee.framework.logging.OseeLog;
*/
public class OseeApplicationServer {
- private static final ArbitrationServer arbitrationServer = new ArbitrationServer();
private static final ApplicationServer applicationServer = new ApplicationServer();
private OseeApplicationServer() {
@@ -35,7 +35,6 @@ public class OseeApplicationServer {
}
public static void reset() {
- arbitrationServer.resetStatus();
applicationServer.resetStatus();
applicationServer.setServerInfo(null);
@@ -57,28 +56,20 @@ public class OseeApplicationServer {
if (!applicationServer.isServerInfoValid()) {
applicationServer.resetStatus();
OseeServerInfo serverInfo = null;
- String overrideValue = OseeClientProperties.getOseeApplicationServer();
- if (Strings.isValid(overrideValue)) {
- arbitrationServer.set(Level.INFO, null, "Arbitration Overridden");
+ String appServerUri = OseeClientProperties.getOseeApplicationServer();
+ if (Strings.isValid(appServerUri)) {
try {
serverInfo =
- new OseeServerInfo("OVERRIDE", overrideValue, new String[] {"OVERRIDE"}, new Timestamp(
- new Date().getTime()), true);
+ new OseeServerInfo(applicationServer.getServerAddress(), appServerUri,
+ new String[] {OseeCodeVersion.getVersion()}, new Timestamp(new Date().getTime()), true);
} catch (Exception ex) {
OseeLog.log(CoreClientActivator.class, Level.SEVERE, ex);
- applicationServer.set(Level.SEVERE, ex, "Error parsing arbitration server override [%s]", overrideValue);
- }
- } else {
- serverInfo = arbitrationServer.getViaArbitration();
- if (serverInfo == null) {
- applicationServer.set(Level.SEVERE, null, "Arbitration Server Error");
+ applicationServer.set(Level.SEVERE, ex, "Error parsing server property [%s]", appServerUri);
}
}
applicationServer.setServerInfo(serverInfo);
}
applicationServer.checkAlive();
-
- arbitrationServer.report();
applicationServer.report();
}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java
index cef7e3ea216..6fe914ae27f 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java
@@ -15,7 +15,6 @@ import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.client.CoreClientConstants;
-import org.eclipse.osee.framework.core.client.OseeClientProperties;
import org.eclipse.osee.framework.core.client.internal.CoreClientActivator;
import org.eclipse.osee.framework.core.client.internal.OseeApplicationServer;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
@@ -67,11 +66,6 @@ public final class HttpUrlBuilderClient {
return normalize(address);
}
- public String getArbitrationServerPrefix() {
- String address = OseeClientProperties.getOseeArbitrationServer();
- return normalize(address);
- }
-
public String getPermanentBaseUrl() throws OseeCoreException {
String address = OseeInfo.getValue("osee.permanent.base.url");
return normalize(address);
@@ -113,15 +107,6 @@ public final class HttpUrlBuilderClient {
}
}
- public String getOsgiArbitrationServiceUrl(String context, Map<String, String> parameters) throws OseeCoreException {
- try {
- return HttpUrlBuilder.createURL(getArbitrationServerPrefix(), context, parameters);
- } catch (UnsupportedEncodingException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
public String getPermanentLinkBaseUrl(String context, Map<String, String> parameters) throws OseeCoreException {
try {
return HttpUrlBuilder.createURL(getSelectedPermanenrLinkUrl(), context, parameters);

Back to the top