Autopsy  4.10.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Installer.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2017 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.centralrepository.eventlisteners;
20 
21 import javax.swing.JOptionPane;
22 import org.openide.modules.ModuleInstall;
23 import org.openide.util.NbBundle;
24 import org.openide.windows.WindowManager;
30 
34 public class Installer extends ModuleInstall {
35 
36  private static final Logger LOGGER = Logger.getLogger(Installer.class.getName());
37  private static final long serialVersionUID = 1L;
38  private final CaseEventListener pcl = new CaseEventListener();
40 
41  private static Installer instance;
42 
43  public synchronized static Installer getDefault() {
44  if (instance == null) {
45  instance = new Installer();
46  }
47  return instance;
48  }
49 
50  private Installer() {
51  super();
52  }
53 
54  @NbBundle.Messages({"Installer.centralRepoUpgradeFailed.title=Central repository upgrade failed"})
55  @Override
56  public void restored() {
58  ieListener.installListeners();
59 
60  // Perform the database upgrade and inform the user if it fails
61  try {
63  } catch (EamDbException ex) {
65  WindowManager.getDefault().invokeWhenUIReady(() -> {
66  JOptionPane.showMessageDialog(null,
67  ex.getMessage(),
68  NbBundle.getMessage(this.getClass(),
69  "Installer.centralRepoUpgradeFailed.title"),
70  JOptionPane.ERROR_MESSAGE);
71  });
72  }
73  }
74  }
75 
76  @Override
77  public boolean closing() {
78  //platform about to close
79 
80  return true;
81  }
82 
83  @Override
84  public void uninstalled() {
85  //module is being unloaded
86 
88  pcl.shutdown();
89  ieListener.shutdown();
90  ieListener.uninstallListeners();
91 
92  // TODO: remove thread pool
93  }
94 }
static void removePropertyChangeListener(PropertyChangeListener listener)
Definition: Case.java:412
static void addPropertyChangeListener(PropertyChangeListener listener)
Definition: Case.java:400
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.