Autopsy  4.9.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ContentChangedEvent.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-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.ingest.events;
20 
21 import java.io.Serializable;
22 import java.util.logging.Level;
29 import org.sleuthkit.datamodel.Content;
30 import org.sleuthkit.datamodel.TskCoreException;
31 
39 public final class ContentChangedEvent extends AutopsyEvent implements Serializable {
40 
41  private static final long serialVersionUID = 1L;
42  private static final Logger logger = Logger.getLogger(ContentChangedEvent.class.getName());
43  private transient ModuleContentEvent eventData;
44 
59  super(
61  new SerializableEventData(eventData.getModuleName(), ((Content) eventData.getSource()).getId()),
62  null
63  );
64  }
65 
73  @Override
74  public Object getOldValue() {
84  if (null != eventData) {
85  return eventData;
86  }
87  try {
88  SerializableEventData data = (SerializableEventData) super.getOldValue();
89  Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(data.contentId);
90  eventData = new ModuleContentEvent(data.moduleName, content);
91  return eventData;
92  } catch (NoCurrentCaseException | TskCoreException ex) {
93  logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
94  return null;
95  }
96  }
97 
101  private static final class SerializableEventData implements Serializable {
102 
103  private static final long serialVersionUID = 1L;
104  private final String moduleName;
105  private final long contentId;
106 
107  private SerializableEventData(String moduleName, long contentId) {
108  this.moduleName = moduleName;
109  this.contentId = contentId;
110  }
111 
112  }
113 
114 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.