- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getName()
方法的一些代码示例,展示了XmlElement.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlElement.getName()
方法的具体详情如下:
包路径:org.opendaylight.controller.netconf.util.xml.XmlElement
类名称:XmlElement
方法名:getName
暂无
代码示例来源:origin: org.opendaylight.controller/netconf-util
@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
@Override
public boolean apply(XmlElement xmlElement) {
return xmlElement.getName().equals(childName);
}
}));
代码示例来源: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/netconf-util
@Override
public boolean apply(XmlElement xmlElement) {
return xmlElement.getName().equals(childName);
}
}));
代码示例来源: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
@Override
public boolean apply(XmlElement xmlElement) {
return xmlElement.getName().equals(childName);
}
}));
代码示例来源:origin: org.opendaylight.controller/netconf-util
@Override
public boolean apply(XmlElement xmlElement) {
return xmlElement.getName().equals(childName);
}
}));
代码示例来源:origin: org.opendaylight.controller/netconf-util
public void checkName(String expectedName) throws UnexpectedElementException {
if (!getName().equals(expectedName)){
throw new UnexpectedElementException(String.format("Expected %s xml element but was %s", expectedName,
getName()),
NetconfDocumentedException.ErrorType.application,
NetconfDocumentedException.ErrorTag.operation_failed,
NetconfDocumentedException.ErrorSeverity.error);
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public static Document checkIsMessageOk(Document response) throws NetconfDocumentedException {
XmlElement element = XmlElement.fromDomDocument(response);
Preconditions.checkState(element.getName().equals(XmlNetconfConstants.RPC_REPLY_KEY));
element = element.getOnlyChildElement();
if (element.getName().equals(XmlNetconfConstants.OK)) {
return response;
}
LOG.warn("Can not load last configuration. Operation failed.");
throw new IllegalStateException("Can not load last configuration. Operation failed: "
+ XmlUtil.toString(response));
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public String getTextContent() throws NetconfDocumentedException {
NodeList childNodes = element.getChildNodes();
if (childNodes.getLength() == 0) {
return DEFAULT_NAMESPACE_PREFIX;
}
for(int i = 0; i < childNodes.getLength(); i++) {
Node textChild = childNodes.item(i);
if (textChild instanceof Text) {
String content = textChild.getTextContent();
return content.trim();
}
}
throw new NetconfDocumentedException(getName() + " should contain text.",
NetconfDocumentedException.ErrorType.application,
NetconfDocumentedException.ErrorTag.invalid_value,
NetconfDocumentedException.ErrorSeverity.error
);
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public static boolean isOKMessage(XmlElement xmlElement) throws NetconfDocumentedException {
if(xmlElement.getChildElements().size() != 1) {
return false;
}
return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.OK);
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public static boolean isErrorMessage(XmlElement xmlElement) throws NetconfDocumentedException {
if(xmlElement.getChildElements().size() != 1) {
return false;
}
return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.RPC_ERROR);
}
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
private static Optional<Datastore> parseSource(final XmlElement xml) throws NetconfDocumentedException {
final Optional<XmlElement> sourceElement = xml.getOnlyChildElementOptionally(XmlNetconfConstants.SOURCE_KEY,
XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
return sourceElement.isPresent() ?
Optional.of(Datastore.valueOf(sourceElement.get().getOnlyChildElement().getName())) : Optional.<Datastore>absent();
}
代码示例来源:origin: org.opendaylight.controller/sal-netconf-connector
private static boolean isNotification(final NetconfMessage message) {
final XmlElement xmle = XmlElement.fromDomDocument(message.getDocument());
return XmlNetconfConstants.NOTIFICATION_ELEMENT_NAME.equals(xmle.getName()) ;
}
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
private Datastore extractTargetParameter(final XmlElement operationElement) throws NetconfDocumentedException {
final NodeList elementsByTagName = operationElement.getDomElement().getElementsByTagName(TARGET_KEY);
// Direct lookup instead of using XmlElement class due to performance
if (elementsByTagName.getLength() == 0) {
throw new NetconfDocumentedException("Missing target element", ErrorType.rpc, ErrorTag.missing_attribute, ErrorSeverity.error);
} else if (elementsByTagName.getLength() > 1) {
throw new NetconfDocumentedException("Multiple target elements", ErrorType.rpc, ErrorTag.unknown_attribute, ErrorSeverity.error);
} else {
final XmlElement targetChildNode = XmlElement.fromDomElement((Element) elementsByTagName.item(0)).getOnlyChildElement();
return Datastore.valueOf(targetChildNode.getName());
}
}
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
static Datastore extractTargetParameter(final XmlElement operationElement) throws NetconfDocumentedException {
final XmlElement targetChildNode;
try {
final XmlElement targetElement = operationElement.getOnlyChildElementWithSameNamespace(TARGET_KEY);
targetChildNode = targetElement.getOnlyChildElementWithSameNamespace();
} catch (final MissingNameSpaceException | UnexpectedNamespaceException e) {
LOG.trace("Can't get only child element with same namespace", e);
throw NetconfDocumentedException.wrap(e);
}
return Datastore.valueOf(targetChildNode.getName());
}
代码示例来源:origin: org.opendaylight.controller/mdsal-netconf-connector
static Datastore extractTargetParameter(final XmlElement operationElement) throws NetconfDocumentedException {
final XmlElement targetChildNode;
try {
final XmlElement targetElement = operationElement.getOnlyChildElementWithSameNamespace(TARGET_KEY);
targetChildNode = targetElement.getOnlyChildElementWithSameNamespace();
} catch (final MissingNameSpaceException | UnexpectedNamespaceException e) {
LOG.trace("Can't get only child element with same namespace", e);
throw NetconfDocumentedException.wrap(e);
}
return Datastore.valueOf(targetChildNode.getName());
}
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
public static Datastore fromXml(XmlElement xml) throws UnexpectedNamespaceException, UnexpectedElementException, MissingNameSpaceException, NetconfDocumentedException {
xml.checkName(GET_CONFIG);
xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
XmlElement sourceElement = xml.getOnlyChildElement(XmlNetconfConstants.SOURCE_KEY,
XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
XmlElement sourceNode = sourceElement.getOnlyChildElement();
String sourceParsed = sourceNode.getName();
LOG.debug("Setting source datastore to '{}'", sourceParsed);
Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
// Filter option: ignore for now, TODO only load modules specified by the filter
return sourceDatastore;
}
代码示例来源:origin: org.opendaylight.controller/config-netconf-connector
private void checkXml(XmlElement xml) throws NetconfDocumentedException {
xml.checkName(VALIDATE);
xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
XmlElement sourceElement = xml.getOnlyChildElement(XmlNetconfConstants.SOURCE_KEY,
XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
XmlElement sourceChildNode = sourceElement.getOnlyChildElement();
sourceChildNode.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
String datastoreValue = sourceChildNode.getName();
Datastore sourceDatastore = Datastore.valueOf(datastoreValue);
if (sourceDatastore != Datastore.candidate){
throw new NetconfDocumentedException( "Only " + Datastore.candidate
+ " is supported as source for " + VALIDATE + " but was " + datastoreValue,ErrorType.application,ErrorTag.data_missing,ErrorSeverity.error);
}
}
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我的设备yang如下图- module router { yang-version 1; namespace "urn:sdnhub:odl:tutorial:router";
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 5 年前。 Improve t
我想使用 python 库 ncclient 0.6.6 和 Python 2.7.15 连接到 NETCONF 服务器 (netopeer2) 并读出正在运行的配置。 我尝试按照手册中的示例,在控制
我的 Python 脚本在返回我传递给它的 XML rpc 请求之前会终止我的 netconf session 。当我直接连接到路由器的 Netconf session 时,我的 XML rpc 可以
Microsoft 将于 2024 年 8 月 20 日举办免费的 .NET Conf: Focus on AI。该虚拟活动为开发人员提供了如何集成 .NET 和 AI 以增强应用程序开发和用户体验的
目前我正在用 C++ 实现 netconf 服务器。我找到了这个网站: https://www.appinf.com/docs/poco-2008.2/NetconfUserGuide.html我想也
我已将 ODL Netconf 测试工具 (netconf-testtool-1.1.0-Boron-executable.jar) 部署到我的 Nitrogen ODL Controller 上,以
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement类的一些代码示例,展示了XmlElement类的具体用法。这些代码示例
本文整理了Java中org.opendaylight.controller.netconf.util.capability.YangModuleCapability类的一些代码示例,展示了YangMo
While starting open daylight netconf test tool simulator I am getting the following error: “java -ja
我已经使用 J2ssh 库 (0.2.7) 在我的应用程序中建立 NETCONF 连接。在配置文件监视时,我注意到很少有线程在 j2ssh session 的 connect() 中被阻止。这不是一个
我正在尝试找到一种更好的方法来生成要发送到其中包含 NETCONF 标记的设备的 XML RPC 请求。 我们知道请求应该是什么样子,所以我正在做的是,只是用其中的占位符对 XML-RPC 请求 XM
我正在尝试找到一种更好的方法来生成 XML RPC 请求,以将其发送到其中包含 NETCONF 标记的设备。 我们知道请求应该是什么样子,所以我正在做的是硬编码 XML-RPC 请求 XML,其中包含
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getNamespaceOptionally()方法的一些代码示例,
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.findNamespaceOfTextContent()方法的一些代
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getName()方法的一些代码示例,展示了XmlElement.g
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getOnlyChildElementWithSameNamespa
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getChildElements()方法的一些代码示例,展示了Xml
本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.getChildElementsWithinNamespace()方
我是一名优秀的程序员,十分优秀!