Autopsy  4.0
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-2016 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;
28 import org.sleuthkit.datamodel.Content;
29 import org.sleuthkit.datamodel.TskCoreException;
30 
38 public final class ContentChangedEvent extends AutopsyEvent implements Serializable {
39 
40  private static final long serialVersionUID = 1L;
41  private static final Logger logger = Logger.getLogger(ContentChangedEvent.class.getName());
42  private transient ModuleContentEvent eventData;
43 
58  super(
60  new SerializableEventData(eventData.getModuleName(), ((Content) eventData.getSource()).getId()),
61  null
62  );
63  }
64 
72  @Override
73  public Object getOldValue() {
83  if (null != eventData) {
84  return eventData;
85  }
86  try {
87  SerializableEventData data = (SerializableEventData) super.getOldValue();
88  Content content = Case.getCurrentCase().getSleuthkitCase().getContentById(data.contentId);
89  eventData = new ModuleContentEvent(data.moduleName, content);
90  return eventData;
91  } catch (IllegalStateException | TskCoreException ex) {
92  logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
93  return null;
94  }
95  }
96 
100  private static final class SerializableEventData implements Serializable {
101 
102  private static final long serialVersionUID = 1L;
103  private final String moduleName;
104  private final long contentId;
105 
106  private SerializableEventData(String moduleName, long contentId) {
107  this.moduleName = moduleName;
108  this.contentId = contentId;
109  }
110 
111  }
112 
113 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:166

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