diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee')
33 files changed, 87 insertions, 102 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/BootStrapUser.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/BootStrapUser.java index 75c0f1bad50..3cfe21181b2 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/BootStrapUser.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/BootStrapUser.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core; import org.eclipse.osee.framework.core.data.SystemUser; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; /** * @author Ryan D. Brooks @@ -21,14 +21,11 @@ public class BootStrapUser extends User { public static BootStrapUser instance; - private BootStrapUser() throws OseeDataStoreException { + private BootStrapUser() throws OseeCoreException { super(null, null, null, null, null); } - /** - * @return the instance - */ - public static BootStrapUser getInstance() throws OseeDataStoreException { + public static BootStrapUser getInstance() throws OseeCoreException { if (instance == null) { instance = new BootStrapUser(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java index 1b2ebbc4201..ac5d773d9e5 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/User.java @@ -20,7 +20,6 @@ import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.type.ArtifactType; @@ -42,7 +41,7 @@ public class User extends Artifact { SystemGroup.Everyone.addMember(this); } - public User(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeDataStoreException { + public User(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeCoreException { super(parentFactory, guid, humanReadableId, branch, artifactType); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java index 7dec479b5aa..7aa5feb89b9 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java @@ -118,7 +118,7 @@ public class Artifact extends NamedIdentity implements IArtifact, IAdaptable, Co private ModificationType lastValidModType; private EditState objectEditState; - public Artifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeDataStoreException { + public Artifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeCoreException { super(guid, ""); objectEditState = EditState.NO_CHANGE; modType = ModificationType.NEW; @@ -1230,12 +1230,12 @@ public class Artifact extends NamedIdentity implements IArtifact, IAdaptable, Co return humanReadableId; } - private void populateHumanReadableID() throws OseeDataStoreException { + private void populateHumanReadableID() throws OseeCoreException { String hrid = HumanReadableId.generate(); humanReadableId = isUniqueHRID(hrid) ? hrid : HumanReadableId.generate(); } - public static boolean isUniqueHRID(String id) throws OseeDataStoreException { + public static boolean isUniqueHRID(String id) throws OseeCoreException { String DUPLICATE_HRID_SEARCH = "select count(1) from (select DISTINCT(art_id) from osee_artifact where human_readable_id = ?) t1"; return ConnectionHandler.runPreparedQueryFetchLong(0L, DUPLICATE_HRID_SEARCH, id) <= 0; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java index 0cef4667f6f..0f3ef820447 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java @@ -230,14 +230,14 @@ public final class ArtifactLoader { /** * must be call in a try block with a finally clause which calls clearQuery() */ - public static int insertIntoArtifactJoin(OseeConnection connection, List<Object[]> insertParameters) throws OseeDataStoreException { + public static int insertIntoArtifactJoin(OseeConnection connection, List<Object[]> insertParameters) throws OseeCoreException { return ConnectionHandler.runBatchUpdate(connection, INSERT_JOIN_ARTIFACT, insertParameters); } /** * must be call in a try block with a finally clause which calls clearQuery() */ - public static int insertIntoArtifactJoin(List<Object[]> insertParameters) throws OseeDataStoreException { + public static int insertIntoArtifactJoin(List<Object[]> insertParameters) throws OseeCoreException { return insertIntoArtifactJoin(null, insertParameters); } @@ -247,7 +247,7 @@ public final class ArtifactLoader { * @param queryId value gotten from call to getNewQueryId and used in populating the insert parameters for * selectArtifacts */ - public static void clearQuery(int queryId) throws OseeDataStoreException { + public static void clearQuery(int queryId) throws OseeCoreException { ConnectionHandler.runPreparedUpdate(DELETE_FROM_JOIN_ARTIFACT, queryId); } @@ -257,7 +257,7 @@ public final class ArtifactLoader { * @param queryId value gotten from call to getNewQueryId and used in populating the insert parameters for * selectArtifacts */ - public static void clearQuery(OseeConnection connection, int queryId) throws OseeDataStoreException { + public static void clearQuery(OseeConnection connection, int queryId) throws OseeCoreException { if (connection != null) { ConnectionHandler.runPreparedUpdate(connection, DELETE_FROM_JOIN_ARTIFACT, queryId); } else { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java index bae06821d7f..5ac5d8cabb3 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java @@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.OseeStateException; import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist; import org.eclipse.osee.framework.core.model.Branch; @@ -263,7 +264,7 @@ public class ArtifactTypeManager { } } } catch (Exception ex) { - throw new OseeCoreException(ex); + OseeExceptions.wrapAndThrow(ex); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java index e3f1078d698..2068479d188 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java @@ -144,7 +144,8 @@ public abstract class Attribute<T> { } return response; } catch (IOException ex) { - throw new OseeCoreException(ex); + OseeExceptions.wrapAndThrow(ex); + return false; // unreachable since wrapAndThrow() always throws an exception } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java index 18eaf666e41..d149105f955 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java @@ -22,7 +22,6 @@ import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.IOseeStatement; import org.eclipse.osee.framework.database.core.OseeSql; @@ -85,7 +84,7 @@ public class AttributeLoader { // do nothing } - public AttrData(IOseeStatement chStmt, boolean historical) throws OseeDataStoreException { + public AttrData(IOseeStatement chStmt, boolean historical) throws OseeCoreException { artifactId = chStmt.getInt("art_id"); branchId = chStmt.getInt("branch_id"); attrId = chStmt.getInt("attr_id"); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java index d8160cf4735..772a08ee550 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Set; import java.util.logging.Level; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.database.IOseeDatabaseService; import org.eclipse.osee.framework.database.core.ConnectionHandler; @@ -184,7 +183,7 @@ public class PurgeArtifacts extends DbTransaction { } } - public void insertSelectItems(OseeConnection connection, String tableName, String artifactJoinSql, int transactionJoinId, Timestamp insertTime, int queryId) throws OseeDataStoreException { + public void insertSelectItems(OseeConnection connection, String tableName, String artifactJoinSql, int transactionJoinId, Timestamp insertTime, int queryId) throws OseeCoreException { IOseeDatabaseService databaseService = Activator.getInstance().getOseeDatabaseService(); String sql = String.format(INSERT_SELECT_ITEM, tableName, artifactJoinSql); databaseService.runPreparedUpdate(connection, sql, transactionJoinId, insertTime, queryId); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionOperation.java index 9ee1c365a67..c57f22065a8 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionOperation.java @@ -20,7 +20,6 @@ import java.util.Set; import java.util.logging.Level; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.TransactionDoesNotExist; import org.eclipse.osee.framework.core.model.Branch; @@ -199,7 +198,7 @@ public class PurgeTransactionOperation extends AbstractDbTxOperation { return null; } - private void getAffectedArtifacts(OseeConnection connection, int transactionQueryId) throws OseeDataStoreException { + private void getAffectedArtifacts(OseeConnection connection, int transactionQueryId) throws OseeCoreException { artifactJoinId = ArtifactLoader.getNewQueryId(); ConnectionHandler.runPreparedUpdate(connection, LOAD_ARTIFACTS, artifactJoinId, transactionQueryId, artifactJoinId, transactionQueryId, artifactJoinId, transactionQueryId, artifactJoinId, transactionQueryId); @@ -234,13 +233,13 @@ public class PurgeTransactionOperation extends AbstractDbTxOperation { return fromToTxData; } - private void deleteTransactionsFromTxDetails(OseeConnection connection, IProgressMonitor monitor, int queryId, double workPercentage) throws OseeDataStoreException { + private void deleteTransactionsFromTxDetails(OseeConnection connection, IProgressMonitor monitor, int queryId, double workPercentage) throws OseeCoreException { monitor.subTask("Deleting Tx"); ConnectionHandler.runPreparedUpdate(connection, DELETE_TRANSACTION_FROM_TRANSACTION_DETAILS, queryId); monitor.worked(calculateWork(workPercentage)); } - private void deleteItemEntriesForTransactions(OseeConnection connection, IProgressMonitor monitor, int txsToDeleteQueryId, double workPercentage) throws OseeDataStoreException { + private void deleteItemEntriesForTransactions(OseeConnection connection, IProgressMonitor monitor, int txsToDeleteQueryId, double workPercentage) throws OseeCoreException { monitor.subTask("Deleting Tx Items"); TransactionJoinQuery txGammasToDelete = JoinUtility.createTransactionJoinQuery(); try { @@ -260,7 +259,7 @@ public class PurgeTransactionOperation extends AbstractDbTxOperation { monitor.worked(calculateWork(workPercentage)); } - private void populateJoinQueryFromSql(OseeConnection connection, TransactionJoinQuery joinQuery, String sql, String txFieldName, Object... data) throws OseeDataStoreException { + private void populateJoinQueryFromSql(OseeConnection connection, TransactionJoinQuery joinQuery, String sql, String txFieldName, Object... data) throws OseeCoreException { IOseeStatement chStmt = ConnectionHandler.getStatement(connection); try { chStmt.runPreparedQuery(sql, data); @@ -272,7 +271,7 @@ public class PurgeTransactionOperation extends AbstractDbTxOperation { } } - private void updateTxCurrent(OseeConnection conn, IProgressMonitor monitor, double workPercentage) throws OseeDataStoreException { + private void updateTxCurrent(OseeConnection conn, IProgressMonitor monitor, double workPercentage) throws OseeCoreException { monitor.setTaskName("Updating Previous Tx to Current"); ConnectionHandler.runPreparedUpdate(conn, UPDATE_TXS, artifactJoinId, artifactJoinId, artifactJoinId); monitor.worked(calculateWork(workPercentage)); @@ -284,7 +283,7 @@ public class PurgeTransactionOperation extends AbstractDbTxOperation { } } - private void setChildBranchBaselineTxs(OseeConnection connection, IProgressMonitor monitor, HashCollection<Branch, TxDeleteInfo> transactions, double workPercentage) throws OseeDataStoreException { + private void setChildBranchBaselineTxs(OseeConnection connection, IProgressMonitor monitor, HashCollection<Branch, TxDeleteInfo> transactions, double workPercentage) throws OseeCoreException { List<Object[]> data = new ArrayList<Object[]>(); monitor.setTaskName("Update Baseline Txs for Child Branches"); for (TxDeleteInfo entry : transactions.getValues()) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/RevertAction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/RevertAction.java index b7006271085..bf6d801fc30 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/RevertAction.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/RevertAction.java @@ -163,7 +163,7 @@ public class RevertAction { System.out.println(String.format(" Displayed all the data in %s", Lib.getElapseString(time))); } - private void setTxCurrentForRevertedObjects() throws OseeDataStoreException { + private void setTxCurrentForRevertedObjects() throws OseeCoreException { int count2; long time = System.currentTimeMillis(); count2 = ConnectionHandler.runBatchUpdate(connection, SET_TX_CURRENT_REVERT, gammaIdsBaseline); @@ -176,7 +176,7 @@ public class RevertAction { } } - private void updateArtifactVersionTxCurrents(int branchId, int artId) throws OseeDataStoreException { + private void updateArtifactVersionTxCurrents(int branchId, int artId) throws OseeCoreException { if (DEBUG) { IOseeStatement chStmt = ConnectionHandler.getStatement(connection); try { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UpdateMergeBranch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UpdateMergeBranch.java index f1fbecb5976..9a1afdd82a4 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UpdateMergeBranch.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/UpdateMergeBranch.java @@ -22,7 +22,6 @@ import org.eclipse.osee.framework.core.client.ClientSessionManager; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.enums.TxChange; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.DbTransaction; @@ -183,7 +182,7 @@ public class UpdateMergeBranch extends DbTransaction { } } - private static void insertGammas(OseeConnection connection, String sql, int baselineTransactionNumber, int queryId, Branch sourceBranch, Branch mergeBranch) throws OseeDataStoreException { + private static void insertGammas(OseeConnection connection, String sql, int baselineTransactionNumber, int queryId, Branch sourceBranch, Branch mergeBranch) throws OseeCoreException { ConnectionHandler.runPreparedUpdate(connection, sql, baselineTransactionNumber, TxChange.CURRENT.getValue(), mergeBranch.getId(), sourceBranch.getId(), queryId); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/operation/ArtifactOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/operation/ArtifactOperation.java index 3bd6f902efe..5c29173eefe 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/operation/ArtifactOperation.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/operation/ArtifactOperation.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.artifact.operation; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.type.ArtifactType; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -25,7 +25,7 @@ public abstract class ArtifactOperation extends Artifact implements WorkflowStep public static final String PROVIDES_ACCEPTABLE_INPUT = "Provides Acceptable Input"; public static final String ARTIFACT_NAME = "Artifact Operation"; - public ArtifactOperation(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeDataStoreException { + public ArtifactOperation(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) throws OseeCoreException { super(parentFactory, guid, humanReadableId, branch, artifactType); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AbstractArtifactSearchCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AbstractArtifactSearchCriteria.java index 3a7feeef443..916fd7c6b8f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AbstractArtifactSearchCriteria.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AbstractArtifactSearchCriteria.java @@ -25,7 +25,7 @@ public abstract class AbstractArtifactSearchCriteria { public abstract void addJoinArtId(ArtifactQueryBuilder builder, boolean left) throws OseeDataStoreException; @SuppressWarnings("unused") - public void cleanUp() throws OseeDataStoreException { + public void cleanUp() throws OseeCoreException { // provided for subclass implementation } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java index 9dbb95031bc..827b3985d46 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java @@ -28,7 +28,6 @@ import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.exception.OseeWrappedException; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.database.core.ConnectionHandler; @@ -375,7 +374,7 @@ public class ArtifactQueryBuilder { return query; } - private void addToGuidJoin() throws OseeDataStoreException { + private void addToGuidJoin() throws OseeCoreException { guidJoinQuery = JoinUtility.createCharJoinQuery(ClientSessionManager.getSessionId()); for (String guid : guids) { guidJoinQuery.add(guid); @@ -483,7 +482,7 @@ public class ArtifactQueryBuilder { } } - private void clearCriteria() throws OseeDataStoreException { + private void clearCriteria() throws OseeCoreException { if (this.criteria != null) { for (AbstractArtifactSearchCriteria critiri : criteria) { critiri.cleanUp(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java index 4b1ac658555..c23fd105e9f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java @@ -214,7 +214,7 @@ public class AttributeCriteria extends AbstractArtifactSearchCriteria { } @Override - public void cleanUp() throws OseeDataStoreException { + public void cleanUp() throws OseeCoreException { if (joinQuery != null) { joinQuery.delete(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeExtensionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeExtensionManager.java index a6508d61b20..27ddccfe84b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeExtensionManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeExtensionManager.java @@ -20,8 +20,8 @@ import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.Platform; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.OseeStateException; -import org.eclipse.osee.framework.core.exception.OseeWrappedException; import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.plugin.core.util.ExtensionPoints; @@ -94,13 +94,13 @@ public class AttributeExtensionManager { } @SuppressWarnings("unchecked") - private <T> Class<T> loadClass(String bundleName, String className) throws OseeWrappedException { + private <T> Class<T> loadClass(String bundleName, String className) throws OseeCoreException { Class<T> toReturn = null; try { Bundle bundle = Platform.getBundle(bundleName); toReturn = bundle.loadClass(className); } catch (ClassNotFoundException ex) { - throw new OseeWrappedException(String.format("Unable to Load: [%s - %s]", bundleName, className), ex); + OseeExceptions.wrapAndThrow(ex); } return toReturn; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeResourceProcessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeResourceProcessor.java index 08b7c3540f1..de738722d1b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeResourceProcessor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeResourceProcessor.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.skynet.core.attribute; import java.net.MalformedURLException; import java.net.URL; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.OseeStateException; import org.eclipse.osee.framework.skynet.core.artifact.Attribute; import org.eclipse.osee.framework.skynet.core.attribute.providers.DataStore; @@ -44,16 +44,13 @@ public class AttributeResourceProcessor extends AbstractResourceProcessor { try { return AttributeURL.getStorageURL(seed, name, extension); } catch (MalformedURLException ex) { - throw new OseeDataStoreException(ex); + OseeExceptions.wrapAndThrow(ex); + return null; // unreachable since wrapAndThrow() always throws an exception } } @Override - public String createStorageName() throws OseeDataStoreException { - try { - return BinaryContentUtils.getStorageName(attribute); - } catch (OseeStateException ex) { - throw new OseeDataStoreException(ex); - } + public String createStorageName() throws OseeStateException { + return BinaryContentUtils.getStorageName(attribute); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/CompressedContentAttribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/CompressedContentAttribute.java index 81fe123e3e6..865bf9b61df 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/CompressedContentAttribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/CompressedContentAttribute.java @@ -54,7 +54,8 @@ public final class CompressedContentAttribute extends BinaryAttribute<InputStrea try { return Lib.stringToInputStream(value); } catch (Exception ex) { - throw new OseeCoreException(ex); + OseeExceptions.wrapAndThrow(ex); + return null; // unreachable since wrapAndThrow() always throws an exception } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/WordAttribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/WordAttribute.java index bed894200c7..b9b900dc53d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/WordAttribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/WordAttribute.java @@ -51,9 +51,9 @@ public class WordAttribute extends StringAttribute { "This document contains track changes and cannot be saved with them. Do you want OSEE to remove them?" + "\n\nNote:You will need to reopen this artifact in OSEE to see the final result.")) { returnValue = WordAnnotationHandler.removeAnnotations(value); } else { - throw new OseeCoreException( + throw new OseeCoreException(String.format( "Artifact %s (%s), Branch %s (%s) contains track changes. Please remove them and save again.", - art.getName(), art.getArtId(), branch.getName(), branch.getId()); + art.getName(), art.getArtId(), branch.getName(), branch.getId())); } } catch (CoreException ex) { OseeExceptions.wrapAndThrow(ex); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DataStore.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DataStore.java index 92dea39059f..842ec33684a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DataStore.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DataStore.java @@ -14,7 +14,6 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.Arrays; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.skynet.core.attribute.utils.AbstractResourceProcessor; /** @@ -84,7 +83,7 @@ public class DataStore { } } - public void purge() throws OseeDataStoreException { + public void purge() throws OseeCoreException { if (isLocatorValid() != false) { resourceProcessor.purge(this); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DefaultAttributeDataProvider.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DefaultAttributeDataProvider.java index 15398680dfb..9e8513550a4 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DefaultAttributeDataProvider.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/DefaultAttributeDataProvider.java @@ -14,7 +14,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeExceptions; -import org.eclipse.osee.framework.core.exception.OseeWrappedException; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.skynet.core.artifact.Attribute; import org.eclipse.osee.framework.skynet.core.attribute.AttributeResourceProcessor; @@ -57,7 +56,7 @@ public class DefaultAttributeDataProvider extends AbstractAttributeDataProvider fromStorage = new String(data, "UTF-8"); } } catch (IOException ex) { - throw new OseeWrappedException("Error retrieving data.", ex); + OseeExceptions.wrapAndThrow(ex); } String toReturn = fromStorage != null ? fromStorage : rawStringValue; return toReturn != null ? toReturn : ""; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/UriAttributeDataProvider.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/UriAttributeDataProvider.java index 73a254e8071..c555555703f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/UriAttributeDataProvider.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/providers/UriAttributeDataProvider.java @@ -16,7 +16,7 @@ import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.Arrays; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeWrappedException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.skynet.core.artifact.Attribute; import org.eclipse.osee.framework.skynet.core.attribute.AttributeResourceProcessor; @@ -68,7 +68,7 @@ public class UriAttributeDataProvider extends AbstractAttributeDataProvider impl } } } catch (IOException ex) { - throw new OseeWrappedException("Error committing data. ", ex); + OseeExceptions.wrapAndThrow(ex); } return response; } @@ -81,7 +81,7 @@ public class UriAttributeDataProvider extends AbstractAttributeDataProvider impl try { decompressed = ByteBuffer.wrap(Lib.decompressBytes(new ByteArrayInputStream(rawData))); } catch (IOException ex) { - throw new OseeWrappedException("Error acquiring data. - ", ex); + OseeExceptions.wrapAndThrow(ex); } } @@ -96,7 +96,7 @@ public class UriAttributeDataProvider extends AbstractAttributeDataProvider impl try { toReturn = new String(data.array(), "UTF-8"); } catch (UnsupportedEncodingException ex) { - throw new OseeWrappedException("Error encoding data.", ex); + OseeExceptions.wrapAndThrow(ex); } } else { toReturn = ""; @@ -111,7 +111,7 @@ public class UriAttributeDataProvider extends AbstractAttributeDataProvider impl try { toSet = ByteBuffer.wrap(value.getBytes("UTF-8")); } catch (UnsupportedEncodingException ex) { - throw new OseeWrappedException("Error encoding data.", ex); + OseeExceptions.wrapAndThrow(ex); } } setValue(toSet); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AbstractResourceProcessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AbstractResourceProcessor.java index 80a6c949f23..f4fc3975432 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AbstractResourceProcessor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AbstractResourceProcessor.java @@ -17,6 +17,7 @@ import java.net.URI; import java.net.URL; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; 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; @@ -33,7 +34,7 @@ public abstract class AbstractResourceProcessor { protected abstract URL getStorageURL(int seed, String name, String extension) throws OseeCoreException; - public abstract String createStorageName() throws OseeDataStoreException; + public abstract String createStorageName() throws OseeCoreException; public void saveResource(int seed, String name, DataStore dataStore) throws OseeCoreException { URL url = getStorageURL(seed, name, dataStore.getExtension()); @@ -42,7 +43,7 @@ public abstract class AbstractResourceProcessor { URI uri = HttpProcessor.save(url, inputStream, dataStore.getContentType(), dataStore.getEncoding()); dataStore.setLocator(uri.toASCIIString()); } catch (Exception ex) { - throw new OseeDataStoreException("Error saving resource", ex); + OseeExceptions.wrapAndThrow(ex); } finally { Lib.close(inputStream); } @@ -51,24 +52,21 @@ public abstract class AbstractResourceProcessor { public void acquire(DataStore dataStore) throws OseeCoreException { URL url = getAcquireURL(dataStore); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - AcquireResult result; try { - result = HttpProcessor.acquire(url, outputStream); + AcquireResult result = HttpProcessor.acquire(url, outputStream); + int code = result.getCode(); + if (code == HttpURLConnection.HTTP_OK) { + dataStore.setContent(outputStream.toByteArray(), "", result.getContentType(), result.getEncoding()); + } else { + throw new OseeDataStoreException(String.format("Error acquiring resource: [%s] - status code: [%s]; %s", + dataStore.getLocator(), code, new String(outputStream.toByteArray()))); + } } catch (Exception ex) { - throw new OseeDataStoreException(String.format("Error acquiring resource: [%s]", dataStore.getLocator()), ex); - } - - int code = result.getCode(); - if (code == HttpURLConnection.HTTP_OK) { - dataStore.setContent(outputStream.toByteArray(), "", result.getContentType(), result.getEncoding()); - } else { - throw new OseeDataStoreException(String.format("Error acquiring resource: [%s] - status code: [%s]; %s", - dataStore.getLocator(), code, new String(outputStream.toByteArray()))); + OseeExceptions.wrapAndThrow(ex); } } - public void purge(DataStore dataStore) throws OseeDataStoreException { - int code = -1; + public void purge(DataStore dataStore) throws OseeCoreException { try { URL url = getDeleteURL(dataStore); String response = HttpProcessor.delete(url); @@ -76,9 +74,7 @@ public abstract class AbstractResourceProcessor { dataStore.clear(); } } catch (Exception ex) { - throw new OseeDataStoreException(String.format("Error deleting resource: [%s] - status code: [%s]", - dataStore.getLocator(), code), ex); + OseeExceptions.wrapAndThrow(ex); } } - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AttributeURL.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AttributeURL.java index 340cec72063..6735d6a3969 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AttributeURL.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/utils/AttributeURL.java @@ -52,7 +52,7 @@ public class AttributeURL { return new URL(urlString); } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); - return null; // unreachable because wrapAndThrow always throws an exception + return null; // unreachable since wrapAndThrow() always throws an exception } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java index 354152ed421..6f4730f5c8b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java @@ -24,6 +24,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.OseeStateException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; @@ -386,7 +387,7 @@ public class AttributeConflict extends Conflict { inputStream1.reset(); inputStream2.reset(); } catch (IOException ex) { - throw new OseeCoreException(ex); + OseeExceptions.wrapAndThrow(ex); } return equals; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictStatusManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictStatusManager.java index ecba147201b..07d6c7bee11 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictStatusManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/ConflictStatusManager.java @@ -14,7 +14,6 @@ package org.eclipse.osee.framework.skynet.core.conflict; import org.eclipse.osee.framework.core.enums.ConflictStatus; import org.eclipse.osee.framework.core.enums.ConflictType; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.IOseeStatement; @@ -35,7 +34,7 @@ public class ConflictStatusManager { private static final String MERGE_BRANCH_GAMMAS = "UPDATE osee_txs SET gamma_id = ? where (transaction_id, gamma_id) = (SELECT tx.transaction_id, tx.gamma_id FROM osee_txs tx, osee_attribute atr WHERE tx.transaction_id = ? AND atr.gamma_id = tx.gamma_id AND atr.attr_id = ? )"; - public static void setStatus(ConflictStatus status, int sourceGamma, int destGamma, int mergeBranchId) throws OseeDataStoreException { + public static void setStatus(ConflictStatus status, int sourceGamma, int destGamma, int mergeBranchId) throws OseeCoreException { IOseeStatement chStmt = ConnectionHandler.getStatement(); //Gammas should be up to date so you can use them to get entry just update the status field. try { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java index 9568840ea6e..83e901a00da 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java @@ -30,7 +30,6 @@ import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.type.RelationType; import org.eclipse.osee.framework.database.core.ConnectionHandler; @@ -670,7 +669,7 @@ public class RelationManager { /** * Remove all relations stored in the list awaiting to be deleted. */ - public static void purgeRelationsFor(Artifact artifact) throws OseeDataStoreException { + public static void purgeRelationsFor(Artifact artifact) throws OseeCoreException { Collection<RelationLink> links = getFlattenedList(relationsByType.getValues(threadLocalKey.get().getKey(artifact))); if (!links.isEmpty()) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java index 4ca675cd660..93c9e2f4e09 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ChangeData.java @@ -15,6 +15,7 @@ import java.util.HashSet; import java.util.Set; import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.util.Conditions; import org.eclipse.osee.framework.jdk.core.util.Collections; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -63,7 +64,8 @@ public class ChangeData { } return foundChanges; } catch (Exception ex) { - throw new OseeCoreException(ex); + OseeExceptions.wrapAndThrow(ex); + return null; // unreachable since wrapAndThrow() always throws an exception } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java index 0bafdeffc38..24d2a1bcf83 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java @@ -26,7 +26,6 @@ import org.eclipse.osee.framework.core.enums.ModificationType; import org.eclipse.osee.framework.core.exception.BranchMergeException; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.database.core.ConnectionHandler; @@ -297,7 +296,7 @@ public class ConflictManagerInternal { /** * @return Returns True if the destination gamma does not exist on a branch else false if it does. */ - private static boolean isAttributeConflictValidOnBranch(int destinationGammaId, Branch branch, int endTransactionNumber) throws OseeDataStoreException { + private static boolean isAttributeConflictValidOnBranch(int destinationGammaId, Branch branch, int endTransactionNumber) throws OseeCoreException { String sql = "select count(1) from osee_txs txs where txs.gamma_id = ? and txs.branch_id = ? and txs.transaction_id <= ?"; return ConnectionHandler.runPreparedQueryFetchInt(0, sql, destinationGammaId, branch.getId(), diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java index 6ff6ea4a769..1d28cd0d64b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java @@ -82,7 +82,7 @@ public final class SkynetTransaction extends AbstractOperation { this(BranchManager.getBranch(branch), comment); } - private int getNewAttributeId(Artifact artifact, Attribute<?> attribute) throws OseeDataStoreException { + private int getNewAttributeId(Artifact artifact, Attribute<?> attribute) throws OseeCoreException { IOseeStatement chStmt = ConnectionHandler.getStatement(); AttributeType attributeType = attribute.getAttributeType(); int attrId = -1; @@ -105,7 +105,7 @@ public final class SkynetTransaction extends AbstractOperation { return attrId; } - private int getNewRelationId() throws OseeDataStoreException { + private int getNewRelationId() throws OseeCoreException { return ConnectionHandler.getSequence().getNextRelationId(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java index 319d87b7ba7..cef3217e87f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java @@ -21,7 +21,6 @@ import org.eclipse.osee.framework.core.client.ClientSessionManager; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.TransactionDetailsType; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.exception.TransactionDoesNotExist; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.core.model.TransactionRecord; @@ -85,7 +84,7 @@ public final class TransactionManager { } @SuppressWarnings("unchecked") - public static void setTransactionComment(TransactionRecord transaction, String comment) throws OseeDataStoreException { + public static void setTransactionComment(TransactionRecord transaction, String comment) throws OseeCoreException { ConnectionHandler.runPreparedUpdate(UPDATE_TRANSACTION_COMMENTS, comment, transaction.getId()); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java index 1695d08161b..06c92dd0672 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java @@ -13,8 +13,9 @@ package org.eclipse.osee.framework.skynet.core.transaction; import java.util.Map; import java.util.WeakHashMap; import java.util.logging.Level; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.exception.OseeStateException; -import org.eclipse.osee.framework.core.exception.OseeWrappedException; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.internal.Activator; @@ -51,13 +52,13 @@ public class TransactionMonitor { txMap.put(key, new TxOperation(transaction)); } - public synchronized void reportTxStart(final Object transaction, Object key) throws OseeWrappedException, OseeStateException { + public synchronized void reportTxStart(final Object transaction, Object key) throws OseeCoreException { TxOperation currentTx = txMap.get(key); if (currentTx == null) { throw new OseeStateException( "reportTxStart called for key: " + key + " but reportTxCreation had not been called."); } else if (currentTx.getState() != TxState.CREATED) { - throw new OseeWrappedException(currentTx.getError()); + OseeExceptions.wrapAndThrow(currentTx.getError()); } if (currentTx.getTransaction().equals(transaction)) { @@ -68,7 +69,7 @@ public class TransactionMonitor { } } - public synchronized void reportTxEnd(final Object transaction, Object key) throws OseeWrappedException, OseeStateException { + public synchronized void reportTxEnd(final Object transaction, Object key) throws OseeCoreException { TxOperation currentTx = txMap.get(key); if (currentTx == null) { throw new OseeStateException( @@ -80,7 +81,7 @@ public class TransactionMonitor { if (currentTx.getTransaction().equals(transaction)) { txMap.put(key, null); } else { - throw new OseeWrappedException(currentTx.getError()); + OseeExceptions.wrapAndThrow(currentTx.getError()); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java index a071357870b..7194f0d37dc 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.skynet.core.utility; import java.util.Collection; import java.util.Map; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.database.core.ConnectionHandler; /** @@ -25,13 +25,13 @@ public final class DbUtil { // Utility Class - class should only have static methods } - public static void getTableRowCounts(Map<String, Integer> tableCount, Collection<String> tableNames) throws OseeDataStoreException { + public static void getTableRowCounts(Map<String, Integer> tableCount, Collection<String> tableNames) throws OseeCoreException { for (String tableName : tableNames) { tableCount.put(tableName, getTableRowCount(tableName)); } } - public static int getTableRowCount(String tableName) throws OseeDataStoreException { + public static int getTableRowCount(String tableName) throws OseeCoreException { return ConnectionHandler.runPreparedQueryFetchInt(0, "SELECT count(1) FROM " + tableName); } |