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


Java Identifiers.createExtendedIdentity方法代码示例

本文整理汇总了Java中de.hshannover.f4.trust.ifmapj.identifier.Identifiers.createExtendedIdentity方法的典型用法代码示例。如果您正苦于以下问题:Java Identifiers.createExtendedIdentity方法的具体用法?Java Identifiers.createExtendedIdentity怎么用?Java Identifiers.createExtendedIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.hshannover.f4.trust.ifmapj.identifier.Identifiers的用法示例。


在下文中一共展示了Identifiers.createExtendedIdentity方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRuleStartIdentifier

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createRuleStartIdentifier(RuleWrapper rule) throws MarshalException {
	LOGGER.trace("Method createRuleStartIdentifier(RuleWrapper rule) called");

	String name = rule.getName();
	long id = rule.getId();
	String description = rule.getDescription();
	String recommendation = rule.getRecommendation();

	String ruleIdentifierDocument = "<"
			+ IDENTIFIER_NAMESPACE_PREFIX + ":" + RULE_IDENTIFIER + " "
			+ "administrative-domain=\"" + POLICY_ADMINSTRATIVE_DOMAIN + "\" "
			+ "xmlns:" + IDENTIFIER_NAMESPACE_PREFIX + "=\"" + POLICY_IDENTIFIER_NS_URI + "\" >"
			+ "<name>" + name + "</name>"
			+ "<id>" + id + "</id>"
			+ "<description>" + description + "</description>"
			+ "<recommendation>" + recommendation + "</recommendation>"
			+ "</" + IDENTIFIER_NAMESPACE_PREFIX + ":" + RULE_IDENTIFIER + ">";

	return Identifiers.createExtendedIdentity(ruleIdentifierDocument);
}
 
开发者ID:trustathsh,项目名称:irongpm,代码行数:21,代码来源:PolicyPublisher.java

示例2: createImplementation

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createImplementation(String implementationName, String implementationVersion,
		String implementationPatch, String implementationPlatform, String administrativeDomain)
				throws MarshalException {
	StringBuilder implementationDocument = new StringBuilder();
	implementationDocument.append("<"
			+ SIMU_IDENTIFIER_PREFIX + ":implementation ");
	implementationDocument.append("administrative-domain=\""
			+ administrativeDomain + "\" ");
	implementationDocument.append("xmlns:"
			+ SIMU_IDENTIFIER_PREFIX + "=\"" + SIMU_IDENTIFIER_URI + "\" ");
	implementationDocument.append("name=\""
			+ implementationName + "\" ");
	implementationDocument.append("version=\""
			+ implementationVersion + "\" ");
	implementationDocument.append("local-version=\""
			+ implementationPatch + "\" ");
	implementationDocument.append("platform=\""
			+ implementationPlatform + "\" ");
	implementationDocument.append(">");
	implementationDocument.append("</"
			+ SIMU_IDENTIFIER_PREFIX + ":implementation>");

	return Identifiers.createExtendedIdentity(implementationDocument.toString());
}
 
开发者ID:trustathsh,项目名称:ironvas,代码行数:25,代码来源:SelfPublisher.java

示例3: createService

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createService(String serviceName, String serviceType, String servicePort,
		String administrativeDomain) throws MarshalException {
	StringBuilder serviceDocument = new StringBuilder();
	serviceDocument.append("<"
			+ SIMU_IDENTIFIER_PREFIX + ":service ");
	serviceDocument.append("administrative-domain=\""
			+ administrativeDomain + "\" ");
	serviceDocument.append("xmlns:"
			+ SIMU_IDENTIFIER_PREFIX + "=\"" + SIMU_IDENTIFIER_URI + "\" ");
	serviceDocument.append("type=\""
			+ serviceType + "\" ");
	serviceDocument.append("name=\""
			+ serviceName + "\" ");
	serviceDocument.append("port=\""
			+ servicePort + "\" ");
	serviceDocument.append(">");
	serviceDocument.append("</"
			+ SIMU_IDENTIFIER_PREFIX + ":service>");

	return Identifiers.createExtendedIdentity(serviceDocument.toString());
}
 
