Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-02-13 18:28:09 +0000
committerGerrit Code Review @ Eclipse.org2014-02-14 15:20:29 +0000
commitfb6097ff70b4111c928cf28d219b79dad3a75180 (patch)
treeeb433f59fbe5cdcc3781d15349494d9203d1acd5 /plugins/org.eclipse.osee.framework.core.client
parent53dd0408b571cd1a5c4c1232b7558680ed534de6 (diff)
downloadorg.eclipse.osee-fb6097ff70b4111c928cf28d219b79dad3a75180.tar.gz
org.eclipse.osee-fb6097ff70b4111c928cf28d219b79dad3a75180.tar.xz
org.eclipse.osee-fb6097ff70b4111c928cf28d219b79dad3a75180.zip
bug[ats_ATS21609]: Server showing Unavailable in OSEE Configuration
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/internal/ApplicationServer.java43
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java63
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeServer.java49
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/server/HttpUrlBuilderClient.java4
4 files changed, 2 insertions, 157 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ApplicationServer.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ApplicationServer.java
deleted file mode 100644
index e0177d1adaf..00000000000
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/ApplicationServer.java
+++ /dev/null
@@ -1,43 +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 org.eclipse.osee.framework.core.data.OseeServerInfo;
-
-public class ApplicationServer extends OseeServer {
- private OseeServerInfo serverInfo;
- private String serverAddress;
-
- public ApplicationServer() {
- super("Application Server");
- }
-
- public boolean isServerInfoValid() {
- return serverInfo != null;
- }
-
- public OseeServerInfo getServerInfo() {
- return serverInfo;
- }
-
- public void setServerInfo(OseeServerInfo serverInfo) {
- this.serverInfo = serverInfo;
- this.serverAddress = null;
- }
-
- public String getServerAddress() {
- if (serverAddress == null && serverInfo != null) {
- serverAddress = serverInfo.getUri().toString();
- }
- return serverAddress;
- }
-
-}
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
deleted file mode 100644
index d0cc17474f6..00000000000
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeApplicationServer.java
+++ /dev/null
@@ -1,63 +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.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;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Andrew M. Finkbeiner
- * @author Donald G. Dunne
- */
-public class OseeApplicationServer {
-
- private static final ApplicationServer applicationServer = new ApplicationServer();
-
- private OseeApplicationServer() {
- // private constructor
- }
-
- public static String getOseeApplicationServer() throws OseeCoreException {
- checkAndUpdateStatus();
- String serverAddress = applicationServer.getServerAddress();
- Conditions.checkNotNull(serverAddress, "resource server address");
- return serverAddress;
- }
-
- private synchronized static void checkAndUpdateStatus() {
- if (!applicationServer.isServerInfoValid()) {
- OseeServerInfo serverInfo = null;
- String appServerUri = OseeClientProperties.getOseeApplicationServer();
- if (Strings.isValid(appServerUri)) {
- try {
- serverInfo =
- 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 server property [%s]", appServerUri);
- }
- }
- applicationServer.setServerInfo(serverInfo);
- }
- applicationServer.report();
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeServer.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeServer.java
deleted file mode 100644
index bab951a93a3..00000000000
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/OseeServer.java
+++ /dev/null
@@ -1,49 +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.util.logging.Level;
-import org.eclipse.osee.framework.logging.BaseStatus;
-import org.eclipse.osee.framework.logging.IHealthStatus;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-public abstract class OseeServer {
-
- private final String name;
- private IHealthStatus status;
-
- public OseeServer(String serverName) {
- this.name = serverName;
- }
-
- public void set(Level level, Exception ex, String message, Object... args) {
- Level myLevel = level;
- if (myLevel == null) {
- myLevel = Level.INFO;
- }
- status = new BaseStatus(getName(), myLevel, ex, message, args);
- }
-
- public String getName() {
- return name;
- }
-
- public void report() {
- if (status == null) {
- status = new BaseStatus(name, Level.INFO, null, (Throwable) null);
- }
- OseeLog.reportStatus(new BaseStatus(name, status.getLevel(), status.getException(), "%s: %s %s",
- status.getLevel(), status.getMessage(),
- (status.getException() != null ? "[" + status.getException().getLocalizedMessage() + "]" : "")));
- OseeLog.log(OseeApplicationServer.class, status.getLevel(), status.getMessage(), status.getException());
- }
-
-}
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 6fe914ae27f..7fc4462a8f1 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,8 +15,8 @@ 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;
import org.eclipse.osee.framework.database.core.OseeInfo;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -62,7 +62,7 @@ public final class HttpUrlBuilderClient {
}
public String getApplicationServerPrefix() throws OseeCoreException {
- String address = OseeApplicationServer.getOseeApplicationServer();
+ String address = OseeClientProperties.getOseeApplicationServer();
return normalize(address);
}

Back to the top