diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact')
13 files changed, 28 insertions, 31 deletions
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(); } |