Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-16 20:32:48 +0000
committerRyan D. Brooks2010-09-16 20:32:48 +0000
commitf0f991b4f728f2e7550016da91eb2e8d2c8c750c (patch)
tree7ad402016cbf8810f6f6ffe43c3a7dccab95f402 /plugins/org.eclipse.osee.framework.core.server
parent445b78e7fdb5067609dd91f8b348ea91313ecedc (diff)
downloadorg.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.tar.gz
org.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.tar.xz
org.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.zip
refactor: Utilize utility method OseeExceptions.wrapAndThrow instead of in-place code
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.server')
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerDataStore.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerLookup.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/compatibility/OseeSql_0_9_1.java4
4 files changed, 10 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerDataStore.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerDataStore.java
index 6538f51d3b5..b120cd45666 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerDataStore.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerDataStore.java
@@ -51,7 +51,7 @@ public class ApplicationServerDataStore {
private static final String SELECT_SUPPORTED_VERSIONS_FROM_LOOKUP_TABLE_BY_SERVER_ID =
"SELECT version_id FROM osee_server_lookup where server_id = ?";
- static void removeByServerId(Collection<OseeServerInfo> infos) throws OseeDataStoreException {
+ static void removeByServerId(Collection<OseeServerInfo> infos) throws OseeCoreException {
if (!infos.isEmpty()) {
List<Object[]> data = new ArrayList<Object[]>();
for (OseeServerInfo info : infos) {
@@ -99,7 +99,7 @@ public class ApplicationServerDataStore {
}
@SuppressWarnings("unchecked")
- static boolean updateServerState(OseeServerInfo applicationServerInfo, boolean state) throws OseeDataStoreException {
+ static boolean updateServerState(OseeServerInfo applicationServerInfo, boolean state) throws OseeCoreException {
ConnectionHandler.runPreparedUpdate(UPDATE_LOOKUP_TABLE, state ? 1 : 0, applicationServerInfo.getServerAddress(),
applicationServerInfo.getPort());
return true;
@@ -118,7 +118,7 @@ public class ApplicationServerDataStore {
return result;
}
- static Collection<OseeServerInfo> getApplicationServerInfos(String clientVersion) throws OseeDataStoreException {
+ static Collection<OseeServerInfo> getApplicationServerInfos(String clientVersion) throws OseeCoreException {
CompositeKeyHashMap<String, Integer, OseeServerInfo> servers =
new CompositeKeyHashMap<String, Integer, OseeServerInfo>();
if (Strings.isValid(clientVersion)) {
@@ -159,7 +159,7 @@ public class ApplicationServerDataStore {
return servers.values();
}
- static Collection<OseeServerInfo> getAllApplicationServerInfos() throws OseeDataStoreException {
+ static Collection<OseeServerInfo> getAllApplicationServerInfos() throws OseeCoreException {
Collection<OseeServerInfo> infos = new ArrayList<OseeServerInfo>();
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
@@ -198,7 +198,7 @@ public class ApplicationServerDataStore {
return supportedVersions;
}
- static int getNumberOfSessions(String serverId) throws OseeDataStoreException {
+ static int getNumberOfSessions(String serverId) throws OseeCoreException {
return ConnectionHandler.runPreparedQueryFetchInt(0, GET_NUMBER_OF_SESSIONS, serverId);
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerLookup.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerLookup.java
index eecbfbfccd5..2109afc2651 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerLookup.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerLookup.java
@@ -69,7 +69,7 @@ public class ApplicationServerLookup implements IApplicationServerLookup {
public void run() {
try {
ApplicationServerDataStore.removeByServerId(unHealthyServers);
- } catch (OseeDataStoreException ex) {
+ } catch (OseeCoreException ex) {
OseeLog.log(ServerActivator.class, Level.SEVERE,
String.format("Error removing unhealthy server entries: [%s]", unHealthyServers), ex);
}
@@ -79,7 +79,7 @@ public class ApplicationServerLookup implements IApplicationServerLookup {
}
}
- private OseeServerInfo getBestAvailable(Collection<OseeServerInfo> infos) {
+ private OseeServerInfo getBestAvailable(Collection<OseeServerInfo> infos) throws OseeCoreException {
OseeServerInfo result = null;
if (infos.size() == 1) {
result = infos.iterator().next();
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
index 920c6f62ba1..2cfb9d6d2c4 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/ApplicationServerManager.java
@@ -27,7 +27,6 @@ import java.util.concurrent.ThreadFactory;
import java.util.logging.Level;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.operation.OperationJob;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.server.OseeHttpServlet;
@@ -148,7 +147,7 @@ public class ApplicationServerManager implements IApplicationServerManager {
}
@Override
- public synchronized void setServletRequestsAllowed(final boolean value) throws OseeDataStoreException {
+ public synchronized void setServletRequestsAllowed(final boolean value) throws OseeCoreException {
if (getApplicationServerInfo().isAcceptingRequests() != value) {
boolean wasSuccessful = ApplicationServerDataStore.updateServerState(getApplicationServerInfo(), value);
if (wasSuccessful) {
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/compatibility/OseeSql_0_9_1.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/compatibility/OseeSql_0_9_1.java
index 9e567dc6893..17981068f88 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/compatibility/OseeSql_0_9_1.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/compatibility/OseeSql_0_9_1.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.enums.ConflictStatus;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.core.SupportedDatabase;
/**
@@ -78,7 +78,7 @@ public enum OseeSql_0_9_1 {
this(sql, null);
}
- public static Properties getSqlProperties(DatabaseMetaData metaData) throws OseeDataStoreException {
+ public static Properties getSqlProperties(DatabaseMetaData metaData) throws OseeCoreException {
Properties sqlProperties = new Properties();
boolean areHintsSupported = SupportedDatabase.areHintsSupported(metaData);
for (OseeSql_0_9_1 oseeSql : OseeSql_0_9_1.values()) {

Back to the top