Autopsy  4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ResultDomain.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 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.discovery.search;
20 
21 import org.openide.util.NbBundle;
22 import org.sleuthkit.datamodel.Content;
23 import org.sleuthkit.datamodel.TskData;
24 
28 public class ResultDomain extends Result {
29 
30  private final String domain;
31  private final Long activityStart;
32  private final Long activityEnd;
33  private final Long totalPageViews;
34  private final Long pageViewsInLast60;
35  private final Long filesDownloaded;
36  private final Long countOfKnownAccountTypes;
37  private String webCategory;
38 
39  private final Content dataSource;
40  private final long dataSourceId;
41 
47  ResultDomain(String domain, Long activityStart, Long activityEnd, Long totalPageViews,
48  Long pageViewsInLast60, Long filesDownloaded, Long countOfKnownAccountTypes, Content dataSource) {
49  this.domain = domain;
50  this.dataSource = dataSource;
51  this.dataSourceId = dataSource.getId();
52  this.activityStart = activityStart;
53  this.activityEnd = activityEnd;
54  this.totalPageViews = totalPageViews;
55  this.pageViewsInLast60 = pageViewsInLast60;
56  this.filesDownloaded = filesDownloaded;
57  this.countOfKnownAccountTypes = countOfKnownAccountTypes;
58  }
59 
65  public String getDomain() {
66  return this.domain;
67  }
68 
74  public Long getActivityStart() {
75  return activityStart;
76  }
77 
83  public Long getActivityEnd() {
84  return activityEnd;
85  }
86 
93  public Long getTotalPageViews() {
94  return totalPageViews;
95  }
96 
104  public Long getPageViewsInLast60Days() {
105  return pageViewsInLast60;
106  }
107 
113  public Long getFilesDownloaded() {
114  return filesDownloaded;
115  }
116 
120  @NbBundle.Messages({
121  "ResultDomain_getDefaultCategory=Uncategorized"
122  })
123  public String getWebCategory() {
124  if (webCategory == null) {
125  return Bundle.ResultDomain_getDefaultCategory();
126  } else {
127  return webCategory;
128  }
129  }
130 
134  public void setWebCategory(String webCategory) {
135  this.webCategory = webCategory;
136  }
137 
142  public boolean hasKnownAccountType() {
143  return countOfKnownAccountTypes != null
144  && countOfKnownAccountTypes > 0;
145  }
146 
147  @Override
148  public long getDataSourceObjectId() {
149  return this.dataSourceId;
150  }
151 
152  @Override
153  public Content getDataSource() {
154  return this.dataSource;
155  }
156 
157  @Override
158  public TskData.FileKnown getKnown() {
159  return TskData.FileKnown.UNKNOWN;
160  }
161 
162  @Override
164  return SearchData.Type.DOMAIN;
165  }
166 
167  @Override
168  public String toString() {
169  return "[domain=" + this.domain + ", data_source=" + this.dataSourceId + ", start="
170  + this.activityStart + ", end=" + this.activityEnd + ", totalVisits=" + this.totalPageViews + ", visitsLast60="
171  + this.pageViewsInLast60 + ", downloads=" + this.filesDownloaded + ", frequency="
172  + this.getFrequency() + "]";
173  }
174 }

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