Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
TimelineEventAddedEvent.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2018 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.timeline.events;
20
21import java.util.logging.Level;
22import org.sleuthkit.autopsy.casemodule.Case;
23import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
24import org.sleuthkit.autopsy.coreutils.Logger;
25import org.sleuthkit.autopsy.events.AutopsyEvent;
26import org.sleuthkit.datamodel.TskCoreException;
27import org.sleuthkit.datamodel.TimelineEvent;
28
33
34 private static final long serialVersionUID = 1L;
35 private static final Logger logger = Logger.getLogger(TimelineEventAddedEvent.class.getName());
36
37 private transient TimelineEvent addedEvent;
38
39 public TimelineEventAddedEvent(org.sleuthkit.datamodel.TimelineManager.TimelineEventAddedEvent event) {
40 super(Case.Events.TIMELINE_EVENT_ADDED.name(), null, event.getAddedEvent().getEventID());
41 addedEvent = event.getAddedEvent();
42 }
43
50 @Override
51 public TimelineEvent getNewValue() {
61 if (null != addedEvent) {
62 return addedEvent;
63 }
64 try {
65 Long addedEventID = (Long) super.getNewValue();
66 addedEvent = Case.getCurrentCaseThrows().getSleuthkitCase().getTimelineManager().getEventById(addedEventID);
67 return addedEvent;
68 } catch (NoCurrentCaseException | TskCoreException ex) {
69 logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
70 return null;
71 }
72 }
73
80 public TimelineEvent getAddedEvent() {
81 return getNewValue();
82 }
83
89 public long getAddedEventID() {
90 return (long) super.getNewValue();
91 }
92}
synchronized static Logger getLogger(String name)
Definition Logger.java:124
AutopsyEvent(String eventName, Object oldValue, Object newValue)
TimelineEventAddedEvent(org.sleuthkit.datamodel.TimelineManager.TimelineEventAddedEvent event)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.