Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.casemodule.services.TagsManager Class Reference

Inherits Closeable.

Classes

class  TagNameAlreadyExistsException
 

Public Member Functions

synchronized BlackboardArtifactTag addBlackboardArtifactTag (BlackboardArtifact artifact, TagName tagName) throws TskCoreException
 
synchronized BlackboardArtifactTag addBlackboardArtifactTag (BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException
 
ContentTag addContentTag (Content content, TagName tagName) throws TskCoreException
 
ContentTag addContentTag (Content content, TagName tagName, String comment) throws TskCoreException
 
ContentTag addContentTag (Content content, TagName tagName, String comment, long beginByteOffset, long endByteOffset) throws TskCoreException
 
synchronized TagName addTagName (String displayName) throws TagNameAlreadyExistsException, TskCoreException
 
synchronized TagName addTagName (String displayName, String description) throws TagNameAlreadyExistsException, TskCoreException
 
synchronized TagName addTagName (String displayName, String description, TagName.HTML_COLOR color) throws TagNameAlreadyExistsException, TskCoreException
 
synchronized void close () throws IOException
 
synchronized void deleteBlackboardArtifactTag (BlackboardArtifactTag tag) throws TskCoreException
 
void deleteContentTag (ContentTag tag) throws TskCoreException
 
synchronized List< BlackboardArtifactTaggetAllBlackboardArtifactTags () throws TskCoreException
 
synchronized List< ContentTaggetAllContentTags () throws TskCoreException
 
List< TagNamegetAllTagNames () throws TskCoreException
 
synchronized BlackboardArtifactTag getBlackboardArtifactTagByTagID (long tagId) throws TskCoreException
 
synchronized List< BlackboardArtifactTaggetBlackboardArtifactTagsByArtifact (BlackboardArtifact artifact) throws TskCoreException
 
synchronized List< BlackboardArtifactTaggetBlackboardArtifactTagsByTagName (TagName tagName) throws TskCoreException
 
synchronized long getBlackboardArtifactTagsCountByTagName (TagName tagName) throws TskCoreException
 
synchronized ContentTag getContentTagByTagID (long tagId) throws TskCoreException
 
synchronized List< ContentTaggetContentTagsByContent (Content content) throws TskCoreException
 
synchronized List< ContentTaggetContentTagsByTagName (TagName tagName) throws TskCoreException
 
synchronized long getContentTagsCountByTagName (TagName tagName) throws TskCoreException
 
synchronized Map< String, TagNamegetDisplayNamesToTagNamesMap () throws TskCoreException
 
List< TagNamegetTagNamesInUse () throws TskCoreException
 
synchronized boolean tagNameExists (String tagDisplayName)
 

Static Public Member Functions

static boolean containsIllegalCharacters (String content)
 

Private Attributes

final SleuthkitCase caseDb
 

Static Private Attributes

static final Logger LOGGER = Logger.getLogger(TagsManager.class.getName())
 
static final Set< String > STANDARD_TAG_DISPLAY_NAMES = new HashSet<>(Arrays.asList(Bundle.TagsManager_predefTagNames_bookmark_text()))
 

Detailed Description

A per case Autopsy service that manages the addition of content and artifact tags to the case database.

Definition at line 45 of file TagsManager.java.

Member Function Documentation

synchronized BlackboardArtifactTag org.sleuthkit.autopsy.casemodule.services.TagsManager.addBlackboardArtifactTag ( BlackboardArtifact  artifact,
TagName  tagName 
) throws TskCoreException

Tags an artifact.

Parameters
artifactThe artifact to tag.
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
Returns
A BlackboardArtifactTag object representing the new tag.
Exceptions
TskCoreExceptionIf there is an error adding the tag to the case database.

Definition at line 358 of file TagsManager.java.

Referenced by org.sleuthkit.autopsy.actions.AddBlackboardArtifactTagAction.addTag().

synchronized BlackboardArtifactTag org.sleuthkit.autopsy.casemodule.services.TagsManager.addBlackboardArtifactTag ( BlackboardArtifact  artifact,
TagName  tagName,
String  comment 
) throws TskCoreException

Tags an artifact.

Parameters
artifactThe artifact to tag.
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
commentA comment to store with the tag.
Returns
A BlackboardArtifactTag object representing the new tag.
Exceptions
TskCoreExceptionIf there is an error adding the tag to the case database.

Definition at line 376 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.addBlackboardArtifactTag(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCase(), and org.sleuthkit.autopsy.casemodule.Case.notifyBlackBoardArtifactTagAdded().

ContentTag org.sleuthkit.autopsy.casemodule.services.TagsManager.addContentTag ( Content  content,
TagName  tagName 
) throws TskCoreException

Tags a content object.

Parameters
contentThe content to tag.
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
Returns
A ContentTag object representing the new tag.
Exceptions
TskCoreExceptionIf there is an error adding the tag to the case database.

Definition at line 207 of file TagsManager.java.

Referenced by org.sleuthkit.autopsy.casemodule.services.TagsManager.addContentTag(), and org.sleuthkit.autopsy.actions.AddContentTagAction.addTag().

ContentTag org.sleuthkit.autopsy.casemodule.services.TagsManager.addContentTag ( Content  content,
TagName  tagName,
String  comment 
) throws TskCoreException

Tags a content object.

Parameters
contentThe content to tag.
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
commentA comment to store with the tag.
Returns
A ContentTag object representing the new tag.
Exceptions
TskCoreExceptionIf there is an error adding the tag to the case database.

Definition at line 225 of file TagsManager.java.

References org.sleuthkit.autopsy.casemodule.services.TagsManager.addContentTag().

ContentTag org.sleuthkit.autopsy.casemodule.services.TagsManager.addContentTag ( Content  content,
TagName  tagName,
String  comment,
long  beginByteOffset,
long  endByteOffset 
) throws TskCoreException

Tags a content object or a section of a content object.

Parameters
contentThe content to tag.
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
commentA comment to store with the tag.
beginByteOffsetDesignates the beginning of a tagged section.
endByteOffsetDesignates the end of a tagged section.
Returns
A ContentTag object representing the new tag.
Exceptions
TskCoreExceptionIf there is an error adding the tag to the case database.

Definition at line 245 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.addContentTag(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCase(), and org.sleuthkit.autopsy.casemodule.Case.notifyContentTagAdded().

synchronized TagName org.sleuthkit.autopsy.casemodule.services.TagsManager.addTagName ( String  displayName) throws TagNameAlreadyExistsException, TskCoreException

Adds a tag name entry to the case database and adds a corresponding tag type to the current user's custom tag types.

Parameters
displayNameThe display name for the new tag type.
Returns
A TagName representing the tag name database entry that can be used to add instances of the tag type to the case database.
Exceptions
TagNameAlreadyExistsExceptionIf the tag name already exists in the case database.
TskCoreExceptionIf there is an error adding the tag name to the case database.

Definition at line 136 of file TagsManager.java.

References org::sleuthkit::datamodel::TagName::HTML_COLOR.NONE.

Referenced by org.sleuthkit.autopsy.casemodule.services.TagsManager.addTagName(), org.sleuthkit.autopsy.actions.AddTagAction.TagMenu.getAndAddTag(), org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog.okButtonActionPerformed(), and org.sleuthkit.autopsy.actions.GetTagNameDialog.okButtonActionPerformed().

synchronized TagName org.sleuthkit.autopsy.casemodule.services.TagsManager.addTagName ( String  displayName,
String  description 
) throws TagNameAlreadyExistsException, TskCoreException

Adds a tag name entry to the case database and adds a corresponding tag type to the current user's custom tag types.

Parameters
displayNameThe display name for the new tag type.
descriptionThe description for the new tag type.
Returns
A TagName object that can be used to add instances of the tag type to the case database.
Exceptions
TagNameAlreadyExistsExceptionIf the tag name already exists in the case database.
TskCoreExceptionIf there is an error adding the tag name to the case database.

Definition at line 155 of file TagsManager.java.

References org.sleuthkit.autopsy.casemodule.services.TagsManager.addTagName(), and org::sleuthkit::datamodel::TagName::HTML_COLOR.NONE.

synchronized TagName org.sleuthkit.autopsy.casemodule.services.TagsManager.addTagName ( String  displayName,
String  description,
TagName.HTML_COLOR  color 
) throws TagNameAlreadyExistsException, TskCoreException

Adds a tag name entry to the case database and adds a corresponding tag type to the current user's custom tag types.

Parameters
displayNameThe display name for the new tag type.
descriptionThe description for the new tag type.
colorThe color to associate with the new tag type.
Returns
A TagName object that can be used to add instances of the tag type to the case database.
Exceptions
TagNameAlreadyExistsExceptionIf the tag name already exists.
TskCoreExceptionIf there is an error adding the tag name to the case database.

Definition at line 174 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.addTagName(), and org::sleuthkit::datamodel::SleuthkitCase.getAllTagNames().

synchronized void org.sleuthkit.autopsy.casemodule.services.TagsManager.close ( ) throws IOException

Closes the tags manager.

Exceptions
IOExceptionIf there is a problem closing the tags manager.
Deprecated:
Tags manager clients should not close the tags manager.

Definition at line 536 of file TagsManager.java.

static boolean org.sleuthkit.autopsy.casemodule.services.TagsManager.containsIllegalCharacters ( String  content)
static

Returns true if the tag display name contains an illegal character. Used after a tag display name is retrieved from user input.

Parameters
contentDisplay name of the tag being added.
Returns
boolean indicating whether the name has an invalid character.

Definition at line 485 of file TagsManager.java.

Referenced by org.sleuthkit.autopsy.actions.GetTagNameDialog.okButtonActionPerformed().

synchronized void org.sleuthkit.autopsy.casemodule.services.TagsManager.deleteBlackboardArtifactTag ( BlackboardArtifactTag  tag) throws TskCoreException

Deletes an artifact tag.

Parameters
tagThe tag to delete.
Exceptions
TskCoreExceptionIf there is an error deleting the tag from the case database.

Definition at line 394 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.deleteBlackboardArtifactTag(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCase(), and org.sleuthkit.autopsy.casemodule.Case.notifyBlackBoardArtifactTagDeleted().

Referenced by org.sleuthkit.autopsy.actions.DeleteBlackboardArtifactTagAction.actionPerformed().

void org.sleuthkit.autopsy.casemodule.services.TagsManager.deleteContentTag ( ContentTag  tag) throws TskCoreException

Deletes a content tag.

Parameters
tagThe tag to delete.
Exceptions
TskCoreExceptionIf there is an error deleting the tag from the case database.

Definition at line 264 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.deleteContentTag(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCase(), and org.sleuthkit.autopsy.casemodule.Case.notifyContentTagDeleted().

Referenced by org.sleuthkit.autopsy.actions.DeleteContentTagAction.actionPerformed().

synchronized List<BlackboardArtifactTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getAllBlackboardArtifactTags ( ) throws TskCoreException

Gets all artifact tags for the current case.

Returns
A list, possibly empty, of artifact tags.
Exceptions
TskCoreExceptionIf there is an error getting the tags from the case database.

Definition at line 411 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getAllBlackboardArtifactTags().

Referenced by org.sleuthkit.autopsy.timeline.db.EventsRepository.DBPopulationWorker.call().

synchronized List<ContentTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getAllContentTags ( ) throws TskCoreException

Gets all content tags for the current case.

Returns
A list, possibly empty, of content tags.
Exceptions
TskCoreExceptionIf there is an error getting the tags from the case database.

Definition at line 281 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getAllContentTags().

Referenced by org.sleuthkit.autopsy.timeline.db.EventsRepository.DBPopulationWorker.call().

List<TagName> org.sleuthkit.autopsy.casemodule.services.TagsManager.getAllTagNames ( ) throws TskCoreException

Gets a list of all tag names currently in the case database.

Returns
A list, possibly empty, of TagName objects.
Exceptions
TskCoreExceptionIf there is an error querying the case database.

Definition at line 69 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getAllTagNames().

synchronized BlackboardArtifactTag org.sleuthkit.autopsy.casemodule.services.TagsManager.getBlackboardArtifactTagByTagID ( long  tagId) throws TskCoreException

Gets an artifact tag by tag id.

Parameters
tagIdThe tag id of interest.
Returns
The artifact tag with the specified tag id.
Exceptions
TskCoreExceptionIf there is an error getting the tag from the case database.

Definition at line 441 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getBlackboardArtifactTagByID().

synchronized List<BlackboardArtifactTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getBlackboardArtifactTagsByArtifact ( BlackboardArtifact  artifact) throws TskCoreException

Gets artifact tags for a particular artifact.

Parameters
artifactThe artifact of interest.
Returns
A list, possibly empty, of the tags that have been applied to the artifact.
Exceptions
TskCoreExceptionIf there is an error getting the tags from the case database.

Definition at line 473 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getBlackboardArtifactTagsByArtifact().

Referenced by org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode.createSheet(), org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel.handleArtifactTagDeleted(), org.sleuthkit.autopsy.timeline.db.EventsRepository.DBPopulationWorker.insertEventForArtifact(), and org.sleuthkit.autopsy.timeline.ui.listvew.ListTimeline.TaggedCell.updateItem().

synchronized List<BlackboardArtifactTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getBlackboardArtifactTagsByTagName ( TagName  tagName) throws TskCoreException

Gets artifact tags by tag name.

Parameters
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
Returns
A list, possibly empty, of the artifact tags with the specified tag name.
Exceptions
TskCoreExceptionIf there is an error getting the tags from the case database.

Definition at line 458 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getBlackboardArtifactTagsByTagName().

Referenced by org.sleuthkit.autopsy.datamodel.Tags.BlackboardArtifactTagNodeFactory.createKeys().

synchronized long org.sleuthkit.autopsy.casemodule.services.TagsManager.getBlackboardArtifactTagsCountByTagName ( TagName  tagName) throws TskCoreException

Gets an artifact tags count by tag name.

Parameters
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
Returns
A count of the artifact tags with the specified tag name.
Exceptions
TskCoreExceptionIf there is an error getting the tags count from the case database.

Definition at line 427 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getBlackboardArtifactTagsCountByTagName().

Referenced by org.sleuthkit.autopsy.datamodel.Tags.TagNameNode.updateDisplayName(), and org.sleuthkit.autopsy.datamodel.Tags.BlackboardArtifactTagTypeNode.updateDisplayName().

synchronized ContentTag org.sleuthkit.autopsy.casemodule.services.TagsManager.getContentTagByTagID ( long  tagId) throws TskCoreException

Gets a content tag by tag id.

Parameters
tagIdThe tag id of interest.
Returns
The content tag with the specified tag id.
Exceptions
TskCoreExceptionIf there is an error getting the tag from the case database.

Definition at line 311 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getContentTagByID().

synchronized List<ContentTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getContentTagsByContent ( Content  content) throws TskCoreException
synchronized List<ContentTag> org.sleuthkit.autopsy.casemodule.services.TagsManager.getContentTagsByTagName ( TagName  tagName) throws TskCoreException

Gets content tags by tag name.

Parameters
tagNameThe tag name of interest.
Returns
A list, possibly empty, of the content tags with the specified tag name.
Exceptions
TskCoreExceptionIf there is an error getting the tags from the case database.

Definition at line 326 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getContentTagsByTagName().

Referenced by org.sleuthkit.autopsy.datamodel.Tags.ContentTagNodeFactory.createKeys(), and org.sleuthkit.autopsy.report.taggedhashes.AddTaggedHashesToHashDb.generateReport().

synchronized long org.sleuthkit.autopsy.casemodule.services.TagsManager.getContentTagsCountByTagName ( TagName  tagName) throws TskCoreException

Gets content tags count by tag name.

Parameters
tagNameThe representation of the desired tag type in the case database, which can be obtained by calling getTagNames and/or addTagName.
Returns
A count of the content tags with the specified tag name.
Exceptions
TskCoreExceptionIf there is an error getting the tags count from the case database.

Definition at line 297 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getContentTagsCountByTagName().

Referenced by org.sleuthkit.autopsy.datamodel.Tags.TagNameNode.updateDisplayName(), and org.sleuthkit.autopsy.datamodel.Tags.ContentTagTypeNode.updateDisplayName().

synchronized Map<String, TagName> org.sleuthkit.autopsy.casemodule.services.TagsManager.getDisplayNamesToTagNamesMap ( ) throws TskCoreException

Gets a map of tag display names to tag name entries in the case database. It has keys for the display names of the standard tag types, the current user's custom tag types, and the tags in the case database. The value for a given key will be null if the corresponding tag type is defined, but a tag name entry has not yet added to the case database. In that case, addTagName may be called to add the tag name entry.

Returns
A map of tag display names to possibly null TagName object references.
Exceptions
TskCoreExceptionif there is an error querying the case database.

Order is important here. The keys (display names) for the current user's custom tag types are added to the map first, with null TagName values. If tag name entries exist for those keys, loading of the tag names from the database supplies the missing values. Standard tag names are added during the initialization of the case database.

Note that creating the map on demand increases the probability that the display names of newly added custom tag types and the display names of tags added to a multi-user case by other users appear in the map.

Definition at line 98 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getAllTagNames().

Referenced by org.sleuthkit.autopsy.actions.AddBookmarkTagAction.actionPerformed(), org.sleuthkit.autopsy.actions.GetTagNameDialog.display(), org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog.display(), org.sleuthkit.autopsy.actions.AddTagAction.TagMenu.getAndAddTag(), org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog.okButtonActionPerformed(), org.sleuthkit.autopsy.actions.GetTagNameDialog.okButtonActionPerformed(), and org.sleuthkit.autopsy.casemodule.services.TagsManager.tagNameExists().

List<TagName> org.sleuthkit.autopsy.casemodule.services.TagsManager.getTagNamesInUse ( ) throws TskCoreException

Gets a list of all tag names currently in use in the case database for tagging content or artifacts.

Returns
A list, possibly empty, of TagName objects.
Exceptions
TskCoreExceptionIf there is an error querying the case database.

Definition at line 81 of file TagsManager.java.

References org::sleuthkit::datamodel::SleuthkitCase.getTagNamesInUse().

Referenced by org.sleuthkit.autopsy.datamodel.Tags.TagNameNodeFactory.createKeys().

synchronized boolean org.sleuthkit.autopsy.casemodule.services.TagsManager.tagNameExists ( String  tagDisplayName)

Checks whether a tag name with a given display name exists in the case database.

Parameters
tagDisplayNameThe display name.
Returns
True or false.
Deprecated:
Not reliable for multi-user cases.

Definition at line 518 of file TagsManager.java.

References org.sleuthkit.autopsy.casemodule.services.TagsManager.getDisplayNamesToTagNamesMap().

Member Data Documentation

final SleuthkitCase org.sleuthkit.autopsy.casemodule.services.TagsManager.caseDb
private

Definition at line 50 of file TagsManager.java.

final Logger org.sleuthkit.autopsy.casemodule.services.TagsManager.LOGGER = Logger.getLogger(TagsManager.class.getName())
staticprivate

Definition at line 47 of file TagsManager.java.

final Set<String> org.sleuthkit.autopsy.casemodule.services.TagsManager.STANDARD_TAG_DISPLAY_NAMES = new HashSet<>(Arrays.asList(Bundle.TagsManager_predefTagNames_bookmark_text()))
staticprivate

Definition at line 49 of file TagsManager.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2016 Basis Technology. Generated on: Mon Apr 24 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.