本文整理汇总了Java中de.hshannover.f4.trust.ifmapj.metadata.EventType类的典型用法代码示例。如果您正苦于以下问题:Java EventType类的具体用法?Java EventType怎么用?Java EventType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventType类属于de.hshannover.f4.trust.ifmapj.metadata包,在下文中一共展示了EventType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: singleUpdate
import de.hshannover.f4.trust.ifmapj.metadata.EventType; //导入依赖的package包/类
public PublishElement singleUpdate(Vulnerability v) {
IpAddress ip = Identifiers.createIp4(v.getHost());
Document metadata = mMetadataFactory.createEvent(v.getNvt().getName(), // name
mDateFormat.format(v.getTimestamp()), // discovered-time
mContext.getOpenVasServerId(), // discoverer-id
(int) (v.getNvt().getCvssBase() * 10 + 0.5), // magnitude
// (0-100)
0, // confidence TODO define
mapSignificance(v.getNvt().getRiskFactor()), // significance
EventType.cve, // type
v.getId(), // other-type-definition
v.getDescription(), // information
v.getNvt().getCve() // vulnerability-uri
);
PublishUpdate update = Requests.createPublishUpdate();
update.setIdentifier1(ip);
update.addMetadata(metadata);
return update;
}
示例2: performAction
import de.hshannover.f4.trust.ifmapj.metadata.EventType; //导入依赖的package包/类
@Override
public void performAction(PatternRule rule, RuleMatch result) {
if (rule.getId() == result.getRuleId()) {
LOGGER.debug("Performing PublishEventAction for rule: " + rule.getId());
if (result.getPublishVertex() == null) {
LOGGER.warn("Publish not successful, PublishVertex is null for rule " + rule.getId());
return;
}
Identifier id = convertVertex(result.getPublishVertex());
if (id == null) {
LOGGER.warn("Publish not successful, converting the PublishVertex of rule " + rule.getId()
+ " to an ifmapj Identifier failed. Check above for other log entries.");
return;
}
Document updateEvent = mMf.createEvent(rule.getDescription(), result.getResultGraph().getLastUpdated()
.toString(), "GPM", 100, 100, Significance.critical, EventType.cve, "",
ResultUtil.buildRecommendation(rule.getRecommendation(), result), "");
PublishRequest update = Requests.createPublishReq();
update.addPublishElement(Requests.createPublishUpdate(id, updateEvent));
IfmapPublishUtil.publish(update);
boolean isPolicyPublisherEnabled = mConfig.getBoolean("irongpm.publisher.policy.enabled", false);
if (isPolicyPublisherEnabled) {
try {
PolicyPublisher.publishAction(rule, result);
} catch (IfmapErrorResult | IfmapException e) {
LOGGER.warn("Error at publishing pattern to matched identifier-link: " + e.getMessage());
}
}
} else {
LOGGER.warn("Failed performing action since rule (" + rule.getId() + ") and result (" + result.getRuleId()
+ ") id's did not match!");
}
}
示例3: createEventDocument
import de.hshannover.f4.trust.ifmapj.metadata.EventType; //导入依赖的package包/类
private Document createEventDocument() {
return mMetadataFactory.createEvent(
"event42",
"2010-04-21T16:11:09Z",
"discovererId",
1,
1,
Significance.critical,
EventType.cve,
"",
"42",
"CVE-2011-0997");
}
示例4: createEvent
import de.hshannover.f4.trust.ifmapj.metadata.EventType; //导入依赖的package包/类
public static Document createEvent(String name, String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, EventType type, String otherTypeDefinition,
String information, String vulnerabilityUri, Date timestamp) {
Document doc = IFMAP_METADATA_FACTORY.createEvent(name, discoveredTime, discovererId, magnitude, confidence,
significance, type, otherTypeDefinition, information, vulnerabilityUri);
setDocumentXmlAttributes(doc, timestamp);
return doc;
}
示例5: CreateEvent
import de.hshannover.f4.trust.ifmapj.metadata.EventType; //导入依赖的package包/类
public static Document CreateEvent(String name, String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, EventType type, String otherTypeDefinition,
String information, String vulnerabilityUri, Date timestamp) {
return MetadataMock.createEvent(name, discoveredTime, discovererId, magnitude, confidence, significance, type,
otherTypeDefinition, information, vulnerabilityUri, timestamp);
}