Sleuth Kit Java Bindings (JNI)  4.10.1
Java bindings for using The Sleuth Kit
BlackboardAttribute.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2011-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.datamodel;
20 
21 import java.io.Serializable;
22 import java.util.Arrays;
23 import java.util.Collections;
24 import java.util.List;
25 import java.util.Objects;
26 import java.util.ResourceBundle;
27 import java.util.TimeZone;
28 import java.util.logging.Level;
29 import java.util.logging.Logger;
30 
45 public class BlackboardAttribute {
46 
47  private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
48  private static final Logger LOGGER = Logger.getLogger(BlackboardAttribute.class.getName());
49 
50  private static final ResourceBundle bundle = ResourceBundle.getBundle("org.sleuthkit.datamodel.Bundle");
51  private BlackboardAttribute.Type attributeType;
52  private final int valueInt;
53  private final long valueLong;
54  private final double valueDouble;
55  private final String valueString;
56  private final byte[] valueBytes;
57  private String context;
58  private long artifactID;
59  private SleuthkitCase sleuthkitCase;
60  private String sources;
61 
62  // Cached parent artifact. This field is populated lazily upon the first
63  // call to getParentArtifact().
64  private BlackboardArtifact parentArtifact;
65 
66  // The parent data source is defined as being
67  // the data source of the parent artifact.
68  private Long parentDataSourceID;
69 
82  public BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, int valueInt) throws IllegalArgumentException {
84  throw new IllegalArgumentException("Value types do not match");
85  }
86  this.artifactID = 0;
87  this.attributeType = new BlackboardAttribute.Type(attributeType);
88  this.sources = replaceNulls(source);
89  this.valueInt = valueInt;
90  this.valueLong = 0;
91  this.valueDouble = 0;
92  this.valueString = "";
93  this.valueBytes = new byte[0];
94  this.context = "";
95  }
96 
109  public BlackboardAttribute(Type attributeType, String source, int valueInt) throws IllegalArgumentException {
111  throw new IllegalArgumentException("Type mismatched with value type");
112  }
113  this.artifactID = 0;
114  this.attributeType = attributeType;
115  this.sources = replaceNulls(source);
116  this.valueInt = valueInt;
117  this.valueLong = 0;
118  this.valueDouble = 0;
119  this.valueString = "";
120  this.valueBytes = new byte[0];
121  this.context = "";
122  }
123 
139  public BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, long valueLong) throws IllegalArgumentException {
142  throw new IllegalArgumentException("Value types do not match");
143  }
144  this.artifactID = 0;
145  this.attributeType = new BlackboardAttribute.Type(attributeType);
146  this.sources = replaceNulls(source);
147  this.valueInt = 0;
148  this.valueLong = valueLong;
149  this.valueDouble = 0;
150  this.valueString = "";
151  this.valueBytes = new byte[0];
152  this.context = "";
153  }
154 
169  public BlackboardAttribute(Type attributeType, String source, long valueLong) throws IllegalArgumentException {
172  throw new IllegalArgumentException("Type mismatched with value type");
173  }
174  this.artifactID = 0;
175  this.attributeType = attributeType;
176  this.sources = replaceNulls(source);
177  this.valueInt = 0;
178  this.valueLong = valueLong;
179  this.valueDouble = 0;
180  this.valueString = "";
181  this.valueBytes = new byte[0];
182  this.context = "";
183  }
184 
197  public BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, double valueDouble) throws IllegalArgumentException {
199  throw new IllegalArgumentException("Value types do not match");
200  }
201  this.artifactID = 0;
202  this.attributeType = new BlackboardAttribute.Type(attributeType);
203  this.sources = replaceNulls(source);
204  this.valueInt = 0;
205  this.valueLong = 0;
206  this.valueDouble = valueDouble;
207  this.valueString = "";
208  this.valueBytes = new byte[0];
209  this.context = "";
210 
211  }
212 
225  public BlackboardAttribute(Type attributeType, String source, double valueDouble) throws IllegalArgumentException {
227  throw new IllegalArgumentException("Type mismatched with value type");
228  }
229  this.artifactID = 0;
230  this.attributeType = attributeType;
231  this.sources = replaceNulls(source);
232  this.valueInt = 0;
233  this.valueLong = 0;
234  this.valueDouble = valueDouble;
235  this.valueString = "";
236  this.valueBytes = new byte[0];
237  this.context = "";
238  }
239 
254  public BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, String valueString) throws IllegalArgumentException {
256  && attributeType.getValueType() != TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.JSON) {
257  throw new IllegalArgumentException("Value types do not match");
258  }
259  this.artifactID = 0;
260  this.attributeType = new BlackboardAttribute.Type(attributeType);
261  this.sources = replaceNulls(source);
262  this.valueInt = 0;
263  this.valueLong = 0;
264  this.valueDouble = 0;
265  if (valueString == null) {
266  this.valueString = "";
267  } else {
268  this.valueString = replaceNulls(valueString).trim();
269  }
270  this.valueBytes = new byte[0];
271  this.context = "";
272  }
273 
286  public BlackboardAttribute(Type attributeType, String source, String valueString) throws IllegalArgumentException {
288  && attributeType.getValueType() != TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.JSON) {
289  throw new IllegalArgumentException("Type mismatched with value type");
290  }
291  this.artifactID = 0;
292  this.attributeType = attributeType;
293  this.sources = replaceNulls(source);
294  this.valueInt = 0;
295  this.valueLong = 0;
296  this.valueDouble = 0;
297  if (valueString == null) {
298  this.valueString = "";
299  } else {
300  this.valueString = replaceNulls(valueString).trim();
301  }
302  this.valueBytes = new byte[0];
303  this.context = "";
304  }
305 
318  public BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, byte[] valueBytes) throws IllegalArgumentException {
319  if (attributeType.getValueType() != TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE) {
320  throw new IllegalArgumentException("Value types do not match");
321  }
322  this.artifactID = 0;
323  this.attributeType = new BlackboardAttribute.Type(attributeType);
324  this.sources = replaceNulls(source);
325  this.context = "";
326  this.valueInt = 0;
327  this.valueLong = 0;
328  this.valueDouble = 0;
329  this.valueString = "";
330  if (valueBytes == null) {
331  this.valueBytes = new byte[0];
332  } else {
333  this.valueBytes = valueBytes;
334  }
335  }
336 
349  public BlackboardAttribute(Type attributeType, String source, byte[] valueBytes) throws IllegalArgumentException {
350  if (attributeType.getValueType() != TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE) {
351  throw new IllegalArgumentException("Type mismatched with value type");
352  }
353  this.artifactID = 0;
354  this.attributeType = attributeType;
355  this.sources = replaceNulls(source);
356  this.context = "";
357  this.valueInt = 0;
358  this.valueLong = 0;
359  this.valueDouble = 0;
360  this.valueString = "";
361  if (valueBytes == null) {
362  this.valueBytes = new byte[0];
363  } else {
364  this.valueBytes = valueBytes;
365  }
366  }
367 
375  public long getArtifactID() {
376  return artifactID;
377  }
378 
385  return this.attributeType;
386  }
387 
394  return attributeType.getValueType();
395  }
396 
403  public int getValueInt() {
404  return valueInt;
405  }
406 
413  public long getValueLong() {
414  return valueLong;
415  }
416 
423  public double getValueDouble() {
424  return valueDouble;
425  }
426 
434  public String getValueString() {
435  return valueString;
436  }
437 
444  public byte[] getValueBytes() {
445  return Arrays.copyOf(valueBytes, valueBytes.length);
446  }
447 
453  public List<String> getSources() {
454  if (null != sources && !this.sources.isEmpty()) {
455  List<String> modules = Arrays.asList(sources.split(","));
456  return modules;
457  } else {
458  return Collections.emptyList();
459  }
460  }
461 
469  public void addSource(String source) throws TskCoreException {
470  this.sources = sleuthkitCase.addSourceToArtifactAttribute(this, source);
471  }
472 
485  if (parentArtifact == null) {
486  parentArtifact = sleuthkitCase.getBlackboardArtifact(artifactID);
487  }
488  return parentArtifact;
489  }
490 
491  @Override
492  public int hashCode() {
493  int hash = 5;
494  hash = 97 * hash + (int) (this.artifactID ^ (this.artifactID >>> 32));
495  return hash;
496  }
497 
498  @Override
499  public boolean equals(Object obj) {
500  if (obj == null) {
501  return false;
502  }
503  if (getClass() != obj.getClass()) {
504  return false;
505  }
506  final BlackboardAttribute other = (BlackboardAttribute) obj;
507  return this.artifactID == other.getArtifactID();
508  }
509 
510  @Override
511  public String toString() {
512  return "BlackboardAttribute{" + "artifactID=" + artifactID + ", attributeType=" + attributeType.toString() + ", moduleName=" + sources + ", context=" + context + ", valueInt=" + valueInt + ", valueLong=" + valueLong + ", valueDouble=" + valueDouble + ", valueString=" + valueString + ", valueBytes=" + Arrays.toString(valueBytes) + ", Case=" + sleuthkitCase + '}'; //NON-NLS
513  }
514 
520  public String getDisplayString() {
521  switch (attributeType.getValueType()) {
522  case STRING:
523  return getValueString();
524  case INTEGER:
525  if (attributeType.getTypeID() == ATTRIBUTE_TYPE.TSK_READ_STATUS.getTypeID()) {
526  if (getValueInt() == 0) {
527  return "Unread";
528  } else {
529  return "Read";
530  }
531  }
532  return Integer.toString(getValueInt());
533  case LONG:
534  // SHOULD at some point figure out how to convert times in here
535  // based on preferred formats and such. Perhaps provide another
536  // method that takes a formatter argument.
537  return Long.toString(getValueLong());
538  case DOUBLE:
539  return Double.toString(getValueDouble());
540  case BYTE:
541  return bytesToHexString(getValueBytes());
542 
543  case DATETIME: {
544  try {
545  if (parentDataSourceID == null) {
547  parentDataSourceID = parent.getDataSourceObjectID();
548  }
549  final Content dataSource = sleuthkitCase.getContentById(parentDataSourceID);
550  if ((dataSource != null) && (dataSource instanceof Image)) {
551  // return the date/time string in the timezone associated with the datasource,
552  Image image = (Image) dataSource;
553  TimeZone tzone = TimeZone.getTimeZone(image.getTimeZone());
554  return TimeUtilities.epochToTime(getValueLong(), tzone);
555  }
556  } catch (TskException ex) {
557  LOGGER.log(Level.WARNING, "Could not get timezone for image", ex); //NON-NLS
558  }
559  // return time string in default timezone
561  }
562  case JSON: {
563  return getValueString();
564  }
565  }
566  return "";
567  }
568 
587  BlackboardAttribute(long artifactID, BlackboardAttribute.Type attributeType, String source, String context,
588  int valueInt, long valueLong, double valueDouble, String valueString, byte[] valueBytes,
589  SleuthkitCase sleuthkitCase) {
590 
591  this.artifactID = artifactID;
592  this.attributeType = attributeType;
593  this.sources = replaceNulls(source);
594  this.context = replaceNulls(context);
595  this.valueInt = valueInt;
596  this.valueLong = valueLong;
597  this.valueDouble = valueDouble;
598  if (valueString == null) {
599  this.valueString = "";
600  } else {
601  this.valueString = replaceNulls(valueString).trim();
602  }
603  if (valueBytes == null) {
604  this.valueBytes = new byte[0];
605  } else {
606  this.valueBytes = valueBytes;
607  }
608  this.sleuthkitCase = sleuthkitCase;
609  }
610 
617  void setCaseDatabase(SleuthkitCase sleuthkitCase) {
618  this.sleuthkitCase = sleuthkitCase;
619  }
620 
626  void setArtifactId(long artifactID) {
627  this.artifactID = artifactID;
628  }
629 
636  void setParentDataSourceID(long parentDataSourceID) {
637  this.parentDataSourceID = parentDataSourceID;
638  }
639 
648  String getSourcesCSV() {
649  return sources;
650  }
651 
659  static String bytesToHexString(byte[] bytes) {
660  // from http://stackoverflow.com/questions/9655181/convert-from-byte-array-to-hex-string-in-java
661  char[] hexChars = new char[bytes.length * 2];
662  for (int j = 0; j < bytes.length; j++) {
663  int v = bytes[j] & 0xFF;
664  hexChars[j * 2] = HEX_ARRAY[v >>> 4];
665  hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
666  }
667  return new String(hexChars);
668  }
669 
677  private String replaceNulls(String text) {
678  return text.replace((char) 0x00, (char) 0x1A);
679  }
680 
684  public static final class Type implements Serializable {
685 
686  private static final long serialVersionUID = 1L;
687  private final String typeName;
688  private final int typeID;
689  private final String displayName;
690  private final TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType;
691 
700  public Type(int typeID, String typeName, String displayName, TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType) {
701  this.typeID = typeID;
702  this.typeName = typeName;
703  this.displayName = displayName;
704  this.valueType = valueType;
705  }
706 
714  this.typeID = type.getTypeID();
715  this.typeName = type.getLabel();
716  this.displayName = type.getDisplayName();
717  this.valueType = type.getValueType();
718  }
719 
726  return this.valueType;
727  }
728 
734  public String getTypeName() {
735  return this.typeName;
736  }
737 
743  public int getTypeID() {
744  return this.typeID;
745  }
746 
752  public String getDisplayName() {
753  return this.displayName;
754  }
755 
756  @Override
757  public boolean equals(Object that) {
758  if (this == that) {
759  return true;
760  } else if (!(that instanceof BlackboardAttribute.Type)) {
761  return false;
762  } else {
763  return ((BlackboardAttribute.Type) that).sameType(this);
764  }
765  }
766 
775  private boolean sameType(BlackboardAttribute.Type that) {
776  return this.typeName.equals(that.getTypeName())
777  && this.displayName.equals(that.getDisplayName())
778  && this.typeID == that.getTypeID()
779  && this.valueType == that.getValueType();
780  }
781 
782  @Override
783  public int hashCode() {
784  int hash = 7;
785  hash = 63 * hash + Objects.hashCode(this.typeID);
786  hash = 63 * hash + Objects.hashCode(this.displayName);
787  hash = 63 * hash + Objects.hashCode(this.typeName);
788  hash = 63 * hash + Objects.hashCode(this.valueType);
789  return hash;
790  }
791 
792  @Override
793  public String toString() {
794  return "(typeID= " + this.typeID
795  + ", displayName=" + this.displayName
796  + ", typeName=" + this.typeName
797  + ", valueType=" + this.valueType + ")";
798  }
799  }
800 
806 
810  STRING(0, "String"), //NON-NLS
814  INTEGER(1, "Integer"), //NON-NLS
818  LONG(2, "Long"), //NON-NLS
822  DOUBLE(3, "Double"), //NON-NLS
826  BYTE(4, "Byte"), //NON-NLS
831  DATETIME(5, "DateTime"),
835  JSON(6, "Json");
836 
837  private final long typeId;
838  private final String typeName;
839 
840  /*
841  * TODO (AUT-2070): Add a localized displayName field and a
842  * getDisplayName method for API consistency.
843  */
850  private TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE(long type, String typeName) {
851  this.typeId = type;
852  this.typeName = typeName;
853  }
854 
863  public long getType() {
864  return typeId;
865  }
866 
875  public String getLabel() {
876  return this.typeName;
877  }
878 
893  static public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE fromType(long typeId) {
895  if (valueType.getType() == typeId) {
896  return valueType;
897  }
898  }
899  throw new IllegalArgumentException("No TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE matching type: " + typeId);
900  }
901 
916  static public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE fromLabel(String typeName) {
918  if (valueType.getLabel().equals(typeName)) {
919  return valueType;
920  }
921  }
922  throw new IllegalArgumentException("No TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE matching type: " + typeName);
923  }
924 
925  }
926 
933  public enum ATTRIBUTE_TYPE {
934 
935  TSK_URL(1, "TSK_URL", //NON-NLS
936  bundle.getString("BlackboardAttribute.tskUrl.text"),
938  TSK_DATETIME(2, "TSK_DATETIME", //NON-NLS
939  bundle.getString("BlackboardAttribute.tskDatetime.text"),
941  TSK_NAME(3, "TSK_NAME", //NON-NLS
942  bundle.getString("BlackboardAttribute.tskName.text"),
944  TSK_PROG_NAME(4, "TSK_PROG_NAME", //NON-NLS
945  bundle.getString("BlackboardAttribute.tskProgName.text"),
947  TSK_VALUE(6, "TSK_VALUE", //NON-NLS
948  bundle.getString("BlackboardAttribute.tskValue.text"),
950  TSK_FLAG(7, "TSK_FLAG", //NON-NLS
951  bundle.getString("BlackboardAttribute.tskFlag.text"),
953  TSK_PATH(8, "TSK_PATH", //NON-NLS
954  bundle.getString("BlackboardAttribute.tskPath.text"),
956  TSK_KEYWORD(10, "TSK_KEYWORD", //NON-NLS
957  bundle.getString("BlackboardAttribute.tskKeyword.text"),
959  TSK_KEYWORD_REGEXP(11, "TSK_KEYWORD_REGEXP", //NON-NLS
960  bundle.getString("BlackboardAttribute.tskKeywordRegexp.text"),
962  TSK_KEYWORD_PREVIEW(12, "TSK_KEYWORD_PREVIEW", //NON-NLS
963  bundle.getString("BlackboardAttribute.tskKeywordPreview.text"),
968  @Deprecated
969  TSK_KEYWORD_SET(13, "TSK_KEYWORD_SET", //NON-NLS
970  bundle.getString("BlackboardAttribute.tskKeywordSet.text"),
972  TSK_USER_NAME(14, "TSK_USER_NAME", //NON-NLS
973  bundle.getString("BlackboardAttribute.tskUserName.text"),
975  TSK_DOMAIN(15, "TSK_DOMAIN", //NON-NLS
976  bundle.getString("BlackboardAttribute.tskDomain.text"),
978  TSK_PASSWORD(16, "TSK_PASSWORD", //NON-NLS
979  bundle.getString("BlackboardAttribute.tskPassword.text"),
981  TSK_NAME_PERSON(17, "TSK_NAME_PERSON", //NON-NLS
982  bundle.getString("BlackboardAttribute.tskNamePerson.text"),
984  TSK_DEVICE_MODEL(18, "TSK_DEVICE_MODEL", //NON-NLS
985  bundle.getString("BlackboardAttribute.tskDeviceModel.text"),
987  TSK_DEVICE_MAKE(19, "TSK_DEVICE_MAKE", //NON-NLS
988  bundle.getString("BlackboardAttribute.tskDeviceMake.text"),
990  TSK_DEVICE_ID(20, "TSK_DEVICE_ID", //NON-NLS
991  bundle.getString("BlackboardAttribute.tskDeviceId.text"),
993  TSK_EMAIL(21, "TSK_EMAIL", //NON-NLS
994  bundle.getString("BlackboardAttribute.tskEmail.text"),
996  TSK_HASH_MD5(22, "TSK_HASH_MD5", //NON-NLS
997  bundle.getString("BlackboardAttribute.tskHashMd5.text"),
999  TSK_HASH_SHA1(23, "TSK_HASH_SHA1", //NON-NLS
1000  bundle.getString("BlackboardAttribute.tskHashSha1.text"),
1002  TSK_HASH_SHA2_256(24, "TSK_HASH_SHA2_256", //NON-NLS
1003  bundle.getString("BlackboardAttribute.tskHashSha225.text"),
1005  TSK_HASH_SHA2_512(25, "TSK_HASH_SHA2_512", //NON-NLS
1006  bundle.getString("BlackboardAttribute.tskHashSha2512.text"),
1008  TSK_TEXT(26, "TSK_TEXT", //NON-NLS
1009  bundle.getString("BlackboardAttribute.tskText.text"),
1011  TSK_TEXT_FILE(27, "TSK_TEXT_FILE", //NON-NLS
1012  bundle.getString("BlackboardAttribute.tskTextFile.text"),
1014  TSK_TEXT_LANGUAGE(28, "TSK_TEXT_LANGUAGE", //NON-NLS
1015  bundle.getString("BlackboardAttribute.tskTextLanguage.text"),
1017  TSK_ENTROPY(29, "TSK_ENTROPY", //NON-NLS
1018  bundle.getString("BlackboardAttribute.tskEntropy.text"),
1023  @Deprecated
1024  TSK_HASHSET_NAME(30, "TSK_HASHSET_NAME", //NON-NLS
1025  bundle.getString("BlackboardAttribute.tskHashsetName.text"),
1030  @Deprecated
1031  TSK_INTERESTING_FILE(31, "TSK_INTERESTING_FILE", //NON-NLS
1032  bundle.getString("BlackboardAttribute.tskInterestingFile.text"),
1034  TSK_REFERRER(32, "TSK_REFERRER", //NON-NLS
1035  bundle.getString("BlackboardAttribute.tskReferrer.text"),
1037  TSK_DATETIME_ACCESSED(33, "TSK_DATETIME_ACCESSED", //NON-NLS
1038  bundle.getString("BlackboardAttribute.tskDateTimeAccessed.text"),
1040  TSK_IP_ADDRESS(34, "TSK_IP_ADDRESS", //NON-NLS
1041  bundle.getString("BlackboardAttribute.tskIpAddress.text"),
1043  TSK_PHONE_NUMBER(35, "TSK_PHONE_NUMBER", //NON-NLS
1044  bundle.getString("BlackboardAttribute.tskPhoneNumber.text"),
1046  TSK_PATH_ID(36, "TSK_PATH_ID", //NON-NLS
1047  bundle.getString("BlackboardAttribute.tskPathId.text"),
1049  TSK_SET_NAME(37, "TSK_SET_NAME", //NON-NLS
1050  bundle.getString("BlackboardAttribute.tskSetName.text"),
1055  @Deprecated
1056  TSK_ENCRYPTION_DETECTED(38, "TSK_ENCRYPTION_DETECTED", //NON-NLS
1057  bundle.getString("BlackboardAttribute.tskEncryptionDetected.text"),
1059  TSK_MALWARE_DETECTED(39, "TSK_MALWARE_DETECTED", //NON-NLS
1060  bundle.getString("BlackboardAttribute.tskMalwareDetected.text"),
1062  TSK_STEG_DETECTED(40, "TSK_STEG_DETECTED", //NON-NLS
1063  bundle.getString("BlackboardAttribute.tskStegDetected.text"),
1065  TSK_EMAIL_TO(41, "TSK_EMAIL_TO", //NON-NLS
1066  bundle.getString("BlackboardAttribute.tskEmailTo.text"),
1068  TSK_EMAIL_CC(42, "TSK_EMAIL_CC", //NON-NLS
1069  bundle.getString("BlackboardAttribute.tskEmailCc.text"),
1071  TSK_EMAIL_BCC(43, "TSK_EMAIL_BCC", //NON-NLS
1072  bundle.getString("BlackboardAttribute.tskEmailBcc.text"),
1074  TSK_EMAIL_FROM(44, "TSK_EMAIL_FROM", //NON-NLS
1075  bundle.getString("BlackboardAttribute.tskEmailFrom.text"),
1077  TSK_EMAIL_CONTENT_PLAIN(45, "TSK_EMAIL_CONTENT_PLAIN", //NON-NLS
1078  bundle.getString("BlackboardAttribute.tskEmailContentPlain.text"),
1080  TSK_EMAIL_CONTENT_HTML(46, "TSK_EMAIL_CONTENT_HTML", //NON-NLS
1081  bundle.getString("BlackboardAttribute.tskEmailContentHtml.text"),
1083  TSK_EMAIL_CONTENT_RTF(47, "TSK_EMAIL_CONTENT_RTF", //NON-NLS
1084  bundle.getString("BlackboardAttribute.tskEmailContentRtf.text"),
1086  TSK_MSG_ID(48, "TSK_MSG_ID", //NON-NLS
1087  bundle.getString("BlackboardAttribute.tskMsgId.text"),
1089  TSK_MSG_REPLY_ID(49, "TSK_MSG_REPLY_ID", //NON-NLS
1090  bundle.getString("BlackboardAttribute.tskMsgReplyId.text"),
1092  TSK_DATETIME_RCVD(50, "TSK_DATETIME_RCVD", //NON-NLS
1093  bundle.getString("BlackboardAttribute.tskDateTimeRcvd.text"),
1095  TSK_DATETIME_SENT(51, "TSK_DATETIME_SENT", //NON-NLS
1096  bundle.getString("BlackboardAttribute.tskDateTimeSent.text"),
1098  TSK_SUBJECT(52, "TSK_SUBJECT", //NON-NLS
1099  bundle.getString("BlackboardAttribute.tskSubject.text"),
1101  TSK_TITLE(53, "TSK_TITLE", //NON-NLS
1102  bundle.getString("BlackboardAttribute.tskTitle.text"),
1104  TSK_GEO_LATITUDE(54, "TSK_GEO_LATITUDE", //NON-NLS
1105  bundle.getString("BlackboardAttribute.tskGeoLatitude.text"),
1107  TSK_GEO_LONGITUDE(55, "TSK_GEO_LONGITUDE", //NON-NLS
1108  bundle.getString("BlackboardAttribute.tskGeoLongitude.text"),
1110  TSK_GEO_VELOCITY(56, "TSK_GEO_VELOCITY", //NON-NLS
1111  bundle.getString("BlackboardAttribute.tskGeoVelocity.text"),
1113  TSK_GEO_ALTITUDE(57, "TSK_GEO_ALTITUDE", //NON-NLS
1114  bundle.getString("BlackboardAttribute.tskGeoAltitude.text"),
1116  TSK_GEO_BEARING(58, "TSK_GEO_BEARING", //NON-NLS
1117  bundle.getString("BlackboardAttribute.tskGeoBearing.text"),
1119  TSK_GEO_HPRECISION(59, "TSK_GEO_HPRECISION", //NON-NLS
1120  bundle.getString("BlackboardAttribute.tskGeoHPrecision.text"),
1122  TSK_GEO_VPRECISION(60, "TSK_GEO_VPRECISION", //NON-NLS
1123  bundle.getString("BlackboardAttribute.tskGeoVPrecision.text"),
1125  TSK_GEO_MAPDATUM(61, "TSK_GEO_MAPDATUM", //NON-NLS
1126  bundle.getString("BlackboardAttribute.tskGeoMapDatum.text"),
1132  @Deprecated
1133  TSK_FILE_TYPE_SIG(62, "TSK_FILE_TYPE_SIG", //NON-NLS
1134  bundle.getString("BlackboardAttribute.tskFileTypeSig.text"),
1136  TSK_FILE_TYPE_EXT(63, "TSK_FILE_TYPE_EXT", //NON-NLS
1137  bundle.getString("BlackboardAttribute.tskFileTypeExt.text"),
1143  @Deprecated
1144  TSK_TAGGED_ARTIFACT(64, "TSK_TAGGED_ARTIFACT", //NON-NLS
1145  bundle.getString("BlackboardAttribute.tskTaggedArtifact.text"),
1151  @Deprecated
1152  TSK_TAG_NAME(65, "TSK_TAG_NAME", //NON-NLS
1153  bundle.getString("BlackboardAttribute.tskTagName.text"),
1155  TSK_COMMENT(66, "TSK_COMMENT", //NON-NLS
1156  bundle.getString("BlackboardAttribute.tskComment.text"),
1158  TSK_URL_DECODED(67, "TSK_URL_DECODED", //NON-NLS
1159  bundle.getString("BlackboardAttribute.tskUrlDecoded.text"),
1161  TSK_DATETIME_CREATED(68, "TSK_DATETIME_CREATED", //NON-NLS
1162  bundle.getString("BlackboardAttribute.tskDateTimeCreated.text"),
1164  TSK_DATETIME_MODIFIED(69, "TSK_DATETIME_MODIFIED", //NON-NLS
1165  bundle.getString("BlackboardAttribute.tskDateTimeModified.text"),
1167  TSK_PROCESSOR_ARCHITECTURE(70, "TSK_PROCESSOR_ARCHITECTURE", //NON-NLS
1168  bundle.getString("BlackboardAttribute.tskProcessorArchitecture.text"),
1170  TSK_VERSION(71, "TSK_VERSION", //NON-NLS
1171  bundle.getString("BlackboardAttribute.tskVersion.text"),
1173  TSK_USER_ID(72, "TSK_USER_ID", //NON-NLS
1174  bundle.getString("BlackboardAttribute.tskUserId.text"),
1176  TSK_DESCRIPTION(73, "TSK_DESCRIPTION", //NON-NLS
1177  bundle.getString("BlackboardAttribute.tskDescription.text"),
1179  TSK_MESSAGE_TYPE(74, "TSK_MESSAGE_TYPE", //NON-NLS
1180  bundle.getString("BlackboardAttribute.tskMessageType.text"),
1181  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // SMS or MMS or IM ...
1182  TSK_PHONE_NUMBER_HOME(75, "TSK_PHONE_NUMBER_HOME", //NON-NLS
1183  bundle.getString("BlackboardAttribute.tskPhoneNumberHome.text"),
1185  TSK_PHONE_NUMBER_OFFICE(76, "TSK_PHONE_NUMBER_OFFICE", //NON-NLS
1186  bundle.getString("BlackboardAttribute.tskPhoneNumberOffice.text"),
1188  TSK_PHONE_NUMBER_MOBILE(77, "TSK_PHONE_NUMBER_MOBILE", //NON-NLS
1189  bundle.getString("BlackboardAttribute.tskPhoneNumberMobile.text"),
1191  TSK_PHONE_NUMBER_FROM(78, "TSK_PHONE_NUMBER_FROM", //NON-NLS
1192  bundle.getString("BlackboardAttribute.tskPhoneNumberFrom.text"),
1194  TSK_PHONE_NUMBER_TO(79, "TSK_PHONE_NUMBER_TO", //NON-NLS
1195  bundle.getString("BlackboardAttribute.tskPhoneNumberTo.text"),
1197  TSK_DIRECTION(80, "TSK_DIRECTION", //NON-NLS
1198  bundle.getString("BlackboardAttribute.tskDirection.text"),
1199  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Msg/Call direction: incoming, outgoing
1200  TSK_EMAIL_HOME(81, "TSK_EMAIL_HOME", //NON-NLS
1201  bundle.getString("BlackboardAttribute.tskEmailHome.text"),
1203  TSK_EMAIL_OFFICE(82, "TSK_EMAIL_OFFICE", //NON-NLS
1204  bundle.getString("BlackboardAttribute.tskEmailOffice.text"),
1206  TSK_DATETIME_START(83, "TSK_DATETIME_START", //NON-NLS
1207  bundle.getString("BlackboardAttribute.tskDateTimeStart.text"),
1208  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME), // start time of an event - call log, Calendar entry
1209  TSK_DATETIME_END(84, "TSK_DATETIME_END", //NON-NLS
1210  bundle.getString("BlackboardAttribute.tskDateTimeEnd.text"),
1211  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME), // end time of an event - call log, Calendar entry
1212  TSK_CALENDAR_ENTRY_TYPE(85, "TSK_CALENDAR_ENTRY_TYPE", //NON-NLS
1213  bundle.getString("BlackboardAttribute.tskCalendarEntryType.text"),
1214  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // meeting, task,
1215  TSK_LOCATION(86, "TSK_LOCATION", //NON-NLS
1216  bundle.getString("BlackboardAttribute.tskLocation.text"),
1217  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Location string associated with an event - Conf Room Name, Address ....
1218  TSK_SHORTCUT(87, "TSK_SHORTCUT", //NON-NLS
1219  bundle.getString("BlackboardAttribute.tskShortcut.text"),
1220  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Short Cut string - short code or dial string for Speed dial, a URL short cut - e.g. bitly string, Windows Desktop Short cut name etc.
1221  TSK_DEVICE_NAME(88, "TSK_DEVICE_NAME", //NON-NLS
1222  bundle.getString("BlackboardAttribute.tskDeviceName.text"),
1223  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // device name - a user assigned (usually) device name - such as "Joe's computer", "bob_win8", "BT Headset"
1224  TSK_CATEGORY(89, "TSK_CATEGORY", //NON-NLS
1225  bundle.getString("BlackboardAttribute.tskCategory.text"),
1226  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // category/type, possible value set varies by the artifact
1227  TSK_EMAIL_REPLYTO(90, "TSK_EMAIL_REPLYTO", //NON-NLS
1228  bundle.getString("BlackboardAttribute.tskEmailReplyTo.text"),
1229  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // ReplyTo address
1230  TSK_SERVER_NAME(91, "TSK_SERVER_NAME", //NON-NLS
1231  bundle.getString("BlackboardAttribute.tskServerName.text"),
1232  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // server name, e.g. a mail server name - "smtp.google.com", a DNS server name...
1233  TSK_COUNT(92, "TSK_COUNT", //NON-NLS
1234  bundle.getString("BlackboardAttribute.tskCount.text"),
1235  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER), // Count related to the artifact
1236  TSK_MIN_COUNT(93, "TSK_MIN_COUNT", //NON-NLS
1237  bundle.getString("BlackboardAttribute.tskMinCount.text"),
1238  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER), // Minimum number/count
1239  TSK_PATH_SOURCE(94, "TSK_PATH_SOURCE", //NON-NLS
1240  bundle.getString("BlackboardAttribute.tskPathSource.text"),
1241  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Path to a source file related to the artifact
1242  TSK_PERMISSIONS(95, "TSK_PERMISSIONS", //NON-NLS
1243  bundle.getString("BlackboardAttribute.tskPermissions.text"),
1245  TSK_ASSOCIATED_ARTIFACT(96, "TSK_ASSOCIATED_ARTIFACT", //NON-NLS
1246  bundle.getString("BlackboardAttribute.tskAssociatedArtifact.text"),
1247  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.LONG), // Artifact ID of a related artifact
1248  TSK_ISDELETED(97, "TSK_ISDELETED", //NON-NLS
1249  bundle.getString("BlackboardAttribute.tskIsDeleted.text"),
1250  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // boolean to indicate that the artifact is recovered fom deleted content
1251  TSK_GEO_LATITUDE_START(98, "TSK_GEO_LATITUDE_START", //NON-NLS
1252  bundle.getString("BlackboardAttribute.tskGeoLatitudeStart.text"),
1253  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE), // Starting location lattitude
1254  TSK_GEO_LATITUDE_END(99, "TSK_GEO_LATITUDE_END", //NON-NLS
1255  bundle.getString("BlackboardAttribute.tskGeoLatitudeEnd.text"),
1256  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE), // Ending location lattitude
1257  TSK_GEO_LONGITUDE_START(100, "TSK_GEO_LONGITUDE_START", //NON-NLS
1258  bundle.getString("BlackboardAttribute.tskGeoLongitudeStart.text"),
1259  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE), // Starting location longitude
1260  TSK_GEO_LONGITUDE_END(101, "TSK_GEO_LONGITUDE_END", //NON-NLS
1261  bundle.getString("BlackboardAttribute.tskGeoLongitudeEnd.text"),
1262  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE), //Ending Location longitude
1263  TSK_READ_STATUS(102, "TSK_READ_STATUS", //NON-NLS
1264  bundle.getString("BlackboardAttribute.tskReadStatus.text"),
1265  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER), // Message read status: 1 if read, 0 if unread
1266  TSK_LOCAL_PATH(103, "TSK_LOCAL_PATH", //NON-NLS
1267  bundle.getString("BlackboardAttribute.tskLocalPath.text"),
1268  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Local path to a network drive
1269  TSK_REMOTE_PATH(104, "TSK_REMOTE_PATH", //NON-NLS
1270  bundle.getString("BlackboardAttribute.tskRemotePath.text"),
1271  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Remote path of a network drive
1272  TSK_TEMP_DIR(105, "TSK_TEMP_DIR", //NON-NLS
1273  bundle.getString("BlackboardAttribute.tskTempDir.text"),
1274  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Default temporary files directory
1275  TSK_PRODUCT_ID(106, "TSK_PRODUCT_ID", //NON-NLS
1276  bundle.getString("BlackboardAttribute.tskProductId.text"),
1278  TSK_OWNER(107, "TSK_OWNER", //NON-NLS
1279  bundle.getString("BlackboardAttribute.tskOwner.text"),
1280  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Registered owner of a piece of software
1281  TSK_ORGANIZATION(108, "TSK_ORGANIZATION", //NON-NLS
1282  bundle.getString("BlackboardAttribute.tskOrganization.text"),
1283  TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING), // Registered Organization for a piece of software
1284  TSK_CARD_NUMBER(109, "TSK_CARD_NUMBER", //NON-NLS
1285  bundle.getString("BlackboardAttribute.tskCardNumber.text"),
1287  TSK_CARD_EXPIRATION(110, "TSK_CARD_EXPIRATION", //for card as 4 digits MMYY //NON-NLS
1288  bundle.getString("BlackboardAttribute.tskCardExpiration.text"),
1290  TSK_CARD_SERVICE_CODE(111, "TSK_CARD_SERVICE_CODE", // 3 digits //NON-NLS
1291  bundle.getString("BlackboardAttribute.tskCardServiceCode.text"),
1293  TSK_CARD_DISCRETIONARY(112, "TSK_CARD_DISCRETIONARY", //data used at the discretion of the issuer //NON-NLS
1294  bundle.getString("BlackboardAttribute.tskCardDiscretionary.text"),
1296  TSK_CARD_LRC(113, "TSK_CARD_LRC", //NON-NLS //Longitudunal Redundancy Check character //NON-NLS
1297  bundle.getString("BlackboardAttribute.tskCardLRC.text"),
1299  TSK_KEYWORD_SEARCH_DOCUMENT_ID(114, "TSK_KEYWORD_SEARCH_DOCUMENT_ID", //NON-NLS
1300  bundle.getString("BlackboardAttribute.tskKeywordSearchDocumentID.text"),
1302  TSK_CARD_SCHEME(115, "TSK_CARD_SCHEME", //amex, visa, mastercard, discover, etc //NON-NLS
1303  bundle.getString("BlackboardAttribute.tskCardScheme.text"),
1305  TSK_CARD_TYPE(116, "TSK_CARD_TYPE", // debit vs credit //NON-NLS
1306  bundle.getString("BlackboardAttribute.tskCardType.text"),
1308  TSK_BRAND_NAME(117, "TSK_BRAND_NAME",
1309  bundle.getString("BlackboardAttribute.tskBrandName.text"),
1311  TSK_BANK_NAME(118, "TSK_BANK_NAME",
1312  bundle.getString("BlackboardAttribute.tskBankName.text"),
1314  TSK_COUNTRY(119, "TSK_COUNTRY",
1315  bundle.getString("BlackboardAttribute.tskCountry.text"),
1317  TSK_CITY(120, "TSK_CITY",
1318  bundle.getString("BlackboardAttribute.tskCity.text"),
1320  TSK_ACCOUNT_TYPE(121, "TSK_ACCOUNT_TYPE",
1321  bundle.getString("BlackboardAttribute.tskAccountType.text"),
1326  TSK_KEYWORD_SEARCH_TYPE(122, "TSK_KEYWORD_SEARCH_TYPE", //NON-NLS
1327  bundle.getString("BlackboardAttribute.tskKeywordSearchType.text"),
1329  TSK_HEADERS(123, "TSK_HEADERS", //NON-NLS
1330  bundle.getString("BlackboardAttribute.tskHeaders.text"),
1332  TSK_ID(124, "TSK_ID", //NON-NLS
1333  bundle.getString("BlackboardAttribute.tskId.text"),
1335  TSK_SSID(125, "TSK_SSID", //NON-NLS
1336  bundle.getString("BlackboardAttribute.tskSsid.text"),
1338  TSK_BSSID(126, "TSK_BSSID", //NON-NLS
1339  bundle.getString("BlackboardAttribute.tskBssid.text"),
1341  TSK_MAC_ADDRESS(127, "TSK_MAC_ADDRESS", //NON-NLS
1342  bundle.getString("BlackboardAttribute.tskMacAddress.text"),
1344  TSK_IMEI(128, "TSK_IMEI", //NON-NLS
1345  bundle.getString("BlackboardAttribute.tskImei.text"),
1347  TSK_IMSI(129, "TSK_IMSI", //NON-NLS
1348  bundle.getString("BlackboardAttribute.tskImsi.text"),
1350  TSK_ICCID(130, "TSK_ICCID", //NON-NLS
1351  bundle.getString("BlackboardAttribute.tskIccid.text"),
1353  TSK_THREAD_ID(131, "TSK_THREAD_ID",
1354  bundle.getString("BlackboardAttribute.tskthreadid.text"),
1360  TSK_TL_EVENT_TYPE(132, "TSK_TL_EVENT_TYPE", //NON-NLS
1361  bundle.getString("BlackboardAttribute.tskTLEventType.text"),
1363  TSK_DATETIME_DELETED(133, "TSK_DATETIME_DELETED", //NON-NLS
1364  bundle.getString("BlackboardAttribute.tskdatetimedeleted.text"),
1366  TSK_DATETIME_PASSWORD_RESET(134, "TSK_DATETIME_PASSWORD_RESET",
1367  bundle.getString("BlackboardAttribute.tskdatetimepwdreset.text"),
1369  TSK_DATETIME_PASSWORD_FAIL(135, "TSK_DATETIME_PWD_FAIL",
1370  bundle.getString("BlackboardAttribute.tskdatetimepwdfail.text"),
1372  TSK_DISPLAY_NAME(136, "TSK_DISPLAY_NAME",
1373  bundle.getString("BlackboardAttribute.tskdisplayname.text"),
1375  TSK_PASSWORD_SETTINGS(137, "TSK_PASSWORD_SETTINGS",
1376  bundle.getString("BlackboardAttribute.tskpasswordsettings.text"),
1378  TSK_ACCOUNT_SETTINGS(138, "TSK_ACCOUNT_SETTINGS",
1379  bundle.getString("BlackboardAttribute.tskaccountsettings.text"),
1381  TSK_PASSWORD_HINT(139, "TSK_PASSWORD_HINT",
1382  bundle.getString("BlackboardAttribute.tskpasswordhint.text"),
1384  TSK_GROUPS(140, "TSK_GROUPS",
1385  bundle.getString("BlackboardAttribute.tskgroups.text"),
1387  /*
1388  * Use
1389  * org.sleuthkit.datamodel.blackboardutils.attributes.MessageAttachments
1390  * to create and process TSK_ATTACHMENTS attributes.
1391  */
1392  TSK_ATTACHMENTS(141, "TSK_ATTACHMENTS",
1393  bundle.getString("BlackboardAttribute.tskattachments.text"),
1395  /*
1396  * Use org.sleuthkit.datamodel.blackboardutils.attributes.GeoTrackPoints
1397  * to create and process TSK_GEO_TRACKPOINTS attributes.
1398  */
1399  TSK_GEO_TRACKPOINTS(142, "TSK_GEO_TRACKPOINTS",
1400  bundle.getString("BlackboardAttribute.tskgeopath.text"),
1402  /*
1403  * Use org.sleuthkit.datamodel.blackboardutils.attributes.GeoWaypoints
1404  * to create and process TSK_GEO_WAYPOINTS attributes.
1405  */
1406  TSK_GEO_WAYPOINTS(143, "TSK_GEO_WAYPOINTS",
1407  bundle.getString("BlackboardAttribute.tskgeowaypoints.text"),
1409  TSK_DISTANCE_TRAVELED(144, "TSK_DISTANCE_TRAVELED",
1410  bundle.getString("BlackboardAttribute.tskdistancetraveled.text"),
1412  TSK_DISTANCE_FROM_HOMEPOINT(145, "TSK_DISTANCE_FROM_HOMEPOINT",
1413  bundle.getString("BlackboardAttribute.tskdistancefromhome.text"),
1415  TSK_HASH_PHOTODNA(146, "TSK_HASH_PHOTODNA",
1416  bundle.getString("BlackboardAttribute.tskhashphotodna.text"),
1418  TSK_BYTES_SENT(147, "TSK_BYTES_SENT",
1419  bundle.getString("BlackboardAttribute.tskbytessent.text"),
1421  TSK_BYTES_RECEIVED(148, "TSK_BYTES_RECEIVED",
1422  bundle.getString("BlackboardAttribute.tskbytesreceived.text"),
1424  TSK_LAST_PRINTED_DATETIME(149, "TSK_LAST_PRINTED_DATETIME",
1425  bundle.getString("BlackboardAttribute.tsklastprinteddatetime.text"),
1427  TSK_RULE(150, "TSK_RULE",
1428  bundle.getString("BlackboardAttribute.tskrule.text"),
1430  TSK_ACTIVITY_TYPE(151, "TSK_ACTIVITY_TYPE",
1431  bundle.getString("BlackboardAttribute.tskActivityType.text"),
1433  /*
1434  * Use org.sleuthkit.datamodel.blackboardutils.attributes.GeoAreaPoints
1435  * to create and process TSK_GEO_AREAPOINTS attributes.
1436  */
1437  TSK_GEO_AREAPOINTS(152, "TSK_GEO_AREAPOINTS",
1438  bundle.getString("BlackboardAttribute.tskgeoareapoints.text"),
1440  TSK_REALM(153, "TSK_REALM",
1441  bundle.getString("BlackboardAttribute.tskRealm.text"),
1443  TSK_HOST(154, "TSK_HOST",
1444  bundle.getString("BlackboardAttribute.tskHost.text"),
1446  ;
1447 
1448  private final int typeID;
1449  private final String typeName;
1450  private final String displayName;
1451  private final TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType;
1452 
1461  private ATTRIBUTE_TYPE(int typeID, String typeName, String displayName, TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType) {
1462  this.typeID = typeID;
1463  this.typeName = typeName;
1464  this.displayName = displayName;
1465  this.valueType = valueType;
1466  }
1467 
1473  public int getTypeID() {
1474  return this.typeID;
1475  }
1476 
1485  public String getLabel() {
1486  return this.typeName;
1487  }
1488 
1494  public String getDisplayName() {
1495  return this.displayName;
1496  }
1497 
1504  return this.valueType;
1505  }
1506 
1520  static public ATTRIBUTE_TYPE fromID(int typeID) {
1521  for (ATTRIBUTE_TYPE attrType : ATTRIBUTE_TYPE.values()) {
1522  if (attrType.getTypeID() == typeID) {
1523  return attrType;
1524  }
1525  }
1526  throw new IllegalArgumentException("No ATTRIBUTE_TYPE matching type: " + typeID);
1527  }
1528 
1542  static public ATTRIBUTE_TYPE fromLabel(String typeName) {
1543  for (ATTRIBUTE_TYPE attrType : ATTRIBUTE_TYPE.values()) {
1544  if (attrType.getLabel().equals(typeName)) {
1545  return attrType;
1546  }
1547  }
1548  throw new IllegalArgumentException("No ATTRIBUTE_TYPE matching type: " + typeName);
1549  }
1550 
1551  }
1552 
1569  @Deprecated
1570  public BlackboardAttribute(int attributeTypeID, String moduleName, int valueInt) throws IllegalArgumentException {
1571  this(ATTRIBUTE_TYPE.fromID(attributeTypeID), moduleName, valueInt);
1572  }
1573 
1591  @Deprecated
1592  public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
1593  int valueInt) {
1594  this(attributeTypeID, moduleName, valueInt);
1595  this.context = replaceNulls(context);
1596  }
1597 
1616  @Deprecated
1617  public BlackboardAttribute(int attributeTypeID, String moduleName,
1618  long valueLong) throws IllegalArgumentException {
1619  this(ATTRIBUTE_TYPE.fromID(attributeTypeID), moduleName, valueLong);
1620  }
1621 
1641  @Deprecated
1642  public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
1643  long valueLong) {
1644  this(attributeTypeID, moduleName, valueLong);
1645  this.context = replaceNulls(context);
1646  }
1647 
1664  @Deprecated
1665  public BlackboardAttribute(int attributeTypeID, String moduleName,
1666  double valueDouble) throws IllegalArgumentException {
1667  this(ATTRIBUTE_TYPE.fromID(attributeTypeID), moduleName, valueDouble);
1668  }
1669 
1687  @Deprecated
1688  public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
1689  double valueDouble) {
1690  this(attributeTypeID, moduleName, valueDouble);
1691  this.context = replaceNulls(context);
1692  }
1693 
1710  @Deprecated
1711  public BlackboardAttribute(int attributeTypeID, String moduleName, String valueString) throws IllegalArgumentException {
1712  this(ATTRIBUTE_TYPE.fromID(attributeTypeID), moduleName, valueString);
1713  }
1714 
1732  @Deprecated
1733  public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
1734  String valueString) {
1735  this(attributeTypeID, moduleName, valueString);
1736  this.context = replaceNulls(context);
1737  }
1738 
1755  @Deprecated
1756  public BlackboardAttribute(int attributeTypeID, String moduleName, byte[] valueBytes) throws IllegalArgumentException {
1757  this(ATTRIBUTE_TYPE.fromID(attributeTypeID), moduleName, valueBytes);
1758  }
1759 
1777  @Deprecated
1778  public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
1779  byte[] valueBytes) {
1780  this(attributeTypeID, moduleName, valueBytes);
1781  this.context = replaceNulls(context);
1782  }
1783 
1794  @Deprecated
1795  protected void setArtifactID(long artifactID) {
1796  setArtifactId(artifactID);
1797  }
1798 
1810  @Deprecated
1811  protected void setCase(SleuthkitCase sleuthkitCase) {
1812  setCaseDatabase(sleuthkitCase);
1813  }
1814 
1822  @Deprecated
1823  public String getContext() {
1824  return context;
1825  }
1826 
1834  @Deprecated
1835  String getContextString() {
1836  return context;
1837  }
1838 
1846  @Deprecated
1847  public int getAttributeTypeID() {
1848  return attributeType.getTypeID();
1849  }
1850 
1860  @Deprecated
1861  public String getAttributeTypeName() throws TskCoreException {
1862  return attributeType.getTypeName();
1863  }
1864 
1875  @Deprecated
1877  return attributeType.getDisplayName();
1878  }
1879 
1888  @Deprecated
1889  public String getModuleName() {
1890  return sources;
1891  }
1892 
1893 }
BlackboardAttribute(int attributeTypeID, String moduleName, String context, byte[] valueBytes)
Type(int typeID, String typeName, String displayName, TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType)
static String epochToTime(long epoch)
TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType()
BlackboardAttribute(Type attributeType, String source, long valueLong)
BlackboardAttribute(Type attributeType, String source, int valueInt)
BlackboardAttribute(int attributeTypeID, String moduleName, String context, int valueInt)
BlackboardArtifact getBlackboardArtifact(long artifactID)
static TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE fromLabel(String typeName)
TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType()
BlackboardAttribute(int attributeTypeID, String moduleName, int valueInt)
BlackboardAttribute(int attributeTypeID, String moduleName, String valueString)
BlackboardAttribute(int attributeTypeID, String moduleName, double valueDouble)
BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, String valueString)
BlackboardAttribute(Type attributeType, String source, byte[] valueBytes)
BlackboardAttribute(int attributeTypeID, String moduleName, String context, double valueDouble)
BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, long valueLong)
BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, int valueInt)
BlackboardAttribute(Type attributeType, String source, double valueDouble)
BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, double valueDouble)
BlackboardAttribute(int attributeTypeID, String moduleName, String context, long valueLong)
BlackboardAttribute(int attributeTypeID, String moduleName, String context, String valueString)
BlackboardAttribute(int attributeTypeID, String moduleName, long valueLong)
Type(BlackboardAttribute.ATTRIBUTE_TYPE type)
BlackboardAttribute(int attributeTypeID, String moduleName, byte[] valueBytes)
BlackboardAttribute(ATTRIBUTE_TYPE attributeType, String source, byte[] valueBytes)
BlackboardAttribute(Type attributeType, String source, String valueString)

Copyright © 2011-2020 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.