X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Foperations%2Fgetconfig%2FGetConfig.java;h=fee3036214010d9dfe23453b62dee2cb70df2a17;hp=11d3e32edf6748fe811a9a25174330afae5b1d28;hb=25a9fb7730311a5ca298d8c6c8b24f0afb0e27be;hpb=d7a972ac145d9f0ac8870dac2d7835520e92c02a diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java index 11d3e32edf..fee3036214 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/getconfig/GetConfig.java @@ -9,9 +9,12 @@ 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; +import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.Config; import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.ServiceRegistryWrapper; import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation; @@ -23,16 +26,12 @@ import org.opendaylight.controller.netconf.util.exception.MissingNameSpaceExcept import org.opendaylight.controller.netconf.util.exception.UnexpectedElementException; import org.opendaylight.controller.netconf.util.exception.UnexpectedNamespaceException; 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.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,17 +64,14 @@ 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; } private Element getResponseInternal(final Document document, final ConfigRegistryClient configRegistryClient, - final Datastore source) throws NetconfDocumentedException { + final Datastore source) { Element dataElement = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent()); final Set instances = Datastore.getInstanceQueryStrategy(source, this.transactionProvider) .queryInstances(configRegistryClient); @@ -104,6 +100,6 @@ public class GetConfig extends AbstractConfigNetconfOperation { public Element handleWithNoSubsequentOperations(Document document, XmlElement xml) throws NetconfDocumentedException { Datastore source; source = fromXml(xml); - return getResponseInternal(document, configRegistryClient, source); + return getResponseInternal(document, getConfigRegistryClient(), source); } }