Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
AutopsyService.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2016-2019 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.appservices;
20 
23 
29 public interface AutopsyService {
30 
36  String getServiceName();
37 
38 // Status getStatus() {
39 //
40 // }
41 // default void openAppResources(ApplicationContext context) throws AutopsyServiceException {
42 // /*
43 // * Autopsy services may not have application-level resources.
44 // */
45 // }
57  default void openCaseResources(CaseContext context) throws AutopsyServiceException {
58  /*
59  * Autopsy services may not have case-level resources.
60  */
61  }
62 
74  /*
75  * Autopsy services may not have case-level resources.
76  */
77  }
78 
79 // default void closeAppResources(ApplicationContext context) throws AutopsyServiceException {
80 // /*
81 // * Autopsy services may not have case-level resources.
82 // */
83 // }
88  public static class CaseContext {
89 
90  private final Case theCase;
92  private volatile boolean cancelRequested;
93  private final boolean isNewCase;
94 
103  public CaseContext(Case theCase, ProgressIndicator progressIndicator) {
104  this(theCase, progressIndicator, false);
105  }
106 
116  public CaseContext(Case theCase, ProgressIndicator progressIndicator, boolean isNewCase) {
117  this.theCase = theCase;
118  this.progressIndicator = progressIndicator;
119  this.cancelRequested = false;
120  this.isNewCase = isNewCase;
121  }
122 
129  public Case getCase() {
130  return this.theCase;
131  }
132 
142  return this.progressIndicator;
143  }
144 
149  public void requestCancel() {
150  this.cancelRequested = true;
151  }
152 
160  public boolean cancelRequested() {
161  return this.cancelRequested;
162  }
163 
170  public boolean isNewCase() {
171  return this.isNewCase;
172  }
173  }
174 
178  public static class AutopsyServiceException extends Exception {
179 
180  private static final long serialVersionUID = 1L;
181 
188  public AutopsyServiceException(String message) {
189  super(message);
190  }
191 
199  public AutopsyServiceException(String message, Throwable cause) {
200  super(message, cause);
201  }
202  }
203 }
default void openCaseResources(CaseContext context)
CaseContext(Case theCase, ProgressIndicator progressIndicator)
CaseContext(Case theCase, ProgressIndicator progressIndicator, boolean isNewCase)
default void closeCaseResources(CaseContext context)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.