當前位置: 首頁>>代碼示例>>Java>>正文


Java Significance類代碼示例

本文整理匯總了Java中de.hshannover.f4.trust.ifmapj.metadata.Significance的典型用法代碼示例。如果您正苦於以下問題:Java Significance類的具體用法?Java Significance怎麽用?Java Significance使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Significance類屬於de.hshannover.f4.trust.ifmapj.metadata包,在下文中一共展示了Significance類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mapSignificance

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的package包/類
private Significance mapSignificance(RiskfactorLevel riskFactor) {
    switch (riskFactor) {
    case Critical:
        return Significance.critical;
    case High:
        return Significance.critical;
    case Medium:
        return Significance.important;
    case Low:
        return Significance.important;
    case None:
        return Significance.informational;
    default:
        return Significance.informational;
    }
}
 
開發者ID:trustathsh,項目名稱:ironvas,代碼行數:17,代碼來源:EventUpdateConverter.java

示例2: performAction

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的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: performAction

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的package包/類
@Override
public void performAction(PatternRule rule, RuleMatch result) {
	if (rule.getId() == result.getRuleId()) {
		LOGGER.debug("Performing UnexpectedBehaviorAction 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 updateUnexpectedBehavior = mMf.createUnexpectedBehavior(result.getResultGraph().getLastUpdated()
				.toString(), "GPM", 100, 100, Significance.critical, rule.getDescription());

		PublishRequest update = Requests.createPublishReq();
		update.addPublishElement(Requests.createPublishUpdate(id, updateUnexpectedBehavior));
		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,代碼行數:36,代碼來源:UnexpectedBehaviorAction.java

示例4: createEventDocument

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的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

示例5: createEvent

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的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

示例6: CreateEvent

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的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

示例7: CreateUnexpectedBehavior

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的package包/類
public static Document CreateUnexpectedBehavior(String discoveredTime, String discovererId, Integer magnitude,
		Integer confidence, Significance significance, String type, Date timestamp) {
	return MetadataMock.createUnexpectedBehavior(discoveredTime, discovererId, magnitude, confidence, significance,
			type, timestamp);
}
 
開發者ID:trustathsh,項目名稱:visitmeta,代碼行數:6,代碼來源:IfmapjMock.java

示例8: createUnexpectedBehavior

import de.hshannover.f4.trust.ifmapj.metadata.Significance; //導入依賴的package包/類
public static Document createUnexpectedBehavior(String discoveredTime, String discovererId, Integer magnitude,
		Integer confidence, Significance significance, String type, Date timestamp) {
	Document doc = IFMAP_METADATA_FACTORY.createUnexpectedBehavior(discoveredTime, discovererId, magnitude, confidence, significance, type);
	setDocumentXmlAttributes(doc, timestamp);
	return doc;
}
 
開發者ID:trustathsh,項目名稱:visitmeta,代碼行數:7,代碼來源:MetadataMock.java


注:本文中的de.hshannover.f4.trust.ifmapj.metadata.Significance類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。