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
8 package org.opendaylight.netconf.server.mapping.operations;
10 import org.opendaylight.netconf.api.xml.XmlElement;
11 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
12 import org.opendaylight.netconf.api.xml.XmlUtil;
13 import org.opendaylight.netconf.server.NetconfServerSession;
14 import org.opendaylight.netconf.server.api.operations.AbstractSingletonNetconfOperation;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17 import org.w3c.dom.Document;
18 import org.w3c.dom.Element;
20 public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
22 public static final String STOP_EXI = "stop-exi";
23 private NetconfServerSession netconfSession;
25 private static final Logger LOG = LoggerFactory
26 .getLogger(DefaultStopExi.class);
28 public DefaultStopExi(final String netconfSessionIdForReporting) {
29 super(netconfSessionIdForReporting);
33 protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
34 LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
36 netconfSession.stopExiCommunication();
38 Element getSchemaResult = document.createElementNS(
39 XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
40 LOG.trace("{} operation successful", STOP_EXI);
41 return getSchemaResult;
45 protected String getOperationName() {
50 protected String getOperationNamespace() {
51 return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;
55 public void setNetconfSession(final NetconfServerSession netconfServerSession) {
56 netconfSession = netconfServerSession;