2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.netconf.confignetconfconnector.operations.get;
11 import org.opendaylight.controller.config.facade.xml.ConfigSubsystemFacade;
12 import org.opendaylight.controller.config.util.xml.DocumentedException;
13 import org.opendaylight.controller.config.util.xml.XmlElement;
14 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
15 import org.opendaylight.controller.netconf.confignetconfconnector.operations.AbstractConfigNetconfOperation;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18 import org.w3c.dom.Document;
19 import org.w3c.dom.Element;
21 public class Get extends AbstractConfigNetconfOperation {
23 private static final Logger LOG = LoggerFactory.getLogger(Get.class);
25 public Get(final ConfigSubsystemFacade configSubsystemFacade, final String netconfSessionIdForReporting) {
26 super(configSubsystemFacade, netconfSessionIdForReporting);
29 private static void checkXml(XmlElement xml) throws DocumentedException {
30 xml.checkName(XmlNetconfConstants.GET);
31 xml.checkNamespace(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
33 // Filter option: ignore for now, TODO only load modules specified by the filter
37 protected String getOperationName() {
38 return XmlNetconfConstants.GET;
42 protected Element handleWithNoSubsequentOperations(Document document, XmlElement xml) throws DocumentedException {
44 final Element element = getConfigSubsystemFacade().get(document);
45 LOG.trace("{} operation successful", XmlNetconfConstants.GET);