use of org.mitre.cybox.objects.DomainNameTypeEnum in project metron by apache.
the class DomainHandler method extract.
@Override
public Iterable<LookupKV> extract(final DomainName type, Map<String, Object> config) throws IOException {
List<LookupKV> ret = new ArrayList<>();
String typeStr = getType();
if (config != null) {
Object o = config.get(TYPE_CONFIG);
if (o != null) {
typeStr = o.toString();
}
}
final DomainNameTypeEnum domainType = type.getType();
if (domainType == null || SUPPORTED_TYPES.contains(domainType)) {
StringObjectPropertyType value = type.getValue();
for (String token : StixExtractor.split(value)) {
final String indicatorType = typeStr + ":" + DomainNameTypeEnum.FQDN;
LookupKV results = new LookupKV(new EnrichmentKey(indicatorType, token), new EnrichmentValue(new HashMap<String, Object>() {
{
put("source-type", "STIX");
put("indicator-type", indicatorType);
put("source", type.toXMLString());
}
}));
ret.add(results);
}
}
return ret;
}
use of org.mitre.cybox.objects.DomainNameTypeEnum in project metron by apache.
the class DomainHandler method getPossibleTypes.
@Override
public List<String> getPossibleTypes() {
String typeStr = getType();
List<String> ret = new ArrayList<>();
for (DomainNameTypeEnum e : SUPPORTED_TYPES) {
ret.add(typeStr + ":" + e);
}
return ret;
}
Aggregations