Merge "BUG-1105: Implement subtree filtering in netconf"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 18 Jun 2014 12:11:59 +0000 (12:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 18 Jun 2014 12:11:59 +0000 (12:11 +0000)
39 files changed:
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/get/Get.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml [new file with mode: 0644]
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationService.java
opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlElement.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java

index 48b4bbc2a825e6fd00a3d31575ffac69c0b22630..867ad603623b7998612dab84c906323d7aea8942 100644 (file)
@@ -103,10 +103,7 @@ public class Get extends AbstractConfigNetconfOperation {
         xml.checkName(XmlNetconfConstants.GET);
         xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
 
-        // Filter option - unsupported
-        if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
-            throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for " + XmlNetconfConstants.GET);
-        }
+        // Filter option: ignore for now, TODO only load modules specified by the filter
     }
 
     @Override
index 03e0176e32892b034b413443d3edf35cca7afb3c..bc059d345c647d2ea3316efea1887be1eee39a56 100644 (file)
@@ -9,6 +9,8 @@
 package org.opendaylight.controller.netconf.confignetconfconnector.operations.getconfig;
 
 import com.google.common.base.Optional;
+import java.util.Set;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.util.ConfigRegistryClient;
 import org.opendaylight.controller.config.util.ConfigTransactionClient;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
