Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
Snapshot.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014-2020 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;
20 
21 import java.io.Serializable;
22 import java.util.Collections;
23 import java.util.Date;
24 import java.util.List;
25 
29 public final class Snapshot implements Serializable {
30 
31  private static final long serialVersionUID = 1L;
32 
33  private final String dataSource;
34  private final long jobId;
35  private final long jobStartTime;
36  private final long snapShotTime;
37  transient private final DataSourceIngestPipeline.DataSourcePipelineModule dataSourceLevelIngestModule;
38  private final boolean fileIngestRunning;
39  private final Date fileIngestStartTime;
40  private final long processedFiles;
41  private final long estimatedFilesToProcess;
42  private final IngestTasksScheduler.IngestJobTasksSnapshot tasksSnapshot;
43  transient private final boolean jobCancelled;
45  transient private final List<String> cancelledDataSourceModules;
46 
51  Snapshot(String dataSourceName, long jobId, long jobStartTime, DataSourceIngestPipeline.DataSourcePipelineModule dataSourceIngestModule,
52  boolean fileIngestRunning, Date fileIngestStartTime,
53  boolean jobCancelled, IngestJob.CancellationReason cancellationReason, List<String> cancelledModules,
54  long processedFiles, long estimatedFilesToProcess,
55  long snapshotTime, IngestTasksScheduler.IngestJobTasksSnapshot tasksSnapshot) {
56  this.dataSource = dataSourceName;
57  this.jobId = jobId;
58  this.jobStartTime = jobStartTime;
59  this.dataSourceLevelIngestModule = dataSourceIngestModule;
60 
61  this.fileIngestRunning = fileIngestRunning;
62  this.fileIngestStartTime = fileIngestStartTime;
63  this.jobCancelled = jobCancelled;
64  this.jobCancellationReason = cancellationReason;
65  this.cancelledDataSourceModules = cancelledModules;
66 
67  this.processedFiles = processedFiles;
68  this.estimatedFilesToProcess = estimatedFilesToProcess;
69  this.snapShotTime = snapshotTime;
71  }
72 
79  long getSnapshotTime() {
80  return snapShotTime;
81  }
82 
89  String getDataSource() {
90  return dataSource;
91  }
92 
99  long getJobId() {
100  return this.jobId;
101  }
102 
109  long getJobStartTime() {
110  return jobStartTime;
111  }
112 
113  DataSourceIngestPipeline.DataSourcePipelineModule getDataSourceLevelIngestModule() {
114  return this.dataSourceLevelIngestModule;
115  }
116 
117  boolean getFileIngestIsRunning() {
118  return this.fileIngestRunning;
119  }
120 
121  Date getFileIngestStartTime() {
122  return this.fileIngestStartTime;
123  }
124 
131  double getSpeed() {
132  return (double) processedFiles / ((snapShotTime - jobStartTime) / 1000);
133  }
134 
140  long getFilesProcessed() {
141  return processedFiles;
142  }
143 
150  long getFilesEstimated() {
152  }
153 
154  long getRootQueueSize() {
155  if (null == this.tasksSnapshot) {
156  return 0;
157  }
158  return this.tasksSnapshot.getRootQueueSize();
159  }
160 
161  long getDirQueueSize() {
162  if (null == this.tasksSnapshot) {
163  return 0;
164  }
165  return this.tasksSnapshot.getDirectoryTasksQueueSize();
166  }
167 
168  long getFileQueueSize() {
169  if (null == this.tasksSnapshot) {
170  return 0;
171  }
172  return this.tasksSnapshot.getFileQueueSize();
173  }
174 
175  long getDsQueueSize() {
176  if (null == this.tasksSnapshot) {
177  return 0;
178  }
179  return this.tasksSnapshot.getDsQueueSize();
180  }
181 
182  long getStreamingQueueSize() {
183  if (null == this.tasksSnapshot) {
184  return 0;
185  }
186  return this.tasksSnapshot.getStreamingQueueSize();
187  }
188 
189  long getRunningListSize() {
190  if (null == this.tasksSnapshot) {
191  return 0;
192  }
193  return this.tasksSnapshot.getRunningListSize();
194  }
195 
196  long getArtifactTasksQueueSize() {
197  if (tasksSnapshot == null) {
198  return 0;
199  }
200  return tasksSnapshot.getArtifactsQueueSize();
201  }
202 
203  boolean isCancelled() {
204  return this.jobCancelled;
205  }
206 
212  IngestJob.CancellationReason getCancellationReason() {
213  return this.jobCancellationReason;
214  }
215 
223  List<String> getCancelledDataSourceIngestModules() {
224  return Collections.unmodifiableList(this.cancelledDataSourceModules);
225  }
226 
227 }
transient final List< String > cancelledDataSourceModules
Definition: Snapshot.java:45
transient final DataSourceIngestPipeline.DataSourcePipelineModule dataSourceLevelIngestModule
Definition: Snapshot.java:37
transient final IngestJob.CancellationReason jobCancellationReason
Definition: Snapshot.java:44
final IngestTasksScheduler.IngestJobTasksSnapshot tasksSnapshot
Definition: Snapshot.java:42
transient final boolean jobCancelled
Definition: Snapshot.java:43

Copyright © 2012-2021 Basis Technology. Generated on: Thu Sep 30 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.