diff options
author | rbrooks | 2010-09-16 20:32:48 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2010-09-16 20:32:48 +0000 |
commit | f0f991b4f728f2e7550016da91eb2e8d2c8c750c (patch) | |
tree | 7ad402016cbf8810f6f6ffe43c3a7dccab95f402 /plugins/org.eclipse.osee.framework.search.engine | |
parent | 445b78e7fdb5067609dd91f8b348ea91313ecedc (diff) | |
download | org.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.search.engine')
7 files changed, 24 insertions, 27 deletions
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/ITaggerStatistics.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/ITaggerStatistics.java index 9b37f4801cc..7f8dbd74689 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/ITaggerStatistics.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/ITaggerStatistics.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.search.engine; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; /** * @author Roberto E. Escobar @@ -39,8 +39,8 @@ public interface ITaggerStatistics { public ITagItemStatistics getMostTagsTask(); - public long getTagsInSystem() throws OseeDataStoreException; + public long getTagsInSystem() throws OseeCoreException; - public long getTotalQueryIdsInQueue() throws OseeDataStoreException; + public long getTotalQueryIdsInQueue() throws OseeCoreException; } diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java index ab1f80b8d7c..5035cba685c 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Set; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.core.model.type.AttributeType; import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.IOseeStatement; @@ -51,7 +50,7 @@ public final class AttributeDataStore { // Utility Class } - public static Collection<AttributeData> getAttribute(final OseeConnection connection, final int tagQueueQueryId) throws OseeDataStoreException { + public static Collection<AttributeData> getAttribute(final OseeConnection connection, final int tagQueueQueryId) throws OseeCoreException { final Collection<AttributeData> attributeData = new ArrayList<AttributeData>(); IOseeStatement chStmt = ConnectionHandler.getStatement(connection); @@ -132,7 +131,7 @@ public final class AttributeDataStore { return builder.toString(); } - public static int getTotalTaggableItems(OseeConnection connection, final int branchId) throws OseeDataStoreException { + public static int getTotalTaggableItems(OseeConnection connection, final int branchId) throws OseeCoreException { return ConnectionHandler.runPreparedQueryFetchInt(connection, -1, getBranchTaggingQueries(branchId, true), getAllTaggableGammasByBranchQueryData(branchId)); } diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputStreamTagProcessor.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputStreamTagProcessor.java index 6d862fc6867..96fd817c5d6 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputStreamTagProcessor.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputStreamTagProcessor.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.search.engine.internal.tagger; import java.io.InputStream; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.database.core.OseeConnection; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler; @@ -53,7 +53,7 @@ final class InputStreamTagProcessor extends InputToTagQueueTx { } @Override - public void startElementFound(String uri, String localName, String name, Attributes attributes) throws NumberFormatException, OseeDataStoreException { + public void startElementFound(String uri, String localName, String name, Attributes attributes) throws NumberFormatException, OseeCoreException { if (name.equalsIgnoreCase("entry")) { String gammaId = attributes.getValue("gammaId"); if (Strings.isValid(gammaId)) { diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java index 7d1d1539228..62aed94fe04 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java @@ -14,7 +14,6 @@ package org.eclipse.osee.framework.search.engine.internal.tagger; import java.util.ArrayList; import java.util.List; 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.database.core.DbTransaction; import org.eclipse.osee.framework.database.core.JoinUtility; @@ -84,7 +83,7 @@ public abstract class InputToTagQueueTx extends DbTransaction { } } - protected void addEntry(OseeConnection connection, long gammaId) throws OseeDataStoreException { + protected void addEntry(OseeConnection connection, long gammaId) throws OseeCoreException { if (currentJoinQuery == null) { currentJoinQuery = JoinUtility.createTagQueueJoinQuery(); } @@ -98,7 +97,7 @@ public abstract class InputToTagQueueTx extends DbTransaction { return this.isCacheAll != true && this.currentJoinQuery != null && this.currentJoinQuery.size() > this.cacheLimit; } - private void storeQueryIds(OseeConnection connection) throws OseeDataStoreException { + private void storeQueryIds(OseeConnection connection) throws OseeCoreException { if (currentJoinQuery != null && !currentJoinQuery.isEmpty()) { currentJoinQuery.store(connection); queryIds.add(currentJoinQuery.getQueryId()); diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java index 292521246a5..e9aecf2875d 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java @@ -17,7 +17,6 @@ import java.util.LinkedList; 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.database.core.DbTransaction; import org.eclipse.osee.framework.database.core.JoinUtility; import org.eclipse.osee.framework.database.core.JoinUtility.JoinItem; @@ -130,7 +129,7 @@ class TaggerRunnable implements Runnable { this.currentTag = null; } - private Collection<AttributeData> getDataFromQueryId(OseeConnection connection, int queryId, final int numberOfRetries) throws OseeDataStoreException { + private Collection<AttributeData> getDataFromQueryId(OseeConnection connection, int queryId, final int numberOfRetries) throws OseeCoreException { Collection<AttributeData> attributeDatas = AttributeDataStore.getAttribute(connection, getTagQueueQueryId()); // Re-try in case query id hasn't been committed to the database int retry = 0; @@ -194,7 +193,7 @@ class TaggerRunnable implements Runnable { } } - private void checkSizeStoreIfNeeded(OseeConnection connection) throws OseeDataStoreException { + private void checkSizeStoreIfNeeded(OseeConnection connection) throws OseeCoreException { int cummulative = 0; boolean needsStorage = false; for (SearchTag item : this.searchTags) { @@ -209,7 +208,7 @@ class TaggerRunnable implements Runnable { } } - private void store(OseeConnection connection, Collection<SearchTag> toStore) throws OseeDataStoreException { + private void store(OseeConnection connection, Collection<SearchTag> toStore) throws OseeCoreException { tagDataStore.storeTags(connection, toStore); for (SearchTag item : toStore) { item.clearCache(); diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerStatistics.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerStatistics.java index 692916d3fe3..1de85775aa9 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerStatistics.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerStatistics.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.search.engine.internal.tagger; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.search.engine.ITagItemStatistics; import org.eclipse.osee.framework.search.engine.ITaggerStatistics; import org.eclipse.osee.framework.search.engine.TagListenerAdapter; @@ -115,12 +115,12 @@ public class TaggerStatistics extends TagListenerAdapter implements Cloneable, I } @Override - public long getTagsInSystem() throws OseeDataStoreException { + public long getTagsInSystem() throws OseeCoreException { return tagDataStore != null ? tagDataStore.getTotalTags() : 0; } @Override - public long getTotalQueryIdsInQueue() throws OseeDataStoreException { + public long getTotalQueryIdsInQueue() throws OseeCoreException { return tagDataStore != null ? tagDataStore.getTotalQueryIdsInQueue() : 0; } diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagDataStore.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagDataStore.java index ff5400f2aaa..06e788a5963 100644 --- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagDataStore.java +++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/utility/SearchTagDataStore.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.eclipse.osee.framework.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.database.IOseeDatabaseService; import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.IOseeStatement; @@ -47,15 +47,15 @@ public class SearchTagDataStore { this.databaseService = databaseService; } - public long getTotalQueryIdsInQueue() throws OseeDataStoreException { + public long getTotalQueryIdsInQueue() throws OseeCoreException { return databaseService.runPreparedQueryFetchObject(-1L, SELECT_TOTAL_QUERY_IDS_IN_QUEUE); } - public long getTotalTags() throws OseeDataStoreException { + public long getTotalTags() throws OseeCoreException { return databaseService.runPreparedQueryFetchObject(-1L, SELECT_TOTAL_TAGS); } - public int deleteTags(OseeConnection connection, int queryId) throws OseeDataStoreException { + public int deleteTags(OseeConnection connection, int queryId) throws OseeCoreException { int numberDeleted = 0; IOseeStatement chStmt = databaseService.getStatement(connection); try { @@ -73,11 +73,11 @@ public class SearchTagDataStore { return numberDeleted; } - public int deleteTags(OseeConnection connection, Collection<IAttributeLocator> locators) throws OseeDataStoreException { + public int deleteTags(OseeConnection connection, Collection<IAttributeLocator> locators) throws OseeCoreException { return deleteTags(connection, locators.toArray(new IAttributeLocator[locators.size()])); } - public int deleteTags(OseeConnection connection, IAttributeLocator... locators) throws OseeDataStoreException { + public int deleteTags(OseeConnection connection, IAttributeLocator... locators) throws OseeCoreException { int numberDeleted = 0; if (locators.length > 0) { List<Object[]> datas = new ArrayList<Object[]>(); @@ -89,11 +89,11 @@ public class SearchTagDataStore { return numberDeleted; } - public int storeTags(OseeConnection connection, Collection<SearchTag> searchTags) throws OseeDataStoreException { + public int storeTags(OseeConnection connection, Collection<SearchTag> searchTags) throws OseeCoreException { return storeTags(connection, searchTags.toArray(new SearchTag[searchTags.size()])); } - public static int storeTags(OseeConnection connection, SearchTag... searchTags) throws OseeDataStoreException { + public static int storeTags(OseeConnection connection, SearchTag... searchTags) throws OseeCoreException { int updated = 0; if (searchTags != null && searchTags.length > 0) { for (SearchTag searchTag : searchTags) { @@ -111,7 +111,7 @@ public class SearchTagDataStore { return fetchTagEntries(connection, codedTags.toArray(new Long[codedTags.size()])); } - public static Set<IAttributeLocator> fetchTagEntries(OseeConnection connection, Long... codedTags) throws OseeDataStoreException { + public static Set<IAttributeLocator> fetchTagEntries(OseeConnection connection, Long... codedTags) throws OseeCoreException { final Set<IAttributeLocator> toReturn = new HashSet<IAttributeLocator>(); for (Long codedTag : codedTags) { |