From caec6850992868d15bec1d53fb6d6e48d3ad5aeb Mon Sep 17 00:00:00 2001 From: Brian Carrier <carrier@sleuthkit.org> Date: Mon, 1 Jul 2019 23:49:52 -0400 Subject: [PATCH] removed timeline package to start reducing public API --- .../{timeline => }/ArtifactEventType.java | 21 ++-- .../org/sleuthkit/datamodel/Bundle.properties | 47 +++++++- .../{timeline => }/BundleProvider.java | 4 +- .../sleuthkit/datamodel/Bundle_ja.properties | 42 +++++++ .../sleuthkit/datamodel/DescriptionLoD.java | 57 ---------- .../datamodel/{timeline => }/EventType.java | 103 ++++++++++++------ ...ndardEventType.java => EventTypeImpl.java} | 17 ++- .../datamodel/{timeline => }/EventTypes.java | 19 ++-- ....java => PredefinedArtifactEventType.java} | 15 +-- .../SingeLevelEventDiscription.java | 8 +- .../SingleDescriptionArtifactEventType.java | 13 +-- .../ThreeLevelEventDescription.java | 19 ++-- .../{timeline => }/TimelineEvent.java | 60 +++++++--- .../{timeline => }/TimelineFilter.java | 5 +- .../sleuthkit/datamodel/TimelineManager.java | 16 +-- .../datamodel/timeline/Bundle.properties | 44 -------- .../datamodel/timeline/Bundle_ja.properties | 42 ------- .../timeline/EventTypeZoomLevel.java | 51 --------- 18 files changed, 267 insertions(+), 316 deletions(-) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/ArtifactEventType.java (81%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/BundleProvider.java (91%) delete mode 100644 bindings/java/src/org/sleuthkit/datamodel/DescriptionLoD.java rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/EventType.java (81%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline/StandardEventType.java => EventTypeImpl.java} (85%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/EventTypes.java (85%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline/StandardArtifactEventType.java => PredefinedArtifactEventType.java} (92%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/SingeLevelEventDiscription.java (60%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/SingleDescriptionArtifactEventType.java (83%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/ThreeLevelEventDescription.java (70%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/TimelineEvent.java (79%) rename bindings/java/src/org/sleuthkit/datamodel/{timeline => }/TimelineFilter.java (99%) delete mode 100644 bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle.properties delete mode 100644 bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle_ja.properties delete mode 100644 bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypeZoomLevel.java diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/ArtifactEventType.java b/bindings/java/src/org/sleuthkit/datamodel/ArtifactEventType.java similarity index 81% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/ArtifactEventType.java rename to bindings/java/src/org/sleuthkit/datamodel/ArtifactEventType.java index 3979ba154..988058e30 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/ArtifactEventType.java +++ b/bindings/java/src/org/sleuthkit/datamodel/ArtifactEventType.java @@ -16,30 +16,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; -import org.sleuthkit.datamodel.TskCoreException; /** * Interface for EventTypes that are derived from Artifacts. */ -public interface ArtifactEventType extends EventType { +abstract class ArtifactEventType implements EventType { /** * Get the artifact type this event type is derived from. * * @return The artifact type this event type is derived from. */ - BlackboardArtifact.Type getArtifactType(); + abstract BlackboardArtifact.Type getArtifactType(); /** * The attribute type this event type is derived from. * * @return The attribute type this event type is derived from. */ - BlackboardAttribute.Type getDateTimeAttributeType(); + abstract BlackboardAttribute.Type getDateTimeAttributeType(); /** * Extract the full description for an event of this type from the given @@ -52,7 +49,7 @@ public interface ArtifactEventType extends EventType { * * @throws org.sleuthkit.datamodel.TskCoreException */ - String extractFullDescription(BlackboardArtifact artifact) throws TskCoreException; + abstract String extractFullDescription(BlackboardArtifact artifact) throws TskCoreException; /** * Extract the medium description for an event of this type from the given @@ -65,7 +62,7 @@ public interface ArtifactEventType extends EventType { * * @throws org.sleuthkit.datamodel.TskCoreException */ - String extractMedDescription(BlackboardArtifact artifact) throws TskCoreException; + abstract String extractMedDescription(BlackboardArtifact artifact) throws TskCoreException; /** * Extract the short description for an event of this type from the given @@ -78,7 +75,7 @@ public interface ArtifactEventType extends EventType { * * @throws org.sleuthkit.datamodel.TskCoreException */ - String extractShortDescription(BlackboardArtifact artifact) throws TskCoreException; + abstract String extractShortDescription(BlackboardArtifact artifact) throws TskCoreException; /** * Get the ID of the the artifact type that this EventType is derived from. @@ -86,7 +83,7 @@ public interface ArtifactEventType extends EventType { * @return the ID of the the artifact type that this EventType is derived * from. */ - default int getArtifactTypeID() { + int getArtifactTypeID() { return getArtifactType().getTypeID(); } @@ -101,7 +98,7 @@ default int getArtifactTypeID() { * @throws TskCoreException is there is a problem accessing the blackboard * data */ - EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) throws TskCoreException; + abstract EventDescriptionWithTime buildEventPayload(BlackboardArtifact artifact) throws TskCoreException; /** * Bundles the event specific information derived from a BlackBoard Artifact diff --git a/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties b/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties index 26ee8d60d..723d23f62 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties +++ b/bindings/java/src/org/sleuthkit/datamodel/Bundle.properties @@ -279,4 +279,49 @@ ReviewStatus.Rejected=Rejected ReviewStatus.Undecided=Undecided DescriptionLOD.short=Short DescriptionLOD.medium=Medium -DescriptionLOD.full=Full \ No newline at end of file +DescriptionLOD.full=Full + +BaseTypes.fileSystem.name=File System +BaseTypes.webActivity.name=Web Activity +BaseTypes.miscTypes.name=Misc Types +FileSystemTypes.fileModified.name=File Modified +FileSystemTypes.fileAccessed.name=File Accessed +FileSystemTypes.fileCreated.name=File Created +FileSystemTypes.fileChanged.name=File Changed +MiscTypes.message.name=Messages +MiscTypes.GPSRoutes.name=GPS Routes +MiscTypes.GPSTrackpoint.name=Location History +MiscTypes.Calls.name=Calls +MiscTypes.Email.name=Email +MiscTypes.recentDocuments.name=Recent Documents +MiscTypes.installedPrograms.name=Installed Programs +MiscTypes.exif.name=Exif +MiscTypes.devicesAttached.name=Devices Attached +MiscTypes.LogEntry.name=Log Entry +MiscTypes.Registry.name=Registry +RootEventType.eventTypes.name=Event Types +WebTypes.webDownloads.name=Web Downloads +WebTypes.webCookies.name=Web Cookies +WebTypes.webBookmarks.name=Web Bookmarks +WebTypes.webHistory.name=Web History +WebTypes.webSearch.name=Web Searches +CustomTypes.other.name=Other +CustomTypes.userCreated.name=User Created +BaseTypes.customTypes.name=Custom Types + + +EventTypeZoomLevel.rootType=Root Type +EventTypeZoomLevel.baseType=Base Type +EventTypeZoomLevel.subType=Sub Type + +DataSourcesFilter.displayName.text=Data Source +DescriptionFilter.mode.exclude=Exclude +DescriptionFilter.mode.include=Include +hashHitsFilter.displayName.text=Hash Sets +hideKnownFilter.displayName.text=Hide Known Files +# {0} - sub filter displaynames +IntersectionFilter.displayName.text=Intersection +tagsFilter.displayName.text=Tags +TextFilter.displayName.text=Text Filter +TypeFilter.displayName.text=Event Type +FileTypesFilter.displayName.text=File Types \ No newline at end of file diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/BundleProvider.java b/bindings/java/src/org/sleuthkit/datamodel/BundleProvider.java similarity index 91% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/BundleProvider.java rename to bindings/java/src/org/sleuthkit/datamodel/BundleProvider.java index 435a46514..40cd4f727 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/BundleProvider.java +++ b/bindings/java/src/org/sleuthkit/datamodel/BundleProvider.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import java.util.ResourceBundle; @@ -25,7 +25,7 @@ */ final class BundleProvider { - private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.sleuthkit.datamodel.timeline.Bundle"); + private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle"); static ResourceBundle getBundle() { return BUNDLE; diff --git a/bindings/java/src/org/sleuthkit/datamodel/Bundle_ja.properties b/bindings/java/src/org/sleuthkit/datamodel/Bundle_ja.properties index 253b9bdf8..96d3a974b 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/Bundle_ja.properties +++ b/bindings/java/src/org/sleuthkit/datamodel/Bundle_ja.properties @@ -192,3 +192,45 @@ BlackboardAttribute.tskGeoLatitudeEnd.text=\u7d42\u4e86\u7def\u5ea6 BlackboardAttribute.tskGeoLongitudeStart.text=\u30b9\u30bf\u30fc\u30c8\u7d4c\u5ea6 BlackboardAttribute.tskGeoLongitudeEnd.text=\u7d42\u4e86\u7d4c\u5ea6 BlackboardAttribute.tskReadStatus.text=\u8aad\u3080 +BaseTypes.fileSystem.name=\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0 +BaseTypes.miscTypes.name=\u305d\u306e\u4ed6\u30bf\u30a4\u30d7 +BaseTypes.webActivity.name=\u30a6\u30a7\u30d6\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3 +FileSystemTypes.fileAccessed.name=\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb +FileSystemTypes.fileChanged.name=\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb +FileSystemTypes.fileCreated.name=\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb +FileSystemTypes.fileModified.name=\u4fee\u6b63\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb +MiscTypes.Calls.name=\u30b3\u30fc\u30eb +MiscTypes.devicesAttached.name=\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u6a5f\u5668 +MiscTypes.Email.name=Email +MiscTypes.exif.name=Exif +MiscTypes.GPSRoutes.name=GPS\u30eb\u30fc\u30c8 +MiscTypes.GPSTrackpoint.name=\u4f4d\u7f6e\u60c5\u5831\u5c65\u6b74 +MiscTypes.installedPrograms.name=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0 +MiscTypes.message.name=\u30e1\u30c3\u30bb\u30fc\u30b8 +MiscTypes.recentDocuments.name=\u6700\u8fd1\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 +RootEventType.eventTypes.name=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7 +WebTypes.webBookmarks.name=\u30a6\u30a7\u30d6\u30d6\u30c3\u30af\u30de\u30fc\u30af +WebTypes.webCookies.name=\u30a6\u30a7\u30d6\u30af\u30c3\u30ad\u30fc +WebTypes.webDownloads.name=\u30a6\u30a7\u30d6\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 +WebTypes.webHistory.name=\u30a6\u30a7\u30d6\u5c65\u6b74 +WebTypes.webSearch.name=\u30a6\u30a7\u30d6\u691c\u7d22 +EventTypeZoomLevel.baseType=\u30d9\u30fc\u30b9\u30bf\u30a4\u30d7 +EventTypeZoomLevel.rootType=\u30eb\u30fc\u30c8\u30bf\u30a4\u30d7 +EventTypeZoomLevel.subType=\u30b5\u30d6\u30bf\u30a4\u30d7 +DescriptionLOD.short=\u7c21\u6f54 +DescriptionLOD.medium=\u6982\u8981 +DescriptionLOD.full=\u8a73\u7d30 +ZoomSettingsPane.descrLODLabel.text=\u8a73\u7d30\u8aac\u660e\uff1a +ZoomSettingsPane.historyLabel.text=\u5c65\u6b74\uff1a +ZoomSettingsPane.timeUnitLabel.text=\u6642\u9593\u5358\u4f4d\uff1a +ZoomSettingsPane.typeZoomLabel.text=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\uff1a + +hideKnownFilter.displayName.text=\u65e2\u77e5\u30d5\u30a1\u30a4\u30eb\u3092\u96a0\u3059 +TextFilter.displayName.text=\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc +TypeFilter.displayName.text=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\u30d5\u30a3\u30eb\u30bf\u30fc +IntersectionFilter.displayName.text=\u30a4\u30f3\u30bf\u30fc\u30bb\u30af\u30b7\u30e7\u30f3{0} +DataSourcesFilter.displayName.text=\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9 +DescriptionFilter.mode.exclude=\u9664\u5916\u3059\u308b +DescriptionFilter.mode.include=\u542b\u3080 +hashHitsFilter.displayName.text=\u30cf\u30c3\u30b7\u30e5\u30bb\u30c3\u30c8\u306e\u30d2\u30c3\u30c8\u306e\u307f +tagsFilter.displayName.text=\u30bf\u30b0\u3055\u308c\u305f\u30a4\u30d9\u30f3\u30c8\u306e\u307f diff --git a/bindings/java/src/org/sleuthkit/datamodel/DescriptionLoD.java b/bindings/java/src/org/sleuthkit/datamodel/DescriptionLoD.java deleted file mode 100644 index a43d4a733..000000000 --- a/bindings/java/src/org/sleuthkit/datamodel/DescriptionLoD.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Sleuth Kit Data Model - * - * Copyright 2018 Basis Technology Corp. - * Contact: carrier <at> sleuthkit <dot> org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.datamodel; - -import java.util.ResourceBundle; - -/** - * Enumeration of description levels of detail (LoD). - */ -public enum DescriptionLoD { - SHORT(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.short")), - MEDIUM(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.medium")), - FULL(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.full")); - - private final String displayName; - - public String getDisplayName() { - return displayName; - } - - private DescriptionLoD(String displayName) { - this.displayName = displayName; - } - - public DescriptionLoD moreDetailed() { - try { - return values()[ordinal() + 1]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - public DescriptionLoD lessDetailed() { - try { - return values()[ordinal() - 1]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - -} diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventType.java b/bindings/java/src/org/sleuthkit/datamodel/EventType.java similarity index 81% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/EventType.java rename to bindings/java/src/org/sleuthkit/datamodel/EventType.java index 9c34f3a07..f67012311 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventType.java +++ b/bindings/java/src/org/sleuthkit/datamodel/EventType.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSortedSet; @@ -25,36 +25,42 @@ import java.util.List; import java.util.Optional; import java.util.SortedSet; -import org.sleuthkit.datamodel.BlackboardArtifact; import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.*; -import org.sleuthkit.datamodel.BlackboardAttribute; import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.*; import org.sleuthkit.datamodel.BlackboardAttribute.Type; -import static org.sleuthkit.datamodel.timeline.BundleProvider.getBundle; -import static org.sleuthkit.datamodel.timeline.EventType.RECENT_DOCUMENTS; -import static org.sleuthkit.datamodel.timeline.EventTypeZoomLevel.BASE_TYPE; -import static org.sleuthkit.datamodel.timeline.EventTypeZoomLevel.ROOT_TYPE; -import static org.sleuthkit.datamodel.timeline.EventTypeZoomLevel.SUB_TYPE; -import org.sleuthkit.datamodel.timeline.EventTypes.EmptyExtractor; -import org.sleuthkit.datamodel.timeline.EventTypes.FilePathArtifactEventType; -import org.sleuthkit.datamodel.timeline.EventTypes.FilePathEventType; -import org.sleuthkit.datamodel.timeline.EventTypes.URLArtifactEventType; -import org.sleuthkit.datamodel.timeline.StandardArtifactEventType.AttributeExtractor; -import static org.sleuthkit.datamodel.timeline.StandardArtifactEventType.getAttributeSafe; -import org.sleuthkit.datamodel.timeline.TimelineEvent.EventDescription; +import static org.sleuthkit.datamodel.BundleProvider.getBundle; +import static org.sleuthkit.datamodel.EventType.TypeLevel.BASE_TYPE; +import static org.sleuthkit.datamodel.EventType.TypeLevel.ROOT_TYPE; +import static org.sleuthkit.datamodel.EventType.TypeLevel.SUB_TYPE; +import org.sleuthkit.datamodel.EventTypes.EmptyExtractor; +import org.sleuthkit.datamodel.EventTypes.FilePathArtifactEventType; +import org.sleuthkit.datamodel.EventTypes.FilePathEventType; +import org.sleuthkit.datamodel.EventTypes.URLArtifactEventType; +import org.sleuthkit.datamodel.PredefinedArtifactEventType.AttributeExtractor; +import static org.sleuthkit.datamodel.PredefinedArtifactEventType.getAttributeSafe; +import org.sleuthkit.datamodel.TimelineEvent.EventDescription; /** - * An Event Type represents a distinct kind of event ie file system or web - * activity. An EventType may have an optional super-type and 0 or more - * subtypes, allowing events to be organized in a type hierarchy. + * Interface for distinct kinds of events (ie file system or web + * activity) in a hierarchy. An EventType may have an optional + * super-type and 0 or more subtypes. NOTE: this is not currently + * extensible by modules. The structure is hard coded. */ public interface EventType extends Comparable<EventType> { String getDisplayName(); + /** + * + * @return Unique type iD (from database) + */ long getTypeID(); - EventTypeZoomLevel getZoomLevel(); + /** + * + * @return The level that this event is in the type hierarchy. + */ + EventType.TypeLevel getTypeLevel(); /** * @return A list of EventTypes, one for each subtype of this EventTYpe, or @@ -101,12 +107,43 @@ default SortedSet<? extends EventType> getSiblingTypes() { default int compareTo(EventType otherType) { return Comparator.comparing(EventType::getTypeID).compare(this, otherType); } + + /** + * Enum of event type zoom levels. + */ + public enum TypeLevel { + /** + * The root event type zoom level. All event are the same type at this + * level. + */ + ROOT_TYPE(getBundle().getString("EventTypeZoomLevel.rootType")), + /** + * The zoom level of base event types like files system, and web activity + */ + BASE_TYPE(getBundle().getString("EventTypeZoomLevel.baseType")), + /** + * The zoom level of specific type such as file modified time, or web + * download. + */ + SUB_TYPE(getBundle().getString("EventTypeZoomLevel.subType")); + + private final String displayName; + + public String getDisplayName() { + return displayName; + } + + private TypeLevel(String displayName) { + this.displayName = displayName; + } + } + /** * The root type of all event types. No event should actually have this * type. */ - EventType ROOT_EVENT_TYPE = new StandardEventType(0, + EventType ROOT_EVENT_TYPE = new EventTypeImpl(0, getBundle().getString("RootEventType.eventTypes.name"), // NON-NLS ROOT_TYPE, null) { @Override @@ -115,7 +152,7 @@ public SortedSet< EventType> getSubTypes() { } }; - EventType FILE_SYSTEM = new StandardEventType(1, + EventType FILE_SYSTEM = new EventTypeImpl(1, getBundle().getString("BaseTypes.fileSystem.name"),// NON-NLS BASE_TYPE, ROOT_EVENT_TYPE) { @Override @@ -124,7 +161,7 @@ public SortedSet< EventType> getSubTypes() { FILE_CREATED, FILE_CHANGED); } }; - EventType WEB_ACTIVITY = new StandardEventType(2, + EventType WEB_ACTIVITY = new EventTypeImpl(2, getBundle().getString("BaseTypes.webActivity.name"), // NON-NLS BASE_TYPE, ROOT_EVENT_TYPE) { @Override @@ -133,7 +170,7 @@ public SortedSet< ArtifactEventType> getSubTypes() { WEB_HISTORY, WEB_SEARCH); } }; - EventType MISC_TYPES = new StandardEventType(3, + EventType MISC_TYPES = new EventTypeImpl(3, getBundle().getString("BaseTypes.miscTypes.name"), // NON-NLS BASE_TYPE, ROOT_EVENT_TYPE) { @Override @@ -188,12 +225,12 @@ public SortedSet<EventType> getSubTypes() { new Type(TSK_DATETIME_ACCESSED), new Type(TSK_DOMAIN)); - ArtifactEventType MESSAGE = new StandardArtifactEventType(13, + ArtifactEventType MESSAGE = new PredefinedArtifactEventType(13, getBundle().getString("MiscTypes.message.name"),// NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_MESSAGE), new Type(TSK_DATETIME), - new StandardArtifactEventType.AttributeExtractor(new Type(TSK_MESSAGE_TYPE)), + new PredefinedArtifactEventType.AttributeExtractor(new Type(TSK_MESSAGE_TYPE)), artf -> { final BlackboardAttribute dir = getAttributeSafe(artf, new Type(TSK_DIRECTION)); final BlackboardAttribute readStatus = getAttributeSafe(artf, new Type(TSK_READ_STATUS)); @@ -211,7 +248,7 @@ public SortedSet<EventType> getSubTypes() { }, new AttributeExtractor(new Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT))); - ArtifactEventType GPS_ROUTE = new StandardArtifactEventType(14, + ArtifactEventType GPS_ROUTE = new PredefinedArtifactEventType(14, getBundle().getString("MiscTypes.GPSRoutes.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_GPS_ROUTE), @@ -226,7 +263,7 @@ public SortedSet<EventType> getSubTypes() { return String.format("from %1$s %2$s to %3$s %4$s", stringValueOf(latStart), stringValueOf(longStart), stringValueOf(latEnd), stringValueOf(longEnd)); // NON-NLS }); - ArtifactEventType GPS_TRACKPOINT = new StandardArtifactEventType(15, + ArtifactEventType GPS_TRACKPOINT = new PredefinedArtifactEventType(15, getBundle().getString("MiscTypes.GPSTrackpoint.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_GPS_TRACKPOINT), @@ -239,7 +276,7 @@ public SortedSet<EventType> getSubTypes() { }, new EmptyExtractor()); - ArtifactEventType CALL_LOG = new StandardArtifactEventType(16, + ArtifactEventType CALL_LOG = new PredefinedArtifactEventType(16, getBundle().getString("MiscTypes.Calls.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_CALLLOG), @@ -248,7 +285,7 @@ public SortedSet<EventType> getSubTypes() { new AttributeExtractor(new Type(TSK_PHONE_NUMBER)), new AttributeExtractor(new Type(TSK_DIRECTION))); - ArtifactEventType EMAIL = new StandardArtifactEventType(17, + ArtifactEventType EMAIL = new PredefinedArtifactEventType(17, getBundle().getString("MiscTypes.Email.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_EMAIL_MSG), @@ -268,7 +305,7 @@ public SortedSet<EventType> getSubTypes() { new Type(TSK_DATETIME), new Type(TSK_PATH)); - ArtifactEventType INSTALLED_PROGRAM = new StandardArtifactEventType(19, + ArtifactEventType INSTALLED_PROGRAM = new PredefinedArtifactEventType(19, getBundle().getString("MiscTypes.installedPrograms.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_INSTALLED_PROG), @@ -277,7 +314,7 @@ public SortedSet<EventType> getSubTypes() { new EmptyExtractor(), new EmptyExtractor()); - ArtifactEventType EXIF = new StandardArtifactEventType(20, + ArtifactEventType EXIF = new PredefinedArtifactEventType(20, getBundle().getString("MiscTypes.exif.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_METADATA_EXIF), @@ -287,7 +324,7 @@ public SortedSet<EventType> getSubTypes() { artf -> artf.getSleuthkitCase().getAbstractFileById(artf.getObjectID()).getName() ); - ArtifactEventType DEVICES_ATTACHED = new StandardArtifactEventType(21, + ArtifactEventType DEVICES_ATTACHED = new PredefinedArtifactEventType(21, getBundle().getString("MiscTypes.devicesAttached.name"), // NON-NLS MISC_TYPES, new BlackboardArtifact.Type(TSK_DEVICE_ATTACHED), @@ -297,7 +334,7 @@ public SortedSet<EventType> getSubTypes() { new AttributeExtractor(new Type(TSK_DEVICE_ID))); //custom event type base type - EventType CUSTOM_TYPES = new StandardEventType(22, + EventType CUSTOM_TYPES = new EventTypeImpl(22, getBundle().getString("BaseTypes.customTypes.name"), // NON-NLS BASE_TYPE, ROOT_EVENT_TYPE) { @Override diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/StandardEventType.java b/bindings/java/src/org/sleuthkit/datamodel/EventTypeImpl.java similarity index 85% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/StandardEventType.java rename to bindings/java/src/org/sleuthkit/datamodel/EventTypeImpl.java index 9464032be..db90ce1be 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/StandardEventType.java +++ b/bindings/java/src/org/sleuthkit/datamodel/EventTypeImpl.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.collect.ImmutableSortedSet; import java.util.Optional; @@ -26,14 +26,21 @@ /** * Implementation of EventType for the standard predefined event types. */ -class StandardEventType implements EventType { +class EventTypeImpl implements EventType { private final long typeID; private final String displayName; private final EventType superType; - private final EventTypeZoomLevel eventTypeZoomLevel; + private final EventType.TypeLevel eventTypeZoomLevel; - StandardEventType(long typeID, String displayName, EventTypeZoomLevel eventTypeZoomLevel, EventType superType) { + /** + * + * @param typeID ID (from the Database) + * @param displayName + * @param eventTypeZoomLevel Where it is in the type hierarchy + * @param superType + */ + EventTypeImpl(long typeID, String displayName, EventType.TypeLevel eventTypeZoomLevel, EventType superType) { this.superType = superType; this.typeID = typeID; this.displayName = displayName; @@ -70,7 +77,7 @@ public EventType getSuperType() { } @Override - public EventTypeZoomLevel getZoomLevel() { + public EventType.TypeLevel getTypeLevel() { return eventTypeZoomLevel; } diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypes.java b/bindings/java/src/org/sleuthkit/datamodel/EventTypes.java similarity index 85% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypes.java rename to bindings/java/src/org/sleuthkit/datamodel/EventTypes.java index bffa181ce..80bf431c8 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypes.java +++ b/bindings/java/src/org/sleuthkit/datamodel/EventTypes.java @@ -16,23 +16,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.net.InternetDomainName; import java.net.URI; import java.net.URISyntaxException; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; -import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.datamodel.timeline.TimelineEvent.EventDescription; +import org.sleuthkit.datamodel.TimelineEvent.EventDescription; /** - * + * Container class for various types of timeline events * */ class EventTypes { @@ -45,7 +40,7 @@ private EventTypes() { * applied to. * */ - final static class EmptyExtractor implements StandardArtifactEventType.TSKCoreCheckedFunction<BlackboardArtifact, String> { + final static class EmptyExtractor implements PredefinedArtifactEventType.TSKCoreCheckedFunction<BlackboardArtifact, String> { @Override public String apply(BlackboardArtifact ignored) throws TskCoreException { @@ -96,9 +91,9 @@ public EventDescription parseDescription(String fullDescriptionRaw, String medDe } } - static class FilePathEventType extends StandardEventType { + static class FilePathEventType extends EventTypeImpl { - FilePathEventType(long typeID, String displayName, EventTypeZoomLevel eventTypeZoomLevel, EventType superType) { + FilePathEventType(long typeID, String displayName, EventType.TypeLevel eventTypeZoomLevel, EventType superType) { super(typeID, displayName, eventTypeZoomLevel, superType); } @@ -116,7 +111,7 @@ static class FilePathArtifactEventType extends SingleDescriptionArtifactEventTyp } @Override - public TimelineEvent.EventDescription parseDescription(String fullDescriptionRaw, String medDescriptionRaw, String shortDescriptionRaw) { + public EventDescription parseDescription(String fullDescriptionRaw, String medDescriptionRaw, String shortDescriptionRaw) { return parseFilePathDescription(fullDescriptionRaw); } } diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/StandardArtifactEventType.java b/bindings/java/src/org/sleuthkit/datamodel/PredefinedArtifactEventType.java similarity index 92% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/StandardArtifactEventType.java rename to bindings/java/src/org/sleuthkit/datamodel/PredefinedArtifactEventType.java index f93c71129..9adcd2d7b 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/StandardArtifactEventType.java +++ b/bindings/java/src/org/sleuthkit/datamodel/PredefinedArtifactEventType.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.net.InternetDomainName; import java.text.MessageFormat; @@ -24,18 +24,15 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.lang3.StringUtils; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN; -import org.sleuthkit.datamodel.TskCoreException; /** * Implementation of ArtifactEventType for the standard predefined artifact * based event types. */ -class StandardArtifactEventType extends StandardEventType implements ArtifactEventType { +class PredefinedArtifactEventType extends EventTypeImpl implements ArtifactEventType { - private static final Logger logger = Logger.getLogger(StandardArtifactEventType.class.getName()); + private static final Logger logger = Logger.getLogger(PredefinedArtifactEventType.class.getName()); private final BlackboardArtifact.Type artifactType; private final BlackboardAttribute.Type dateTimeAttributeType; @@ -44,7 +41,7 @@ class StandardArtifactEventType extends StandardEventType implements ArtifactEve private final TSKCoreCheckedFunction<BlackboardArtifact, String> shortExtractor; private final TSKCoreCheckedFunction<BlackboardArtifact, EventDescriptionWithTime> eventPayloadFunction; - StandardArtifactEventType(int typeID, String displayName, + PredefinedArtifactEventType(int typeID, String displayName, EventType superType, BlackboardArtifact.Type artifactType, BlackboardAttribute.Type dateTimeAttributeType, @@ -54,7 +51,7 @@ class StandardArtifactEventType extends StandardEventType implements ArtifactEve this(typeID, displayName, superType, artifactType, dateTimeAttributeType, shortExtractor, medExtractor, fullExtractor, null); } - StandardArtifactEventType(int typeID, String displayName, + PredefinedArtifactEventType(int typeID, String displayName, EventType superType, BlackboardArtifact.Type artifactType, BlackboardAttribute.Type dateTimeAttributeType, @@ -63,7 +60,7 @@ class StandardArtifactEventType extends StandardEventType implements ArtifactEve TSKCoreCheckedFunction<BlackboardArtifact, String> fullExtractor, TSKCoreCheckedFunction<BlackboardArtifact, EventDescriptionWithTime> eventPayloadFunction) { - super(typeID, displayName, EventTypeZoomLevel.SUB_TYPE, superType); + super(typeID, displayName, EventType.TypeLevel.SUB_TYPE, superType); this.artifactType = artifactType; this.dateTimeAttributeType = dateTimeAttributeType; this.shortExtractor = shortExtractor; diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/SingeLevelEventDiscription.java b/bindings/java/src/org/sleuthkit/datamodel/SingeLevelEventDiscription.java similarity index 60% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/SingeLevelEventDiscription.java rename to bindings/java/src/org/sleuthkit/datamodel/SingeLevelEventDiscription.java index e90f0cf28..02e3269fd 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/SingeLevelEventDiscription.java +++ b/bindings/java/src/org/sleuthkit/datamodel/SingeLevelEventDiscription.java @@ -3,11 +3,9 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; -import org.sleuthkit.datamodel.DescriptionLoD; - - class SingeLevelEventDiscription implements TimelineEvent.EventDescription { +class SingeLevelEventDiscription implements TimelineEvent.EventDescription { private final String fullDescr; @@ -17,7 +15,7 @@ class SingeLevelEventDiscription implements TimelineEvent.EventDescription { } @Override - public String getDescription(DescriptionLoD lod) { + public String getDescription(TimelineEvent.DescriptionLevel lod) { return fullDescr; } } diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/SingleDescriptionArtifactEventType.java b/bindings/java/src/org/sleuthkit/datamodel/SingleDescriptionArtifactEventType.java similarity index 83% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/SingleDescriptionArtifactEventType.java rename to bindings/java/src/org/sleuthkit/datamodel/SingleDescriptionArtifactEventType.java index aa3d0d9e8..e63fb268c 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/SingleDescriptionArtifactEventType.java +++ b/bindings/java/src/org/sleuthkit/datamodel/SingleDescriptionArtifactEventType.java @@ -16,20 +16,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import java.util.logging.Level; import java.util.logging.Logger; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; -import org.sleuthkit.datamodel.TskCoreException; /** - * Package level extension of StandardArtifactEventType for event types only - * store one description in the db. They may support parsing the description in - * memory, or one one zoom level + * Package level extension of PredefinedArtifactEventType for event types + * that have only one description (because we don't know how to break it + * up further). */ -class SingleDescriptionArtifactEventType extends StandardArtifactEventType { +class SingleDescriptionArtifactEventType extends PredefinedArtifactEventType { private static final Logger logger = Logger.getLogger(SingleDescriptionArtifactEventType.class.getName()); diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/ThreeLevelEventDescription.java b/bindings/java/src/org/sleuthkit/datamodel/ThreeLevelEventDescription.java similarity index 70% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/ThreeLevelEventDescription.java rename to bindings/java/src/org/sleuthkit/datamodel/ThreeLevelEventDescription.java index 3861b5fcb..8082ca866 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/ThreeLevelEventDescription.java +++ b/bindings/java/src/org/sleuthkit/datamodel/ThreeLevelEventDescription.java @@ -16,25 +16,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.collect.ImmutableMap; import static org.apache.commons.lang3.StringUtils.defaultString; -import org.sleuthkit.datamodel.DescriptionLoD; +/** + * Stores all levels of the event descriptions in a single class + */ class ThreeLevelEventDescription implements TimelineEvent.EventDescription { /** * The three descriptions (full, med, short) stored in a map, keyed by - * DescriptionLOD (Level of Detail) + DescriptionLOD (DescriptionLevel of Detail) */ - private final ImmutableMap<DescriptionLoD, String> descriptions; + private final ImmutableMap<TimelineEvent.DescriptionLevel, String> descriptions; ThreeLevelEventDescription(String fullDescr, String mediumDescr, String shortDescr) { - descriptions = ImmutableMap.of( - DescriptionLoD.FULL, defaultString(fullDescr), - DescriptionLoD.MEDIUM, defaultString(mediumDescr), - DescriptionLoD.SHORT, defaultString(shortDescr) + descriptions = ImmutableMap.of(TimelineEvent.DescriptionLevel.FULL, defaultString(fullDescr), + TimelineEvent.DescriptionLevel.MEDIUM, defaultString(mediumDescr), + TimelineEvent.DescriptionLevel.SHORT, defaultString(shortDescr) ); } @@ -46,7 +47,7 @@ DescriptionLoD.SHORT, defaultString(shortDescr) * @return The description of this event at the given level of detail. */ @Override - public String getDescription(DescriptionLoD lod) { + public String getDescription(TimelineEvent.DescriptionLevel lod) { return descriptions.get(lod); } } diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineEvent.java b/bindings/java/src/org/sleuthkit/datamodel/TimelineEvent.java similarity index 79% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineEvent.java rename to bindings/java/src/org/sleuthkit/datamodel/TimelineEvent.java index 812b84f45..9dcfbc58b 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineEvent.java +++ b/bindings/java/src/org/sleuthkit/datamodel/TimelineEvent.java @@ -16,11 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import java.util.Optional; -import org.sleuthkit.datamodel.DescriptionLoD; -import static org.sleuthkit.datamodel.timeline.EventTypeZoomLevel.SUB_TYPE; +import java.util.ResourceBundle; +import static org.sleuthkit.datamodel.EventType.TypeLevel.SUB_TYPE; /** * A single event. @@ -55,7 +55,7 @@ public final class TimelineEvent { /** * The three descriptions (full, med, short) stored in a map, keyed by - * DescriptionLOD (Level of Detail) + DescriptionLOD (TypeLevel of Detail) */ private final EventDescription descriptions; @@ -84,7 +84,7 @@ public final class TimelineEvent { * @param hashHit * @param tagged */ - public TimelineEvent(long eventID, long dataSourceObjID, long fileObjID, Long artifactID, + TimelineEvent(long eventID, long dataSourceObjID, long fileObjID, Long artifactID, long time, EventType type, String fullDescription, String medDescription, @@ -165,7 +165,7 @@ public EventType getEventType() { return type; } - public EventType getEventType(EventTypeZoomLevel zoomLevel) { + public EventType getEventType(EventType.TypeLevel zoomLevel) { return zoomLevel.equals(SUB_TYPE) ? type : type.getBaseType(); } @@ -175,7 +175,7 @@ public EventType getEventType(EventTypeZoomLevel zoomLevel) { * @return the full description */ public String getFullDescription() { - return getDescription(DescriptionLoD.FULL); + return getDescription(TimelineEvent.DescriptionLevel.FULL); } /** @@ -184,7 +184,7 @@ public String getFullDescription() { * @return the medium description */ public String getMedDescription() { - return getDescription(DescriptionLoD.MEDIUM); + return getDescription(TimelineEvent.DescriptionLevel.MEDIUM); } /** @@ -193,7 +193,7 @@ public String getMedDescription() { * @return the short description */ public String getShortDescription() { - return getDescription(DescriptionLoD.SHORT); + return getDescription(TimelineEvent.DescriptionLevel.SHORT); } /** @@ -203,7 +203,7 @@ public String getShortDescription() { * * @return The description of this event at the given level of detail. */ - public String getDescription(DescriptionLoD lod) { + public String getDescription(TimelineEvent.DescriptionLevel lod) { return descriptions.getDescription(lod); } @@ -243,6 +243,38 @@ public boolean equals(Object obj) { return this.eventID == other.eventID; } + public enum DescriptionLevel { + SHORT(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.short")), + MEDIUM(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.medium")), + FULL(ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle").getString("DescriptionLOD.full")); + + private final String displayName; + + public String getDisplayName() { + return displayName; + } + + private DescriptionLevel(String displayName) { + this.displayName = displayName; + } + + public DescriptionLevel moreDetailed() { + try { + return values()[ordinal() + 1]; + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + + public DescriptionLevel lessDetailed() { + try { + return values()[ordinal() - 1]; + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + + } /** * Encapsulates the potential multiple levels of description for an event in * to one object. @@ -263,7 +295,7 @@ public static EventDescription create(String fullDescription) { * @return the full description */ default public String getFullDescription() { - return getDescription(DescriptionLoD.FULL); + return getDescription(TimelineEvent.DescriptionLevel.FULL); } /** @@ -272,7 +304,7 @@ default public String getFullDescription() { * @return the medium description */ default public String getMediumDescription() { - return getDescription(DescriptionLoD.MEDIUM); + return getDescription(TimelineEvent.DescriptionLevel.MEDIUM); } /** @@ -281,7 +313,7 @@ default public String getMediumDescription() { * @return the short description */ default public String getShortDescription() { - return getDescription(DescriptionLoD.SHORT); + return getDescription(TimelineEvent.DescriptionLevel.SHORT); } /** @@ -291,6 +323,6 @@ default public String getShortDescription() { * * @return The description of this event at the given level of detail. */ - public String getDescription(DescriptionLoD lod); + public String getDescription(TimelineEvent.DescriptionLevel lod); } } diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineFilter.java b/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java similarity index 99% rename from bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineFilter.java rename to bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java index 6ec4eb389..c69c4a899 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/TimelineFilter.java +++ b/bindings/java/src/org/sleuthkit/datamodel/TimelineFilter.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.datamodel.timeline; +package org.sleuthkit.datamodel; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; @@ -38,9 +38,6 @@ import static org.apache.commons.lang3.ObjectUtils.notEqual; import org.apache.commons.lang3.StringUtils; import static org.sleuthkit.datamodel.SleuthkitCase.escapeSingleQuotes; -import org.sleuthkit.datamodel.TagName; -import org.sleuthkit.datamodel.TimelineManager; -import org.sleuthkit.datamodel.TskData; /** * Interface for timeline event filters. Filters are given to the diff --git a/bindings/java/src/org/sleuthkit/datamodel/TimelineManager.java b/bindings/java/src/org/sleuthkit/datamodel/TimelineManager.java index 678b230d6..dacaf6101 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/TimelineManager.java +++ b/bindings/java/src/org/sleuthkit/datamodel/TimelineManager.java @@ -47,11 +47,11 @@ import org.sleuthkit.datamodel.SleuthkitCase.CaseDbConnection; import static org.sleuthkit.datamodel.SleuthkitCase.escapeSingleQuotes; import static org.sleuthkit.datamodel.StringUtils.buildCSVString; -import org.sleuthkit.datamodel.timeline.ArtifactEventType; -import org.sleuthkit.datamodel.timeline.EventType; -import org.sleuthkit.datamodel.timeline.EventTypeZoomLevel; -import org.sleuthkit.datamodel.timeline.TimelineEvent; -import org.sleuthkit.datamodel.timeline.TimelineFilter; +import org.sleuthkit.datamodel.ArtifactEventType; +import org.sleuthkit.datamodel.EventType; +import org.sleuthkit.datamodel.EventType; +import org.sleuthkit.datamodel.TimelineEvent; +import org.sleuthkit.datamodel.TimelineFilter; /** * Provides access to the Timeline features of SleuthkitCase @@ -902,10 +902,10 @@ void rollBackTransaction(SleuthkitCase.CaseDbTransaction trans) throws TskCoreEx * * @throws org.sleuthkit.datamodel.TskCoreException */ - public Map<EventType, Long> countEventsByType(Long startTime, final Long endTime, TimelineFilter.RootFilter filter, EventTypeZoomLevel zoomLevel) throws TskCoreException { + public Map<EventType, Long> countEventsByType(Long startTime, final Long endTime, TimelineFilter.RootFilter filter, EventType.TypeLevel zoomLevel) throws TskCoreException { long adjustedEndTime = Objects.equals(startTime, endTime) ? endTime + 1 : endTime; //do we want the base or subtype column of the databse - String typeColumn = typeColumnHelper(EventTypeZoomLevel.SUB_TYPE.equals(zoomLevel)); + String typeColumn = typeColumnHelper(EventType.TypeLevel.SUB_TYPE.equals(zoomLevel)); String queryString = "SELECT count(DISTINCT tsk_events.event_id) AS count, " + typeColumn//NON-NLS + " FROM " + getAugmentedEventsTablesSQL(filter)//NON-NLS @@ -1060,7 +1060,7 @@ public String getSQLWhere(TimelineFilter.RootFilter filter) { return result; } - public String getDescriptionColumn(DescriptionLoD lod) { + public String getDescriptionColumn(TimelineEvent.DescriptionLevel lod) { switch (lod) { case FULL: return "full_description"; //NON-NLS diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle.properties b/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle.properties deleted file mode 100644 index 5d2274b22..000000000 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle.properties +++ /dev/null @@ -1,44 +0,0 @@ -BaseTypes.fileSystem.name=File System -BaseTypes.webActivity.name=Web Activity -BaseTypes.miscTypes.name=Misc Types -FileSystemTypes.fileModified.name=File Modified -FileSystemTypes.fileAccessed.name=File Accessed -FileSystemTypes.fileCreated.name=File Created -FileSystemTypes.fileChanged.name=File Changed -MiscTypes.message.name=Messages -MiscTypes.GPSRoutes.name=GPS Routes -MiscTypes.GPSTrackpoint.name=Location History -MiscTypes.Calls.name=Calls -MiscTypes.Email.name=Email -MiscTypes.recentDocuments.name=Recent Documents -MiscTypes.installedPrograms.name=Installed Programs -MiscTypes.exif.name=Exif -MiscTypes.devicesAttached.name=Devices Attached -MiscTypes.LogEntry.name=Log Entry -MiscTypes.Registry.name=Registry -RootEventType.eventTypes.name=Event Types -WebTypes.webDownloads.name=Web Downloads -WebTypes.webCookies.name=Web Cookies -WebTypes.webBookmarks.name=Web Bookmarks -WebTypes.webHistory.name=Web History -WebTypes.webSearch.name=Web Searches -CustomTypes.other.name=Other -CustomTypes.userCreated.name=User Created -BaseTypes.customTypes.name=Custom Types - - -EventTypeZoomLevel.rootType=Root Type -EventTypeZoomLevel.baseType=Base Type -EventTypeZoomLevel.subType=Sub Type - -DataSourcesFilter.displayName.text=Data Source -DescriptionFilter.mode.exclude=Exclude -DescriptionFilter.mode.include=Include -hashHitsFilter.displayName.text=Hash Sets -hideKnownFilter.displayName.text=Hide Known Files -# {0} - sub filter displaynames -IntersectionFilter.displayName.text=Intersection -tagsFilter.displayName.text=Tags -TextFilter.displayName.text=Text Filter -TypeFilter.displayName.text=Event Type -FileTypesFilter.displayName.text=File Types \ No newline at end of file diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle_ja.properties b/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle_ja.properties deleted file mode 100644 index 73e392239..000000000 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/Bundle_ja.properties +++ /dev/null @@ -1,42 +0,0 @@ -BaseTypes.fileSystem.name=\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0 -BaseTypes.miscTypes.name=\u305d\u306e\u4ed6\u30bf\u30a4\u30d7 -BaseTypes.webActivity.name=\u30a6\u30a7\u30d6\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3 -FileSystemTypes.fileAccessed.name=\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb -FileSystemTypes.fileChanged.name=\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb -FileSystemTypes.fileCreated.name=\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb -FileSystemTypes.fileModified.name=\u4fee\u6b63\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb -MiscTypes.Calls.name=\u30b3\u30fc\u30eb -MiscTypes.devicesAttached.name=\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u6a5f\u5668 -MiscTypes.Email.name=Email -MiscTypes.exif.name=Exif -MiscTypes.GPSRoutes.name=GPS\u30eb\u30fc\u30c8 -MiscTypes.GPSTrackpoint.name=\u4f4d\u7f6e\u60c5\u5831\u5c65\u6b74 -MiscTypes.installedPrograms.name=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0 -MiscTypes.message.name=\u30e1\u30c3\u30bb\u30fc\u30b8 -MiscTypes.recentDocuments.name=\u6700\u8fd1\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 -RootEventType.eventTypes.name=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7 -WebTypes.webBookmarks.name=\u30a6\u30a7\u30d6\u30d6\u30c3\u30af\u30de\u30fc\u30af -WebTypes.webCookies.name=\u30a6\u30a7\u30d6\u30af\u30c3\u30ad\u30fc -WebTypes.webDownloads.name=\u30a6\u30a7\u30d6\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 -WebTypes.webHistory.name=\u30a6\u30a7\u30d6\u5c65\u6b74 -WebTypes.webSearch.name=\u30a6\u30a7\u30d6\u691c\u7d22 -EventTypeZoomLevel.baseType=\u30d9\u30fc\u30b9\u30bf\u30a4\u30d7 -EventTypeZoomLevel.rootType=\u30eb\u30fc\u30c8\u30bf\u30a4\u30d7 -EventTypeZoomLevel.subType=\u30b5\u30d6\u30bf\u30a4\u30d7 -DescriptionLOD.short=\u7c21\u6f54 -DescriptionLOD.medium=\u6982\u8981 -DescriptionLOD.full=\u8a73\u7d30 -ZoomSettingsPane.descrLODLabel.text=\u8a73\u7d30\u8aac\u660e\uff1a -ZoomSettingsPane.historyLabel.text=\u5c65\u6b74\uff1a -ZoomSettingsPane.timeUnitLabel.text=\u6642\u9593\u5358\u4f4d\uff1a -ZoomSettingsPane.typeZoomLabel.text=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\uff1a - -hideKnownFilter.displayName.text=\u65e2\u77e5\u30d5\u30a1\u30a4\u30eb\u3092\u96a0\u3059 -TextFilter.displayName.text=\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc -TypeFilter.displayName.text=\u30a4\u30d9\u30f3\u30c8\u30bf\u30a4\u30d7\u30d5\u30a3\u30eb\u30bf\u30fc -IntersectionFilter.displayName.text=\u30a4\u30f3\u30bf\u30fc\u30bb\u30af\u30b7\u30e7\u30f3{0} -DataSourcesFilter.displayName.text=\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9 -DescriptionFilter.mode.exclude=\u9664\u5916\u3059\u308b -DescriptionFilter.mode.include=\u542b\u3080 -hashHitsFilter.displayName.text=\u30cf\u30c3\u30b7\u30e5\u30bb\u30c3\u30c8\u306e\u30d2\u30c3\u30c8\u306e\u307f -tagsFilter.displayName.text=\u30bf\u30b0\u3055\u308c\u305f\u30a4\u30d9\u30f3\u30c8\u306e\u307f \ No newline at end of file diff --git a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypeZoomLevel.java b/bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypeZoomLevel.java deleted file mode 100644 index f529e32b9..000000000 --- a/bindings/java/src/org/sleuthkit/datamodel/timeline/EventTypeZoomLevel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Sleuth Kit Data Model - * - * Copyright 2018 Basis Technology Corp. - * Contact: carrier <at> sleuthkit <dot> org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.datamodel.timeline; - -import static org.sleuthkit.datamodel.timeline.BundleProvider.getBundle; - -/** - * Enum of event type zoom levels. - */ -public enum EventTypeZoomLevel { - /** - * The root event type zoom level. All event are the same type at this - * level. - */ - ROOT_TYPE(getBundle().getString("EventTypeZoomLevel.rootType")), - /** - * The zoom level of base event types like files system, and web activity - */ - BASE_TYPE(getBundle().getString("EventTypeZoomLevel.baseType")), - /** - * The zoom level of specific type such as file modified time, or web - * download. - */ - SUB_TYPE(getBundle().getString("EventTypeZoomLevel.subType")); - - private final String displayName; - - public String getDisplayName() { - return displayName; - } - - private EventTypeZoomLevel(String displayName) { - this.displayName = displayName; - } -} -- GitLab