19 package org.sleuthkit.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.HashSet;
24 import java.util.List;
26 import java.util.logging.Level;
27 import java.util.logging.Logger;
40 private final long objId;
41 private final String name;
43 private String uniquePath;
46 private volatile boolean checkedHasChildren;
47 private volatile int childrenCount;
56 checkedHasChildren =
false;
73 if (uniquePath == null) {
75 if (!name.isEmpty()) {
80 if (myParent != null) {
89 if (checkedHasChildren ==
true) {
95 hasChildren = childrenCount > 0;
96 checkedHasChildren =
true;
103 if (childrenCount != -1) {
104 return childrenCount;
109 hasChildren = childrenCount > 0;
110 checkedHasChildren =
true;
112 return childrenCount;
117 if (parent == null) {
118 ObjectInfo parentInfo;
120 parentInfo = db.getParentInfo(
this);
121 }
catch (TskCoreException ex) {
130 void setParent(
Content parent) {
131 this.parent = parent;
141 void setParentId(
long parentId) {
160 List<Content> children =
new ArrayList<Content>();
181 List<Long> childrenIDs =
new ArrayList<Long>();
184 childrenIDs.addAll(
getSleuthkitCase().getBlackboardArtifactChildrenIds(
this));
193 if (myParent == null) {
214 if (getClass() != obj.getClass()) {
218 if (this.objId != other.objId) {
237 int hash = 7 + (int) (this.objId ^ (this.objId >>> 32));
268 if (genInfoArtifact == null)
273 ArrayList<BlackboardArtifact> list =
new ArrayList<BlackboardArtifact>();
275 if (genInfoArtifact != null) {
276 list.add(genInfoArtifact);
295 if (genInfoArtifact != null) {
296 return genInfoArtifact;
302 if (arts.isEmpty()) {
309 retArt = arts.get(0);
311 genInfoArtifact = retArt;
317 ArrayList<BlackboardAttribute> returnList =
new ArrayList<BlackboardAttribute>();
319 if (genInfoArtifact == null) {
321 if (genInfoArtifact == null) {
327 if (attribute.getAttributeType().getTypeID() == attr_type.getTypeID()) {
328 returnList.add(attribute);
362 Set<String> hashNames =
new HashSet<String>();
367 if (attribute != null) {
371 return Collections.unmodifiableSet(hashNames);
381 return "AbstractContent [\t" +
"objId " + String.format(
"%010d", objId) +
"\t"
382 +
"name " + name +
"\t" +
"parentId " + parentId +
"\t"
383 +
"\t" +
"checkedHasChildren " + checkedHasChildren
384 +
"\t" +
"hasChildren " + hasChildren
385 +
"\t" +
"childrenCount " + childrenCount
386 +
"uniquePath " + uniquePath +
"]\t";
390 return "AbstractContent [\t" +
"objId " + String.format(
"%010d", objId)
391 +
"\t" +
"name " + name
392 +
"\t" +
"checkedHasChildren " + checkedHasChildren
393 +
"\t" +
"hasChildren " + hasChildren
394 +
"\t" +
"childrenCount " + childrenCount
398 return "AbstractContent [\t" +
"objId "
399 + String.format(
"%010d", objId) +
"\t" +
"name " + name
400 +
"\t" +
"checkedHasChildren " + checkedHasChildren
401 +
"\t" +
"hasChildren " + hasChildren
402 +
"\t" +
"childrenCount " + childrenCount
404 +
"\t" +
"parentId " + parentId +
"]\t";
408 return "AbstractContent [\t" +
"objId " + String.format(
"%010d", objId) +
"\t"
409 +
"name " + name +
"\t" +
"parentId " + parentId +
"\t"
410 +
"\t" +
"checkedHasChildren " + checkedHasChildren
411 +
"\t" +
"hasChildren " + hasChildren
412 +
"\t" +
"childrenCount " + childrenCount
413 +
"uniquePath " + uniquePath +
"]\t";
long getBlackboardArtifactsCount(long objId)
synchronized Content getParent()
List< Content > getChildren()
ArrayList< BlackboardArtifact > getBlackboardArtifacts(int artifactTypeID)
ArrayList< BlackboardArtifact > getArtifacts(int artifactTypeID)
Content getContentById(long id)
ArrayList< BlackboardArtifact > getAllArtifacts()
synchronized String getUniquePath()
String toString(boolean preserveState)
ArrayList< BlackboardArtifact > getMatchingArtifacts(String whereClause)
BlackboardArtifact newArtifact(BlackboardArtifact.ARTIFACT_TYPE type)
ArrayList< BlackboardArtifact > getArtifacts(BlackboardArtifact.ARTIFACT_TYPE type)
BlackboardArtifact newBlackboardArtifact(int artifactTypeID, long obj_id)
BlackboardArtifact getGenInfoArtifact()
AbstractContent(SleuthkitCase db, long obj_id, String name)
SleuthkitCase getSleuthkitCase()
boolean equals(Object obj)
BlackboardArtifact.Type getArtifactType(String artTypeName)
long getArtifactsCount(ARTIFACT_TYPE type)
long getAllArtifactsCount()
List< BlackboardAttribute > getAttributes()
BlackboardArtifact newArtifact(int artifactTypeID)
Set< String > getHashSetNames()
long getArtifactsCount(int artifactTypeID)
ArrayList< BlackboardArtifact > getArtifacts(String artifactTypeName)
static final long UNKNOWN_ID
BlackboardArtifact getGenInfoArtifact(boolean create)
ArrayList< BlackboardAttribute > getGenInfoAttributes(ATTRIBUTE_TYPE attr_type)
long getArtifactsCount(String artifactTypeName)
List< Long > getChildrenIds()