Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
NewArtifactsRunner.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 java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
28 
32 public class NewArtifactsRunner implements Runnable {
33 
34  private static final Logger LOGGER = Logger.getLogger(NewArtifactsRunner.class.getName());
35  private static final long serialVersionUID = 1L;
36 
37  private final Collection<CorrelationAttribute> eamArtifacts;
38 
39  @SuppressWarnings(value = {"unchecked", "rawtypes"})
40  public NewArtifactsRunner(Collection<CorrelationAttribute> eamArtifacts) {
41  this.eamArtifacts = new ArrayList(eamArtifacts);
42  }
43 
44  @Override
45  public void run() {
46  if (!EamDb.isEnabled()) {
47  LOGGER.log(Level.WARNING, "Central Repository database not configured"); // NON-NLS
48  return;
49  }
50 
51  try {
52  EamDb dbManager = EamDb.getInstance();
53 
54  for (CorrelationAttribute eamArtifact : eamArtifacts) {
55  dbManager.addArtifact(eamArtifact);
56  }
57  } catch (EamDbException ex) {
58  LOGGER.log(Level.SEVERE, "Error connecting to Central Repository database.", ex); //NON-NLS
59  }
60  }
61 }
NewArtifactsRunner(Collection< CorrelationAttribute > eamArtifacts)
void addArtifact(CorrelationAttribute eamArtifact)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

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