- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getNamespace()
方法的一些代码示例,展示了XmlElement.getNamespace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlElement.getNamespace()
方法的具体详情如下:
包路径:org.opendaylight.controller.netconf.util.xml.XmlElement
类名称:XmlElement
方法名:getNamespace
暂无
代码示例来源:origin: org.opendaylight.controller/netconf-util
public void checkNamespace(String expectedNamespace) throws UnexpectedNamespaceException, MissingNameSpaceException {
if (!getNamespace().equals(expectedNamespace))
{
throw new UnexpectedNamespaceException(String.format("Unexpected namespace %s should be %s",
getNamespace(),
expectedNamespace),
NetconfDocumentedException.ErrorType.application,
NetconfDocumentedException.ErrorTag.operation_failed,
NetconfDocumentedException.ErrorSeverity.error);
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
@Override
public boolean accept(Element e) {
try {
return XmlElement.fromDomElement(e).getNamespace().equals(namespace);
} catch (MissingNameSpaceException e1) {
return false;
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public List<XmlElement> getChildElementsWithSameNamespace(final String childName) throws MissingNameSpaceException {
List<XmlElement> children = getChildElementsWithinNamespace(getNamespace());
return Lists.newArrayList(Collections2.filter(children, new Predicate<XmlElement>() {
@Override
public boolean apply(XmlElement xmlElement) {
return xmlElement.getName().equals(childName);
}
}));
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("XmlElement{");
sb.append("name='").append(getName()).append('\'');
if (element.getNamespaceURI() != null) {
try {
sb.append(", namespace='").append(getNamespace()).append('\'');
} catch (MissingNameSpaceException e) {
LOG.trace("Missing namespace for element.");
}
}
sb.append('}');
return sb.toString();
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public XmlElement getOnlyChildElementWithSameNamespace(String childName) throws NetconfDocumentedException {
return getOnlyChildElement(childName, getNamespace());
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
private static boolean isHelloMessage(final Document document) {
XmlElement element = XmlElement.fromDomElement(document.getDocumentElement());
try {
// accept even if hello has no namespace
return element.getName().equals(HELLO_TAG) &&
(!element.hasNamespace() || element.getNamespace().equals(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0));
} catch (MissingNameSpaceException e) {
// Cannot happen, since we check for hasNamespace
throw new IllegalStateException(e);
}
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public XmlElement getOnlyChildElementWithSameNamespace() throws NetconfDocumentedException {
XmlElement childElement = getOnlyChildElement();
childElement.checkNamespace(getNamespace());
return childElement;
}
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
@Override
protected String readElementContent(XmlElement xmlElement) throws NetconfDocumentedException {
Map.Entry<String, String> namespaceOfTextContent = xmlElement.findNamespaceOfTextContent();
String content = xmlElement.getTextContent();
final String namespace;
final String localName;
if(namespaceOfTextContent.getKey().isEmpty()) {
localName = content;
namespace = xmlElement.getNamespace();
} else {
String prefix = namespaceOfTextContent.getKey() + ":";
Preconditions.checkArgument(content.startsWith(prefix), "Identity ref should be prefixed with \"%s\"", prefix);
localName = content.substring(prefix.length());
namespace = namespaceOfTextContent.getValue();
}
Date revision = null;
Map<Date, EditConfig.IdentityMapping> revisions = identityMap.get(namespace);
if(revisions.keySet().size() > 1) {
for (Map.Entry<Date, EditConfig.IdentityMapping> revisionToIdentityEntry : revisions.entrySet()) {
if(revisionToIdentityEntry.getValue().containsIdName(localName)) {
Preconditions.checkState(revision == null, "Duplicate identity %s, in namespace %s, with revisions: %s, %s detected. Cannot map attribute",
localName, namespace, revision, revisionToIdentityEntry.getKey());
revision = revisionToIdentityEntry.getKey();
}
}
} else {
revision = revisions.keySet().iterator().next();
}
return QName.create(URI.create(namespace), revision, localName).toString();
}
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
private DataSchemaNode getSchemaNodeFromNamespace(final XmlElement element) throws NetconfDocumentedException {
try {
final Module module = schemaContext.getCurrentContext().findModuleByNamespaceAndRevision(new URI(element.getNamespace()), null);
DataSchemaNode dataSchemaNode = module.getDataChildByName(element.getName());
if (dataSchemaNode != null) {
return dataSchemaNode;
}
} catch (URISyntaxException e) {
LOG.debug("Error during parsing of element namespace, this should not happen since namespace of an xml " +
"element is valid and if the xml was parsed then the URI should be as well");
throw new IllegalArgumentException("Unable to parse element namespace, this should not happen since " +
"namespace of an xml element is valid and if the xml was parsed then the URI should be as well");
}
throw new NetconfDocumentedException("Unable to find node with namespace: " + element.getNamespace() + "in schema context: " + schemaContext.getCurrentContext().toString(),
ErrorType.application,
ErrorTag.unknown_namespace,
ErrorSeverity.error);
}
代码示例来源:origin: org.opendaylight.controller/sal-netconf-connector
@Override
public synchronized DOMNotification toNotification(final NetconfMessage message) {
final Map.Entry<Date, XmlElement> stripped = stripNotification(message);
final QName notificationNoRev;
try {
notificationNoRev = QName.create(stripped.getValue().getNamespace(), stripped.getValue().getName()).withoutRevision();
} catch (final MissingNameSpaceException e) {
throw new IllegalArgumentException("Unable to parse notification " + message + ", cannot find namespace", e);
}
final Collection<NotificationDefinition> notificationDefinitions = mappedNotifications.get(notificationNoRev);
Preconditions.checkArgument(notificationDefinitions.size() > 0,
"Unable to parse notification %s, unknown notification. Available notifications: %s", notificationDefinitions, mappedNotifications.keySet());
// FIXME if multiple revisions for same notifications are present, we should pick the most recent. Or ?
// We should probably just put the most recent notification versions into our map. We can expect that the device sends the data according to the latest available revision of a model.
final NotificationDefinition next = notificationDefinitions.iterator().next();
// We wrap the notification as a container node in order to reuse the parsers and builders for container node
final ContainerSchemaNode notificationAsContainerSchemaNode = NetconfMessageTransformUtil.createSchemaForNotification(next);
final ContainerNode content = parserFactory.getContainerNodeParser().parse(Collections.singleton(stripped.getValue().getDomElement()),
notificationAsContainerSchemaNode);
return new NetconfDeviceNotification(content, stripped.getKey());
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public OperationNameAndNamespace(final Document message) throws NetconfDocumentedException {
XmlElement requestElement = null;
requestElement = getRequestElementWithCheck(message);
operationElement = requestElement.getOnlyChildElement();
operationName = operationElement.getName();
namespace = operationElement.getNamespace();
}
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
final String netconfOperationNamespace;
try {
netconfOperationNamespace = operationElement.getNamespace();
} catch (MissingNameSpaceException e) {
LOG.debug("Cannot retrieve netconf operation namespace from message due to ", e);
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws NetconfDocumentedException {
final Datastore targetDatastore = extractTargetParameter(operationElement);
if (targetDatastore == Datastore.running) {
throw new NetconfDocumentedException("edit-config on running datastore is not supported",
ErrorType.protocol,
ErrorTag.operation_not_supported,
ErrorSeverity.error);
}
final ModifyAction defaultAction = getDefaultOperation(operationElement);
final XmlElement configElement = getElement(operationElement, CONFIG_KEY);
for (XmlElement element : configElement.getChildElements()) {
final String ns = element.getNamespace();
final DataSchemaNode schemaNode = getSchemaNodeFromNamespace(ns, element).get();
final DataTreeChangeTracker changeTracker = new DataTreeChangeTracker(defaultAction);
final DomToNormalizedNodeParserFactory.BuildingStrategyProvider editOperationStrategyProvider = new EditOperationStrategyProvider(changeTracker);
parseIntoNormalizedNode(schemaNode, element, editOperationStrategyProvider);
executeOperations(changeTracker);
}
return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
}
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
final String netconfOperationNamespace;
try {
netconfOperationNamespace = operationElement.getNamespace();
} catch (MissingNameSpaceException e) {
LOG.debug("Cannot retrieve netconf operation namespace from message due to ", e);
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
public NetconfOperationExecution fromXml(final XmlElement xml) throws NetconfDocumentedException {
final String namespace;
try {
namespace = xml.getNamespace();
} catch (MissingNameSpaceException e) {
LOG.trace("Can't get namespace from xml element due to ",e);
throw NetconfDocumentedException.wrap(e);
}
final XmlElement contextInstanceElement = xml.getOnlyChildElement(CONTEXT_INSTANCE);
final String operationName = xml.getName();
final RuntimeRpcElementResolved id = RuntimeRpcElementResolved.fromXpath(
contextInstanceElement.getTextContent(), operationName, namespace);
final Rpcs rpcs = mapRpcs(yangStoreSnapshot.getModuleMXBeanEntryMap(), yangStoreSnapshot.getEnumResolver());
final ModuleRpcs rpcMapping = rpcs.getRpcMapping(id);
final InstanceRuntimeRpc instanceRuntimeRpc = rpcMapping.getRpc(id.getRuntimeBeanName(), operationName);
// TODO move to Rpcs after xpath attribute is redesigned
final ObjectName on = id.getObjectName(rpcMapping);
Map<String, AttributeConfigElement> attributes = instanceRuntimeRpc.fromXml(xml);
attributes = sortAttributes(attributes, xml);
return new NetconfOperationExecution(on, instanceRuntimeRpc.getName(), attributes,
instanceRuntimeRpc.getReturnType(), namespace);
}
我的 R session : R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_
我的 R session : R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章PHP getNamespaces()函数讲解由作者收集整理,如果你对这
本文整理了Java中io.swagger.models.Xml.getNamespace()方法的一些代码示例,展示了Xml.getNamespace()的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.milyn.xml.XsdDOMValidator.getNamespaces()方法的一些代码示例,展示了XsdDOMValidator.getNamespaces()的
本文整理了Java中com.reprezen.rapidml.ZenModel.getNamespace()方法的一些代码示例,展示了ZenModel.getNamespace()的具体用法。这些代码
本文整理了Java中org.onehippo.yui.YuiDependency.getNamespace()方法的一些代码示例,展示了YuiDependency.getNamespace()的具体用
本文整理了Java中org.n52.svalbard.util.XmlHelper.getNamespace()方法的一些代码示例,展示了XmlHelper.getNamespace()的具体用法。这
本文整理了Java中org.xmlpull.v1.builder.XmlElement.getNamespace()方法的一些代码示例,展示了XmlElement.getNamespace()的具体用
本文整理了Java中com.google.gdata.util.XmlBlob.getNamespaces()方法的一些代码示例,展示了XmlBlob.getNamespaces()的具体用法。这些代
本文整理了Java中org.eclipse.xsd.impl.XSDImportImpl.getNamespace()方法的一些代码示例,展示了XSDImportImpl.getNamespace()
本文整理了Java中org.n52.svalbard.decode.XmlNamespaceDecoderKey.getNamespace()方法的一些代码示例,展示了XmlNamespaceDeco
本文整理了Java中org.apache.hadoop.fs.XAttr.getNameSpace()方法的一些代码示例,展示了XAttr.getNameSpace()的具体用法。这些代码示例主要来源
本文整理了Java中us.ihmc.yoVariables.registry.YoVariableRegistry.getNameSpace()方法的一些代码示例,展示了YoVariableRegis
本文整理了Java中com.datasift.dropwizard.zookeeper.ZooKeeperFactory.getNamespace()方法的一些代码示例,展示了ZooKeeperFac
我想阅读 里面的任何内容以下 xml 中的标记 - $xml = '
本文整理了Java中org.apache.tuscany.sca.xsd.XSDefinition.getNamespace()方法的一些代码示例,展示了XSDefinition.getNamespa
本文整理了Java中org.sweble.wikitext.engine.config.WikiConfig.getNamespace()方法的一些代码示例,展示了WikiConfig.getName
本文整理了Java中org.opendaylight.yangtools.yang.binding.YangModuleInfo.getNamespace()方法的一些代码示例,展示了YangModu
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getNamespace()方法的一些代码示例,展示了XmlElem
我是一名优秀的程序员,十分优秀!