开发者ID:trustathsh,项目名称:ironvas,代码行数:22,代码来源:SelfPublisher.java

示例4: createUpdateRequest

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private PublishRequest createUpdateRequest(Document signatureDocument, Document conditionDocument) {
	PublishRequest request = Requests.createPublishReq();
	
	de.hshannover.f4.trust.ifmapj.identifier.Identifier signatureIdentifier;
	de.hshannover.f4.trust.ifmapj.identifier.Identifier conditionIdentifier;
	try {
		signatureIdentifier = Identifiers.createExtendedIdentity(signatureDocument);
		conditionIdentifier = Identifiers.createExtendedIdentity(conditionDocument);

		PublishUpdate publishUpdate = Requests.createPublishUpdate();
		publishUpdate.setIdentifier1(signatureIdentifier);
		publishUpdate.setIdentifier2(conditionIdentifier);
		publishUpdate.addMetadata(createMetadata());
		publishUpdate.setLifeTime(MetadataLifetime.forever);
		
		request.addPublishElement(publishUpdate);
	} catch (MarshalException e) {
		DialogHelper.showErrorDialog(e.getMessage(), "Marshal Exception");
		logger.error(e.getMessage());
	}
	
	return request;
}
 
开发者ID:trustathsh,项目名称:visitmeta,代码行数:24,代码来源:EditPolicyNodeContextMenuItem.java

示例5: createDeleteRequest

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private PublishRequest createDeleteRequest(Document signatureDocument, Document conditionDocument) {
	PublishRequest request = Requests.createPublishReq();
	
	de.hshannover.f4.trust.ifmapj.identifier.Identifier signatureIdentifier;
	de.hshannover.f4.trust.ifmapj.identifier.Identifier conditionIdentifier;
	try {
		signatureIdentifier = Identifiers.createExtendedIdentity(signatureDocument);
		conditionIdentifier = Identifiers.createExtendedIdentity(conditionDocument);
		
		PublishDelete publishDelete = Requests.createPublishDelete();
		publishDelete.setIdentifier1(signatureIdentifier);
		publishDelete.setIdentifier2(conditionIdentifier);
		
		request.addPublishElement(publishDelete);
	} catch (MarshalException e) {
		DialogHelper.showErrorDialog(e.getMessage(), "Marshal Exception");
		logger.error(e.getMessage());
	}
	
	return request;
}
 
开发者ID:trustathsh,项目名称:visitmeta,代码行数:22,代码来源:EditPolicyNodeContextMenuItem.java

示例6: createExtendedIdentifier

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
/**
 * Creates an Extended Identifier.
 *
 * @param namespaceUri
 *            URI of the namespace of the inner XML of the Extended Identifier
 * @param namespacePrefix
 *            prefix of the namespace of the inner XML of the Extended Identifier
 * @param identifierName
 *            the name value of the Extended Identifier (will be the root node of the inner XML)
 * @param attributeValue
 *            a value for the attribute <i>name</i>
 * @param administrativeDomain
 *            the value of the administrativeDomain attribute
 * @return an {@link Identity} instance encapsulating the Extended Identifier
 */
public static Identity createExtendedIdentifier(String namespaceUri, String namespacePrefix, String identifierName,
		String attributeValue,
		String administrativeDomain) {
	Document doc = mDocumentBuilder.newDocument();
	Element e = doc.createElementNS(namespaceUri,
			namespacePrefix
					+ ":" + identifierName);
	if (attributeValue != null) {
		e.setAttribute("name", attributeValue);
	}
	e.setAttribute("administrative-domain", administrativeDomain);
	doc.appendChild(e);
	try {
		return Identifiers.createExtendedIdentity(doc);
	} catch (MarshalException e1) {
		IfmapJLog.error("document that contains the extended identifier can't be handled");
		throw new RuntimeException(e1);
	}
}
 
开发者ID:trustathsh,项目名称:ifmapj,代码行数:35,代码来源:ExtendedIdentifiers.java

