2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.netconf.impl.mapping.operations;
\r
10 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
\r
11 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
\r
12 import org.opendaylight.controller.netconf.impl.NetconfServerSession;
\r
13 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
\r
14 import org.opendaylight.controller.netconf.util.xml.XmlElement;
\r
15 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
\r
16 import org.slf4j.Logger;
\r
17 import org.slf4j.LoggerFactory;
\r
18 import org.w3c.dom.Document;
\r
19 import org.w3c.dom.Element;
\r
21 public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
\r
23 public static final String STOP_EXI = "stop-exi";
\r
24 private NetconfServerSession netconfSession;
\r
26 private static final Logger logger = LoggerFactory
\r
27 .getLogger(DefaultStartExi.class);
\r
29 public DefaultStopExi(String netconfSessionIdForReporting) {
\r
30 super(netconfSessionIdForReporting);
\r
34 protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
\r
35 logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
\r
37 netconfSession.stopExiCommunication();
\r
39 Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
\r
40 logger.trace("{} operation successful", STOP_EXI);
\r
41 return getSchemaResult;
\r
45 protected String getOperationName() {
\r
50 protected String getOperationNamespace() {
\r
51 return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;
\r
55 public void setNetconfSession(NetconfServerSession s) {
\r
56 this.netconfSession = s;
\r