From 28c8440343433c3d6132f26f838a91dba4d3dffc Mon Sep 17 00:00:00 2001 From: jmillman Date: Mon, 29 Jun 2015 17:39:04 -0400 Subject: [PATCH] add getXXXTagByTagId methods to TagsManager --- .../casemodule/services/TagsManager.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index 01daae9fba..53af35f31e 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -311,6 +311,24 @@ public class TagsManager implements Closeable { return tskCase.getContentTagsCountByTagName(tagName); } + /** + * Gets a content tag by tag id. + * + * @param tagID The tag id of interest. + * + * @return the content tag with the specified tag id. + * + * @throws TskCoreException + */ + public synchronized ContentTag getContentTagByTagID(long tagID) throws TskCoreException { + // @@@ This is a work around to be removed when database access on the EDT is correctly synchronized. + if (!tagNamesInitialized) { + getExistingTagNames(); + } + + return tskCase.getContentTagByID(tagID); + } + /** * Gets content tags by tag name. * @@ -447,6 +465,24 @@ public class TagsManager implements Closeable { return tskCase.getBlackboardArtifactTagsCountByTagName(tagName); } + /** + * Gets a blackboard artifact tag by tag id. + * + * @param tagID The tag id of interest. + * + * @return the blackboard artifact tag with the specified tag id. + * + * @throws TskCoreException + */ + public synchronized BlackboardArtifactTag getBlackboardArtifactTagByTagID(long tagID) throws TskCoreException { + // @@@ This is a work around to be removed when database access on the EDT is correctly synchronized. + if (!tagNamesInitialized) { + getExistingTagNames(); + } + + return tskCase.getBlackboardArtifactTagByID(tagID); + } + /** * Gets blackboard artifact tags by tag name. *