19 package org.sleuthkit.autopsy.timeline.datamodel.eventtype;
21 import java.text.MessageFormat;
22 import java.util.Optional;
23 import java.util.function.Function;
24 import java.util.logging.Level;
25 import org.apache.commons.lang3.StringUtils;
78 long time = dateTimeAttr.getValueLong();
80 String medDescription = shortDescription +
" : " +
getMedExtractor().apply(artf);
81 String fullDescription = medDescription +
" : " +
getFullExtractor().apply(artf);
135 String medDescription,
136 String fullDescription) {
162 if (type.getArtifactTypeID() != artf.getArtifactTypeID()) {
163 throw new IllegalArgumentException();
165 if (artf.getAttribute(type.getDateTimeAttributeType()) == null) {
166 LOGGER.log(Level.WARNING,
"Artifact {0} has no date/time attribute, skipping it.", artf.getArtifactID());
170 return type.parseAttributesHelper(artf);
175 public String
apply(BlackboardArtifact artf) {
177 .map(BlackboardAttribute::getDisplayString)
178 .map(StringUtils::defaultString)
193 public String
apply(BlackboardArtifact t) {
198 static BlackboardAttribute
getAttributeSafe(BlackboardArtifact artf, BlackboardAttribute.Type attrType) {
200 return artf.getAttribute(attrType);
201 }
catch (TskCoreException ex) {
202 LOGGER.log(Level.SEVERE, MessageFormat.format(
"Error getting attribute from artifact {0}.", artf.getArtifactID()), ex);
Function< BlackboardArtifact, String > getShortExtractor()
final String shortDescription
Function< BlackboardArtifact, String > getMedExtractor()
final String fullDescription
default AttributeEventDescription parseAttributesHelper(BlackboardArtifact artf)
String getFullDescription()
Function< BlackboardArtifact, String > getFullExtractor()
final String medDescription
default int getArtifactTypeID()
AttributeEventDescription(long time, String shortDescription, String medDescription, String fullDescription)
synchronized static Logger getLogger(String name)
BlackboardArtifact.Type getArtifactType()
String getMedDescription()
static BlackboardAttribute getAttributeSafe(BlackboardArtifact artf, BlackboardAttribute.Type attrType)
static final Logger LOGGER
static AttributeEventDescription buildEventDescription(ArtifactEventType type, BlackboardArtifact artf)
BlackboardAttribute.Type getDateTimeAttributeType()
String getShortDescription()