示例7: createPolicyIdentifier

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createPolicyIdentifier(String ruleLoaderName) throws MarshalException {
	LOGGER.trace("Method createPolicyIdentifier(String ruleLoaderName) called");

	String policyIdentifierDocument = "<"
			+ IDENTIFIER_NAMESPACE_PREFIX + ":" + POLICY_IDENTIFIER + " "
			+ "administrative-domain=\"" + POLICY_ADMINSTRATIVE_DOMAIN + "\" "
			+ "xmlns:" + IDENTIFIER_NAMESPACE_PREFIX + "=\"" + POLICY_IDENTIFIER_NS_URI + "\" >"
			+ "<name>" + ruleLoaderName + "</name>"
			+ "</" + IDENTIFIER_NAMESPACE_PREFIX + ":" + POLICY_IDENTIFIER + ">";

	return Identifiers.createExtendedIdentity(policyIdentifierDocument);
}
 
开发者ID:trustathsh,项目名称:irongpm,代码行数:13,代码来源:PolicyPublisher.java

示例8: createPatternVertexIdentifier

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createPatternVertexIdentifier(PatternVertex vertex, long ruleId) throws MarshalException {
	LOGGER.trace("Method createPatternVertexIdentifier(PatternVertex vertex, long ruleId) called");

	String vertexDocument = "<"
			+ IDENTIFIER_NAMESPACE_PREFIX + ":" + PATTERN_VERTEX_IDENTIFIER + " "
			+ "administrative-domain=\"" + POLICY_ADMINSTRATIVE_DOMAIN + ":" + ruleId + "\" "
			+ "xmlns:" + IDENTIFIER_NAMESPACE_PREFIX + "=\"" + POLICY_IDENTIFIER_NS_URI + "\" >"
			+ "<typename>" + vertex.getTypeName() + "</typename>"
			+ "<properties>" + createPropertyString(vertex) + "</properties>"
			+ "</" + IDENTIFIER_NAMESPACE_PREFIX + ":" + PATTERN_VERTEX_IDENTIFIER + ">";

	return Identifiers.createExtendedIdentity(vertexDocument);
}
 
开发者ID:trustathsh,项目名称:irongpm,代码行数:14,代码来源:PolicyPublisher.java

示例9: createMatchedIdentifier

import de.hshannover.f4.trust.ifmapj.identifier.Identifiers; //导入方法依赖的package包/类
private static Identifier createMatchedIdentifier(RuleMatch match) throws MarshalException {
	LOGGER.trace("Method createMatchedIdentifier(RuleMatch match) called");

	Identifier result = null;
	IfmapVertex matchedVertex = match.getPublishVertex();

	String typeName = matchedVertex.getTypeName();
	String rawData = matchedVertex.getRawData();

	LOGGER.trace("MatchedVertex ("
			+ typeName + "): " + rawData);

	// TODO will not support ALL possible identifier types ... e.g. IPv6
	switch (typeName) {
		case IfmapStrings.ACCESS_REQUEST_EL_NAME:
			result = Identifiers.createAr(matchedVertex.valueFor("/access-request[@name]"));
			break;
		case IfmapStrings.DEVICE_EL_NAME:
			result = Identifiers.createDev(matchedVertex.valueFor("/device/name"));
			break;
		case IfmapStrings.IP_ADDRESS_EL_NAME:
			result = Identifiers.createIp4(matchedVertex.valueFor("/ip-address[@value]"));
			break;
		case IfmapStrings.MAC_ADDRESS_EL_NAME:
			result = Identifiers.createMac(matchedVertex.valueFor("/mac-address[@value]"));
			break;
		case IfmapStrings.IDENTITY_EL_NAME:
			if (matchedVertex.isExtendedIdentifier()) {
				result = Identifiers.createExtendedIdentity(rawData);
			} else {
				String name = matchedVertex.valueFor("/identity[@name]");
				String type = matchedVertex.valueFor("/identity[@type]");
				result = Identifiers.createIdentity(IdentityType.valueOf(type), name);
			}
			break;
		default:
			break;
	}

	return result;
}
 
开发者ID:trustathsh,项目名称:irongpm,代码行数:42,代码来源:PolicyPublisher.java


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