本文整理了Java中org.opendaylight.controller.netconf.util.xml.XmlElement.fromDomElementWithExpected()
方法的一些代码示例,展示了XmlElement.fromDomElementWithExpected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlElement.fromDomElementWithExpected()
方法的具体详情如下:
包路径:org.opendaylight.controller.netconf.util.xml.XmlElement
类名称:XmlElement
方法名:fromDomElementWithExpected
暂无
代码示例来源:origin: org.opendaylight.controller/netconf-util
protected static XmlElement getRequestElementWithCheck(final Document message) throws NetconfDocumentedException {
return XmlElement.fromDomElementWithExpected(message.getDocumentElement(), XmlNetconfConstants.RPC_KEY,
XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
}
代码示例来源:origin: org.opendaylight.controller/netconf-util
public static XmlElement fromDomElementWithExpected(Element element, String expectedName, String expectedNamespace) throws NetconfDocumentedException {
XmlElement xmlElement = XmlElement.fromDomElementWithExpected(element, expectedName);
xmlElement.checkNamespace(expectedNamespace);
return xmlElement;
}
代码示例来源:origin: org.opendaylight.controller/netconf-impl
private static boolean isCommitWithoutNotification(final Document message) {
XmlElement xmlElement = null;
try {
xmlElement = XmlElement.fromDomElementWithExpected(message.getDocumentElement(),
XmlNetconfConstants.RPC_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
} catch (NetconfDocumentedException e) {
LOG.trace("Commit operation is not valid due to ",e);
return false;
}
String attr = xmlElement.getAttribute(NOTIFY_ATTR);
if (attr == null || attr.equals("")){
return false;
} else if (attr.equals(Boolean.toString(false))) {
LOG.debug("Commit operation received with notify=false attribute {}", message);
return true;
} else {
return false;
}
}
代码示例来源:origin: org.opendaylight.controller/netconf-notifications-impl
private static Element getPlaceholder(final Document innerResult)
throws NetconfDocumentedException {
final XmlElement rootElement = XmlElement.fromDomElementWithExpected(
innerResult.getDocumentElement(), XmlNetconfConstants.RPC_REPLY_KEY, XmlNetconfConstants.RFC4741_TARGET_NAMESPACE);
return rootElement.getOnlyChildElement(XmlNetconfConstants.DATA_KEY).getDomElement();
}
代码示例来源:origin: org.opendaylight.controller/netconf-impl
private Element getConfigSnapshot(final NetconfOperationRouter opRouter) throws NetconfDocumentedException {
final Document responseDocument = opRouter.onNetconfMessage(
getConfigMessage, null);
XmlElement dataElement;
XmlElement xmlElement = XmlElement.fromDomElementWithExpected(responseDocument.getDocumentElement(),
XmlNetconfConstants.RPC_REPLY_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
dataElement = xmlElement.getOnlyChildElement(XmlNetconfConstants.DATA_KEY);
return dataElement.getDomElement();
}
内容来源于网络,如有侵权,请联系作者删除!