@@ -30,9 +32,6 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import javax.management.ObjectName;
-import java.util.Set;
-
 public class GetConfig extends AbstractConfigNetconfOperation {
 
     public static final String GET_CONFIG = "get-config";
@@ -65,11 +64,7 @@ public class GetConfig extends AbstractConfigNetconfOperation {
         logger.debug("Setting source datastore to '{}'", sourceParsed);
         Datastore sourceDatastore = Datastore.valueOf(sourceParsed);
 
-        // Filter option - unsupported
-        if (xml.getChildElements(XmlNetconfConstants.FILTER).size() != 0){
-            throw new UnsupportedOperationException("Unsupported option " + XmlNetconfConstants.FILTER + " for "
-                    + GET_CONFIG);
-        }
+        // Filter option: ignore for now, TODO only load modules specified by the filter
 
         return sourceDatastore;
 
index 75be1f8fe01647beeabbcb1101bd5265c7813578..54ad18a1dec7a61b2159a5b854d70084bbab0018 100644 (file)
@@ -13,10 +13,10 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.api.NetconfSessionListener;
 import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
 import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
@@ -98,7 +98,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
             session.onIncommingRpcFail();
             throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Error occured while processing mesage {}",e);
+            logger.trace("Error occurred while processing message",e);
             session.onOutgoingRpcError();
             session.onIncommingRpcFail();
             SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
@@ -111,6 +111,8 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
         logger.info("Session {} closed successfully", session.getSessionId());
     }
 
+
+
     private NetconfMessage processDocument(final NetconfMessage netconfMessage, NetconfServerSession session)
             throws NetconfDocumentedException {
 
@@ -123,6 +125,8 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
             Document rpcReply = operationRouter.onNetconfMessage(incomingDocument, session);
 
+            rpcReply = SubtreeFilter.applySubtreeFilter(incomingDocument, rpcReply);
+
             session.onIncommingRpcSuccess();
 
             responseDocument.appendChild(responseDocument.importNode(rpcReply.getDocumentElement(), true));
diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java
new file mode 100644 (file)
index 0000000..bfc7df5
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.netconf.impl;
+
+import com.google.common.base.Optional;
+import java.io.IOException;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation.OperationNameAndNamespace;
+import org.opendaylight.controller.netconf.util.xml.XmlElement;
+import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
+ */
+public class SubtreeFilter {
+    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilter.class);
+
+    static Document applySubtreeFilter(Document requestDocument, Document rpcReply) throws NetconfDocumentedException {
+        // FIXME: rpcReply document must be reread otherwise some nodes do not inherit namespaces. (services/service)
+        try {
+            rpcReply = XmlUtil.readXmlToDocument(XmlUtil.toString(rpcReply, true));
+        } catch (SAXException | IOException e) {
+            logger.error("Cannot transform document", e);
+            throw new NetconfDocumentedException("Cannot transform document");
+        }
+
+        OperationNameAndNamespace operationNameAndNamespace = new OperationNameAndNamespace(requestDocument);
+        if (XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0.equals(operationNameAndNamespace.getNamespace()) &&
+                XmlNetconfConstants.GET.equals(operationNameAndNamespace.getOperationName()) ||
+                XmlNetconfConstants.GET_CONFIG.equals(operationNameAndNamespace.getOperationName())) {
+            // process subtree filtering here, in case registered netconf operations do
+            // not implement filtering.
+            Optional<XmlElement> maybeFilter = operationNameAndNamespace.getOperationElement().getOnlyChildElementOptionally(
+                    XmlNetconfConstants.FILTER, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+            if (maybeFilter.isPresent() && (
+                    "subtree".equals(maybeFilter.get().getAttribute("type"))||
+                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0))
+            )) {
+
+
+                // do
+                return filtered(maybeFilter.get(), rpcReply);
+            }
+        }
+        return rpcReply; // return identical document
+    }
+
+    private static Document filtered(XmlElement filter, Document originalReplyDocument) throws NetconfDocumentedException {
+        Document result = XmlUtil.newDocument();
+        // even if filter is empty, copy /rpc/data
+        Element rpcReply = originalReplyDocument.getDocumentElement();
+        Node rpcReplyDst = result.importNode(rpcReply, false);
+        result.appendChild(rpcReplyDst);
+        XmlElement dataSrc = XmlElement.fromDomElement(rpcReply).getOnlyChildElement("data", XmlNetconfConstants.RFC4741_TARGET_NAMESPACE);
+        Element dataDst = (Element) result.importNode(dataSrc.getDomElement(), false);
+        rpcReplyDst.appendChild(dataDst);
+        addSubtree(filter, dataSrc, XmlElement.fromDomElement(dataDst));
+
+        return result;
+    }
+
+    private static void addSubtree(XmlElement filter, XmlElement src, XmlElement dst) {
+        for (XmlElement srcChild : src.getChildElements()) {
+            for (XmlElement filterChild : filter.getChildElements()) {
+                addSubtree2(filterChild, srcChild, dst);
+            }
+        }
+    }
+
+    private static MatchingResult addSubtree2(XmlElement filter, XmlElement src, XmlElement dstParent) {
+        Document document = dstParent.getDomElement().getOwnerDocument();
+        MatchingResult matches = matches(src, filter);
+        if (matches != MatchingResult.NO_MATCH && matches != MatchingResult.CONTENT_MISMATCH) {
+            // copy srcChild to dst
+            boolean filterHasChildren = filter.getChildElements().isEmpty() == false;
+            // copy to depth if this is leaf of filter tree
+            Element copied = (Element) document.importNode(src.getDomElement(), filterHasChildren == false);
+            boolean shouldAppend = filterHasChildren == false;
+            if (filterHasChildren) { // this implies TAG_MATCH
+                // do the same recursively
+                int numberOfTextMatchingChildren = 0;
+                for (XmlElement srcChild : src.getChildElements()) {
+                    for (XmlElement filterChild : filter.getChildElements()) {
+                        MatchingResult childMatch = addSubtree2(filterChild, srcChild, XmlElement.fromDomElement(copied));
+                        if (childMatch == MatchingResult.CONTENT_MISMATCH) {
+                            return MatchingResult.NO_MATCH;
+                        }
+                        if (childMatch == MatchingResult.CONTENT_MATCH) {
+                            numberOfTextMatchingChildren++;
+                        }
+                        shouldAppend |= childMatch != MatchingResult.NO_MATCH;
+                    }
+                }
+                // if only text matching child filters are specified..
+                if (numberOfTextMatchingChildren == filter.getChildElements().size()) {
+                    // force all children to be added (to depth). This is done by copying parent node to depth.
+                    // implies shouldAppend == true
+                    copied = (Element) document.importNode(src.getDomElement(), true);
+                }
+            }
+            if (shouldAppend) {
+                dstParent.getDomElement().appendChild(copied);
+            }
+        }
+        return matches;
+    }
+
+    /**
+     * Shallow compare src node to filter: tag name and namespace must match.
+     * If filter node has no children and has text content, it also must match.
+     */
+    private static MatchingResult matches(XmlElement src, XmlElement filter) {
+        boolean tagMatch = src.getName().equals(filter.getName()) &&
+                src.getNamespaceOptionally().equals(filter.getNamespaceOptionally());
+        MatchingResult result = null;
+        if (tagMatch) {
+            // match text content
+            Optional<String> maybeText = filter.getOnlyTextContentOptionally();
+            if (maybeText.isPresent()) {
+                if (maybeText.equals(src.getOnlyTextContentOptionally())) {
+                    result = MatchingResult.CONTENT_MATCH;
+                } else {
+                    result = MatchingResult.CONTENT_MISMATCH;
+                }
+            }
+            // match attributes, combination of content and tag is not supported
+            if (result == null) {
+                for (Attr attr : filter.getAttributes().values()) {
+                    // ignore namespace declarations
+                    if (XmlUtil.XMLNS_URI.equals(attr.getNamespaceURI()) == false ) {
+                        // find attr with matching localName(),  namespaceURI(),  == value() in src
+                        String found = src.getAttribute(attr.getLocalName(), attr.getNamespaceURI());
+                        if (attr.getValue().equals(found) && result != MatchingResult.NO_MATCH) {
+                            result = MatchingResult.TAG_MATCH;
+                        } else {
+                            result = MatchingResult.NO_MATCH;
+                        }
+                    }
+                }
+            }
+            if (result == null) {
+                result = MatchingResult.TAG_MATCH;
+            }
+        }
+        if (result == null) {
+            result = MatchingResult.NO_MATCH;
+        }
+        logger.debug("Matching {} to {} resulted in {}", src, filter, tagMatch);
+        return result;
+    }
+
+    enum MatchingResult {
+        NO_MATCH, TAG_MATCH, CONTENT_MATCH, CONTENT_MISMATCH
+    }
+}
diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java
new file mode 100644 (file)
index 0000000..b118343
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.netconf.impl;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+@RunWith(value = Parameterized.class)
+public class SubtreeFilterTest {
+    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilterTest.class);
+
+    private final int directoryIndex;
+
+    @Parameters
+    public static Collection<Object[]> data() {
+        List<Object[]> result = new ArrayList<>();
+        for (int i = 0; i <= 8; i++) {
+            result.add(new Object[]{i});
+        }
+        return result;
+    }
+
+    public SubtreeFilterTest(int directoryIndex) {
+        this.directoryIndex = directoryIndex;
+    }
+
+    @Before
+    public void setUp(){
+        XMLUnit.setIgnoreWhitespace(true);
+    }
+
+    @Test
+    public void test() throws Exception {
+        Document requestDocument = getDocument("request.xml");
+        Document preFilterDocument = getDocument("pre-filter.xml");
+        Document postFilterDocument = getDocument("post-filter.xml");
+        Document actualPostFilterDocument = SubtreeFilter.applySubtreeFilter(requestDocument, preFilterDocument);
+        logger.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
+        Diff diff = XMLUnit.compareXML(postFilterDocument, actualPostFilterDocument);
+        assertTrue(diff.toString(), diff.similar());
+
+    }
+
+    public Document getDocument(String fileName) throws SAXException, IOException {
+        return XmlUtil.readXmlToDocument(getClass().getResourceAsStream("/subtree/" + directoryIndex + "/" +
+                fileName));
+    }
+}
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml b/opendaylight/netconf/netconf-impl/src/test/resources/getConfig_reply_unfiltered.xml
new file mode 100644 (file)
index 0000000..3c2765a
--- /dev/null
@@ -0,0 +1,439 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-2">
+  <data>
+    <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          prefix:toaster-provider-impl
+        </type>
+        <name>toaster-provider-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-rpc-registry
+          </type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-data-broker
+          </type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          prefix:sal-netconf-connector
+        </type>
+        <name>controller-config</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+        <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          20000
+        </connection-timeout-millis>
+        <between-attempts-timeout-millis
+                xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000
+        </between-attempts-timeout-millis>
+        <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+        <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+        <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-registry>
+        <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+            prefix:netconf-client-dispatcher
+          </type>
+          <name>global-netconf-dispatcher</name>
+        </client-dispatcher>
+        <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+        <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+        <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+          <name>global-netconf-processing-executor</name>
+        </processing-executor>
+        <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+        <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-broker-osgi-registry
+          </type>
+          <name>binding-osgi-broker</name>
+        </binding-registry>
+        <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0
+        </max-connection-attempts>
+        <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+          <name>global-event-executor</name>
+        </event-executor>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          prefix:netconf-client-dispatcher
+        </type>
+        <name>global-netconf-dispatcher</name>
+        <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+          <name>global-worker-group</name>
+        </worker-thread-group>
+        <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+          <name>global-timer</name>
+        </timer>
+        <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+          <name>global-boss-group</name>
+        </boss-thread-group>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+        <name>singleton</name>
+        <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <threshold-filter>ERROR</threshold-filter>
+          <name>STDOUT</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+        </console-appenders>
+        <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <file-name>logs/audit.log</file-name>
+          <name>audit-file</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+        </file-appenders>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>audit</logger-name>
+          <appenders>audit-file</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>ERROR</level>
+          <logger-name>ROOT</logger-name>
+          <appenders>STDOUT</appenders>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>TRACE</level>
+          <logger-name>org.opendaylight.controller.netconf</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>io.netty</logger-name>
+        </loggers>
+        <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <max-file-size>10MB</max-file-size>
+          <file-name>logs/opendaylight.log</file-name>
+          <name>opendaylight.log</name>
+          <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+          <clean-history-on-start>false</clean-history-on-start>
+          <max-history>1</max-history>
+          <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+        </rolling-appenders>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+        <name>shutdown</name>
+        <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">
+          prefix:netty-hashed-wheel-timer
+        </type>
+        <name>global-timer</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+          prefix:netty-threadgroup-fixed
+        </type>
+        <name>global-boss-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">
+          prefix:netty-threadgroup-fixed
+        </type>
+        <name>global-worker-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          prefix:schema-service-singleton
+        </type>
+        <name>yang-schema-service</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl
+        </type>
+        <name>inmemory-dom-broker</name>
+        <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+          </type>
+          <name>inmemory-data-broker</name>
+        </async-data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          prefix:dom-inmemory-data-broker
+        </type>
+        <name>inmemory-data-broker</name>
+        <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+          <name>yang-schema-service</name>
+        </schema-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          prefix:threadpool-flexible
+        </type>
+        <name>global-netconf-processing-executor</name>
+        <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+          <name>global-netconf-processing-executor-threadfactory</name>
+        </threadFactory>
+        <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1
+        </minThreadCount>
+        <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4
+        </max-thread-count>
+        <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000
+        </keepAliveMillis>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">
+          prefix:netty-global-event-executor
+        </type>
+        <name>singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-broker-impl
+        </type>
+        <name>binding-broker-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-data-broker
+          </type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:runtime-generated-mapping
+        </type>
+        <name>runtime-mapping-singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-notification-broker
+        </type>
+        <name>binding-notification-broker</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-data-compatible-broker
+        </type>
+        <name>inmemory-binding-data-broker</name>
+        <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-async-broker>
+        <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+            prefix:binding-dom-mapping-service
+          </type>
+          <name>runtime-mapping-singleton</name>
+        </binding-mapping-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+          prefix:threadfactory-naming
+        </type>
+        <name>global-netconf-processing-executor-threadfactory</name>
+        <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">
+          remote-connector-processing-executor
+        </name-prefix>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          prefix:kitchen-service-impl
+        </type>
+        <name>kitchen-service-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-notification-service
+          </type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+            prefix:binding-rpc-registry
+          </type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          prefix:remote-zeromq-rpc-server
+        </type>
+        <name>remoter</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+        <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">
+            prefix:dom-broker-osgi-registry
+          </type>
+          <name>dom-broker</name>
+        </dom-broker>
+      </module>
+    </modules>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry
+        </type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker
+        </type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>
+            /modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']
+          </provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          prefix:binding-dom-mapping-service
+        </type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry
+        </type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+          prefix:binding-notification-service
+        </type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+          prefix:binding-broker-osgi-registry
+        </type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker
+        </type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']
+          </provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          prefix:kitchen-service
+        </type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">
+          prefix:netconf-client-dispatcher
+        </type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml b/opendaylight/netconf/netconf-impl/src/test/resources/logback-test.xml
new file mode 100644 (file)
index 0000000..74714a0
--- /dev/null
@@ -0,0 +1,13 @@
+<configuration scan="true">
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+  <logger name="org.opendaylight.controller.netconf" level="TRACE"/>
+</configuration>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/post-filter.xml
new file mode 100644 (file)
index 0000000..4abe6a3
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/pre-filter.xml
new file mode 100644 (file)
index 0000000..031409b
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/0/request.xml
new file mode 100644 (file)
index 0000000..8d49a7f
--- /dev/null
@@ -0,0 +1,5 @@
+<rpc message-id="0"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/post-filter.xml
new file mode 100644 (file)
index 0000000..1ad3f20
--- /dev/null
@@ -0,0 +1,5 @@
+<rpc-reply message-id="1"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/pre-filter.xml
new file mode 100644 (file)
index 0000000..8fd61e1
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/1/request.xml
new file mode 100644 (file)
index 0000000..2579aa6
--- /dev/null
@@ -0,0 +1,7 @@
+<rpc message-id="1"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+    <filter type="subtree">
+    </filter>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/post-filter.xml
new file mode 100644 (file)
index 0000000..e974b59
--- /dev/null
@@ -0,0 +1,35 @@
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/pre-filter.xml
new file mode 100644 (file)
index 0000000..a399e57
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/2/request.xml
new file mode 100644 (file)
index 0000000..7b549b9
--- /dev/null
@@ -0,0 +1,13 @@
+<rpc message-id="2"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users/>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/post-filter.xml
new file mode 100644 (file)
index 0000000..e379d49
--- /dev/null
@@ -0,0 +1,26 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="3"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+        </user>
+        <user>
+          <name>fred</name>
+        </user>
+        <user>
+          <name>barney</name>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/pre-filter.xml
new file mode 100644 (file)
index 0000000..42f451b
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/3/request.xml
new file mode 100644 (file)
index 0000000..771f136
--- /dev/null
@@ -0,0 +1,25 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc message-id="3"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name/>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/post-filter.xml
new file mode 100644 (file)
index 0000000..c701ba0
--- /dev/null
@@ -0,0 +1,18 @@
+<rpc-reply message-id="4"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/pre-filter.xml
new file mode 100644 (file)
index 0000000..f2f2cbb
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/4/request.xml
new file mode 100644 (file)
index 0000000..04c8149
--- /dev/null
@@ -0,0 +1,17 @@
+<rpc message-id="4"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>fred</name>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/post-filter.xml
new file mode 100644 (file)
index 0000000..d6ffd00
--- /dev/null
@@ -0,0 +1,14 @@
+<rpc-reply message-id="5"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/pre-filter.xml
new file mode 100644 (file)
index 0000000..7e3f721
--- /dev/null
@@ -0,0 +1,40 @@
+<rpc-reply message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/5/request.xml
new file mode 100644 (file)
index 0000000..3581988
--- /dev/null
@@ -0,0 +1,19 @@
+<rpc message-id="5"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>fred</name>
+            <type/>
+            <full-name/>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/post-filter.xml
new file mode 100644 (file)
index 0000000..05eb019
--- /dev/null
@@ -0,0 +1,22 @@
+<rpc-reply message-id="6"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <company-info>
+            <id>2</id>
+          </company-info>
+        </user>
+      </users>
+    </top>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/pre-filter.xml
new file mode 100644 (file)
index 0000000..71dd628
--- /dev/null
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<rpc-reply message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/6/request.xml
new file mode 100644 (file)
index 0000000..c4a410d
--- /dev/null
@@ -0,0 +1,32 @@
+<rpc message-id="6"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get-config>
+    <source>
+      <running/>
+    </source>
+    <filter type="subtree">
+      <top xmlns="http://example.com/schema/1.2/config">
+        <users>
+          <user>
+            <name>root</name>
+            <company-info/>
+          </user>
+          <user>
+            <name>fred</name>
+            <company-info>
+              <id/>
+            </company-info>
+          </user>
+          <user>
+            <name>barney</name>
+            <type>superuser</type>
+            <company-info>
+              <dept/>
+            </company-info>
+          </user>
+        </users>
+      </top>
+    </filter>
+  </get-config>
+</rpc>
+
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/post-filter.xml
new file mode 100644 (file)
index 0000000..676ba22
--- /dev/null
@@ -0,0 +1,13 @@
+<rpc-reply message-id="7"
+           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <t:top xmlns:t="http://example.com/schema/1.2/stats">
+      <t:interfaces>
+        <t:interface t:ifName="eth0">
+          <t:ifInOctets>45621</t:ifInOctets>
+          <t:ifOutOctets>774344</t:ifOutOctets>
+        </t:interface>
+      </t:interfaces>
+    </t:top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/pre-filter.xml
new file mode 100644 (file)
index 0000000..ef88283
--- /dev/null
@@ -0,0 +1,52 @@
+<rpc-reply message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <data>
+    <top xmlns="http://example.com/schema/1.2/config">
+      <users>
+        <user>
+          <name>root</name>
+          <type>superuser</type>
+          <full-name>Charlie Root</full-name>
+          <company-info>
+            <dept>1</dept>
+            <id>1</id>
+          </company-info>
+        </user>
+        <user>
+          <name>fred</name>
+          <type>admin</type>
+          <full-name>Fred Flintstone</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>2</id>
+          </company-info>
+        </user>
+        <user>
+          <name>barney</name>
+          <type>admin</type>
+          <full-name>Barney Rubble</full-name>
+          <company-info>
+            <dept>2</dept>
+            <id>3</id>
+          </company-info>
+        </user>
+      </users>
+      <groups>
+        <group>
+          <name>admin</name>
+        </group>
+      </groups>
+    </top>
+    <prefix:top xmlns:prefix="http://example.com/schema/1.2/stats">
+      <prefix:interfaces>
+        <prefix:interface prefix:ifName="eth0">
+          <prefix:ifInOctets>45621</prefix:ifInOctets>
+          <prefix:ifOutOctets>774344</prefix:ifOutOctets>
+        </prefix:interface>
+        <prefix:interface prefix:ifName="eth1">
+          <prefix:ifInOctets>1</prefix:ifInOctets>
+          <prefix:ifOutOctets>1</prefix:ifOutOctets>
+        </prefix:interface>
+      </prefix:interfaces>
+    </prefix:top>
+  </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/7/request.xml
new file mode 100644 (file)
index 0000000..4bbbaba
--- /dev/null
@@ -0,0 +1,12 @@
+<rpc message-id="7"
+     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+  <get>
+    <filter type="subtree">
+      <t:top xmlns:t="http://example.com/schema/1.2/stats">
+        <t:interfaces>
+          <t:interface t:ifName="eth0"/>
+        </t:interfaces>
+      </t:top>
+    </filter>
+  </get>
+</rpc>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/post-filter.xml
new file mode 100644 (file)
index 0000000..3498b02
--- /dev/null
@@ -0,0 +1,115 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+  <data>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/pre-filter.xml
new file mode 100644 (file)
index 0000000..8a57b4c
--- /dev/null
@@ -0,0 +1,350 @@
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-6">
+  <data>
+    <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">prefix:toaster-provider-impl</type>
+        <name>toaster-provider-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+        <name>controller-config</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+        <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">20000</connection-timeout-millis>
+        <between-attempts-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000</between-attempts-timeout-millis>
+        <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+        <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+        <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-registry>
+        <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+          <name>global-netconf-dispatcher</name>
+        </client-dispatcher>
+        <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+        <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+        <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+          <name>global-netconf-processing-executor</name>
+        </processing-executor>
+        <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+        <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+          <name>binding-osgi-broker</name>
+        </binding-registry>
+        <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0</max-connection-attempts>
+        <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+          <name>global-event-executor</name>
+        </event-executor>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">prefix:netconf-client-dispatcher</type>
+        <name>global-netconf-dispatcher</name>
+        <worker-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+          <name>global-worker-group</name>
+        </worker-thread-group>
+        <timer xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+          <name>global-timer</name>
+        </timer>
+        <boss-thread-group xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:netconf:client:dispatcher">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+          <name>global-boss-group</name>
+        </boss-thread-group>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:logback:config">prefix:logback</type>
+        <name>singleton</name>
+        <console-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <threshold-filter>ERROR</threshold-filter>
+          <name>STDOUT</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</encoder-pattern>
+        </console-appenders>
+        <file-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <file-name>logs/audit.log</file-name>
+          <name>audit-file</name>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</encoder-pattern>
+        </file-appenders>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>org.opendaylight.controller.logging.bridge</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>audit</logger-name>
+          <appenders>audit-file</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>ERROR</level>
+          <logger-name>ROOT</logger-name>
+          <appenders>STDOUT</appenders>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>INFO</level>
+          <logger-name>org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort</logger-name>
+          <appenders>opendaylight.log</appenders>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>TRACE</level>
+          <logger-name>org.opendaylight.controller.netconf</logger-name>
+        </loggers>
+        <loggers xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <level>WARN</level>
+          <logger-name>io.netty</logger-name>
+        </loggers>
+        <rolling-appenders xmlns="urn:opendaylight:params:xml:ns:yang:controller:logback:config">
+          <append>true</append>
+          <max-file-size>10MB</max-file-size>
+          <file-name>logs/opendaylight.log</file-name>
+          <name>opendaylight.log</name>
+          <file-name-pattern>logs/opendaylight.%d.log.zip</file-name-pattern>
+          <encoder-pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</encoder-pattern>
+          <clean-history-on-start>false</clean-history-on-start>
+          <max-history>1</max-history>
+          <rolling-policy-type>TimeBasedRollingPolicy</rolling-policy-type>
+        </rolling-appenders>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+        <name>shutdown</name>
+        <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:timer">prefix:netty-hashed-wheel-timer</type>
+        <name>global-timer</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+        <name>global-boss-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">prefix:netty-threadgroup-fixed</type>
+        <name>global-worker-group</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
+        <name>yang-schema-service</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
+        <name>inmemory-dom-broker</name>
+        <async-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+          <name>inmemory-data-broker</name>
+        </async-data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-inmemory-data-broker</type>
+        <name>inmemory-data-broker</name>
+        <schema-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+          <name>yang-schema-service</name>
+        </schema-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">prefix:threadpool-flexible</type>
+        <name>global-netconf-processing-executor</name>
+        <threadFactory xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+          <name>global-netconf-processing-executor-threadfactory</name>
+        </threadFactory>
+        <minThreadCount xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">1</minThreadCount>
+        <max-thread-count xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">4</max-thread-count>
+        <keepAliveMillis xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl:flexible">600000</keepAliveMillis>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor">prefix:netty-global-event-executor</type>
+        <name>singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
+        <name>binding-broker-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+          <name>binding-data-broker</name>
+        </data-broker>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
+        <name>runtime-mapping-singleton</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
+        <name>binding-notification-broker</name>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-compatible-broker</type>
+        <name>inmemory-binding-data-broker</name>
+        <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-async-broker>
+        <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+          <name>runtime-mapping-singleton</name>
+        </binding-mapping-service>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">prefix:threadfactory-naming</type>
+        <name>global-netconf-processing-executor-threadfactory</name>
+        <name-prefix xmlns="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl">remote-connector-processing-executor</name-prefix>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service-impl</type>
+        <name>kitchen-service-impl</name>
+        <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+          <name>binding-notification-broker</name>
+        </notification-service>
+        <rpc-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+          <name>binding-rpc-broker</name>
+        </rpc-registry>
+      </module>
+      <module>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">prefix:remote-zeromq-rpc-server</type>
+        <name>remoter</name>
+        <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">5666</port>
+        <dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote:rpc">
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+          <name>dom-broker</name>
+        </dom-broker>
+      </module>
+    </modules>
+    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:schema-service</type>
+        <instance>
+          <name>yang-schema-service</name>
+          <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+        <instance>
+          <name>dom-broker</name>
+          <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-async-data-broker</type>
+        <instance>
+          <name>inmemory-data-broker</name>
+          <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+        <instance>
+          <name>global-netconf-processing-executor</name>
+          <provider>/modules/module[type='threadpool-flexible'][name='global-netconf-processing-executor']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadfactory</type>
+        <instance>
+          <name>global-netconf-processing-executor-threadfactory</name>
+          <provider>/modules/module[type='threadfactory-naming'][name='global-netconf-processing-executor-threadfactory']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
+        <instance>
+          <name>runtime-mapping-singleton</name>
+          <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-timer</type>
+        <instance>
+          <name>global-timer</name>
+          <provider>/modules/module[type='netty-hashed-wheel-timer'][name='global-timer']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-threadgroup</type>
+        <instance>
+          <name>global-boss-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-boss-group']</provider>
+        </instance>
+        <instance>
+          <name>global-worker-group</name>
+          <provider>/modules/module[type='netty-threadgroup-fixed'][name='global-worker-group']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+        <instance>
+          <name>global-event-executor</name>
+          <provider>/modules/module[type='netty-global-event-executor'][name='singleton']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-rpc-registry</type>
+        <instance>
+          <name>binding-rpc-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-notification-service</type>
+        <instance>
+          <name>binding-notification-broker</name>
+          <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+        <instance>
+          <name>binding-osgi-broker</name>
+          <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-data-broker</type>
+        <instance>
+          <name>binding-data-broker</name>
+          <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">prefix:kitchen-service</type>
+        <instance>
+          <name>kitchen-service</name>
+          <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
+        </instance>
+      </service>
+      <service>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+        <instance>
+          <name>global-netconf-dispatcher</name>
+          <provider>/modules/module[type='netconf-client-dispatcher'][name='global-netconf-dispatcher']</provider>
+        </instance>
+      </service>
+    </services>
+  </data>
+</rpc-reply>
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/8/request.xml
new file mode 100644 (file)
index 0000000..4d71ba4
--- /dev/null
@@ -0,0 +1,12 @@
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-10">
+  <get-config>
+    <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
+      <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+        <service/>
+      </services>
+    </filter>
+    <source>
+      <running/>
+    </source>
+  </get-config>
+</rpc>
index 731aad6d1a4d7103ca12fc99541482b81a82757b..e9e92d9202297c626d57e02bcd173beed9ebdc13 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 
 public class NetconfMonitoringOperationService implements NetconfOperationService {
 
-    public static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
+    private static final Set<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
 
         @Override
         public String getCapabilityUri() {
index 4e32e82e89251089b8425fe3a990ab46fb22cace..2bda51b495c3505741ff9c697712cb3f98a2b1ee 100644 (file)
@@ -30,7 +30,7 @@ public class SSHTest {
         AuthProvider authProvider = mock(AuthProvider.class);
         doReturn(PEMGenerator.generate().toCharArray()).when(authProvider).getPEMAsCharArray();
         doReturn(true).when(authProvider).authenticated(anyString(), anyString());
-        NetconfSSHServer thread = NetconfSSHServer.start(1831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
+        NetconfSSHServer thread = NetconfSSHServer.start(10831, NetconfConfigUtil.getNetconfLocalAddress(), authProvider, new NioEventLoopGroup());
         Thread.sleep(2000);
         logger.info("Closing socket");
         thread.close();
index 65ca1b7c4b5118b00653aa5daf9d0416342532ef..8837c74ff5ad80911deb7c804d48383c52d4a51c 100644 (file)
@@ -47,12 +47,12 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
 
     public static final class OperationNameAndNamespace {
         private final String operationName, namespace;
+        private final XmlElement operationElement;
 
         public OperationNameAndNamespace(Document message) throws NetconfDocumentedException {
             XmlElement requestElement = null;
             requestElement = getRequestElementWithCheck(message);
-
-            XmlElement operationElement = requestElement.getOnlyChildElement();
+            operationElement = requestElement.getOnlyChildElement();
             operationName = operationElement.getName();
             namespace = operationElement.getNamespace();
         }
@@ -64,6 +64,10 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
         public String getNamespace() {
             return namespace;
         }
+
+        public XmlElement getOperationElement() {
+            return operationElement;
+        }
     }
 
     protected static XmlElement getRequestElementWithCheck(Document message) throws NetconfDocumentedException {
index ac200a0aa668c1a406e044e11205ac90c20fc478..8780925eb185b97493cfc7557620f2846604ecd4 100644 (file)
@@ -338,6 +338,17 @@ public final class XmlElement {
         );
     }
 
+    public Optional<String> getOnlyTextContentOptionally() {
+        // only return text content if this node has exactly one Text child node
+        if (element.getChildNodes().getLength() == 1) {
+            Node item = element.getChildNodes().item(0);
+            if (item instanceof Text) {
+                return Optional.of(((Text) item).getWholeText());
+            }
+        }
+        return Optional.absent();
+    }
+
     public String getNamespaceAttribute() throws MissingNameSpaceException {
         String attribute = element.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY);
         if (attribute == null || attribute.equals("")){
index 708f17cadbc2a16dd639b53b386dd84e212d3d54..fa72284b98c5139be4dacbdc0552ded84c0ebc52 100644 (file)
@@ -56,4 +56,5 @@ public final class XmlNetconfConstants {
     // TODO where to store namespace of config ?
     public static final String URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG = "urn:opendaylight:params:xml:ns:yang:controller:config";
     public static final String GET = "get";
+    public static final String GET_CONFIG = "get-config";
 }