当前位置: 首页>>代码示例>>Java>>正文


Java EventType类代码示例

本文整理汇总了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;
}
 
开发者ID:trustathsh,项目名称:ironvas,代码行数:22,代码来源:EventUpdateConverter.java

示例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!");
	}
}
 
开发者ID:trustathsh,项目名称:irongpm,代码行数:37,代码来源:PublishEventAction.java

示例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");
}
 
开发者ID:trustathsh,项目名称:visitmeta,代码行数:14,代码来源:InMemoryMetadataFactoryTest.java

示例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;
}
 
开发者ID:trustathsh,项目名称:visitmeta,代码行数:9,代码来源:MetadataMock.java

示例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);
}
 
开发者ID:trustathsh,项目名称:visitmeta,代码行数:7,代码来源:IfmapjMock.java


注:本文中的de.hshannover.f4.trust.ifmapj.metadata.EventType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。