Autopsy  4.11.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Services.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2011-2017 Basis Technology Corp.
6  * Contact: carrier <at> sleuthkit <dot> org
7  * Copyright 2012 42six Solutions.
8  * Contact: aebadirad <at> 42six <dot> com
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 package org.sleuthkit.autopsy.casemodule.services;
23 
24 import java.io.Closeable;
25 import java.io.IOException;
26 import java.util.ArrayList;
27 import java.util.List;
28 import org.openide.util.Lookup;
30 import org.sleuthkit.datamodel.SleuthkitCase;
31 
36 public class Services implements Closeable {
37 
38  private final List<Closeable> services = new ArrayList<>();
39  private final FileManager fileManager;
40  private final TagsManager tagsManager;
42  private final Blackboard blackboard;
43 
50  public Services(SleuthkitCase caseDb) {
51  fileManager = new FileManager(caseDb);
52  services.add(fileManager);
53 
54  tagsManager = new TagsManager(caseDb);
55  services.add(tagsManager);
56 
57  //This lookup fails in the functional test code. See JIRA-4571 for details.
58  //For the time being, the closing of this service at line 108 will be made
59  //null safe so that the functional tests run with no issues.
60  keywordSearchService = Lookup.getDefault().lookup(KeywordSearchService.class);
61  services.add(keywordSearchService);
62 
63  blackboard = new Blackboard(caseDb);
64  services.add(blackboard);
65  }
66 
73  return fileManager;
74  }
75 
82  return tagsManager;
83  }
84 
91  return keywordSearchService;
92  }
93 
100  return blackboard;
101  }
102 
108  @Override
109  public void close() throws IOException {
110  for (Closeable service : services) {
111  if(service != null) {
112  service.close();
113  }
114  }
115  }
116 
117 }
final KeywordSearchService keywordSearchService
Definition: Services.java:41

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