Autopsy  4.21.0
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  */
19 package org.sleuthkit.autopsy.timeline.events;
20 
21 import java.util.logging.Level;
26 import org.sleuthkit.datamodel.TskCoreException;
27 import org.sleuthkit.datamodel.TimelineEvent;
28 
32 public class TimelineEventAddedEvent extends AutopsyEvent {
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 }
TimelineEventAddedEvent(org.sleuthkit.datamodel.TimelineManager.TimelineEventAddedEvent event)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.