*/
package org.opendaylight.controller.netconf.monitoring;
-import java.util.Map;
-
+import com.google.common.collect.Maps;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
+import java.util.Map;
public class Get extends AbstractNetconfOperation {
this.netconfMonitor = netconfMonitor;
}
- private Element getPlaceholder(Document innerResult) {
+ private Element getPlaceholder(Document innerResult) throws NetconfDocumentedException {
try {
- XmlElement rootElement = XmlElement.fromDomElementWithExpected(innerResult.getDocumentElement(),
- XmlNetconfConstants.RPC_REPLY_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+ XmlElement rootElement = null;
+ rootElement = XmlElement.fromDomElementWithExpected(innerResult.getDocumentElement(),
+ XmlNetconfConstants.RPC_REPLY_KEY, XmlNetconfConstants.RFC4741_TARGET_NAMESPACE);
return rootElement.getOnlyChildElement(XmlNetconfConstants.DATA_KEY).getDomElement();
} catch (RuntimeException e) {
throw new IllegalArgumentException(String.format(
@Override
public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation)
throws NetconfDocumentedException {
- Preconditions.checkArgument(subsequentOperation.isExecutionTermination() == false,
- "Subsequent netconf operation expected by %s", this);
+ if (subsequentOperation.isExecutionTermination()){
+ throw new NetconfDocumentedException(String.format("Subsequent netconf operation expected by %s", this),
+ NetconfDocumentedException.ErrorType.application,
+ NetconfDocumentedException.ErrorTag.operation_failed,
+ NetconfDocumentedException.ErrorSeverity.error);
+ }
try {
Document innerResult = subsequentOperation.execute(requestMessage);