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.NamespaceURN;
11 import org.opendaylight.netconf.api.xml.XmlElement;
12 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
13 import org.opendaylight.netconf.api.xml.XmlUtil;
14 import org.opendaylight.netconf.server.NetconfServerSession;
15 import org.opendaylight.netconf.server.api.operations.AbstractSingletonNetconfOperation;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.SessionIdType;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
19 import org.w3c.dom.Document;
20 import org.w3c.dom.Element;
22 public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
23 private static final Logger LOG = LoggerFactory.getLogger(DefaultStopExi.class);
25 public static final String STOP_EXI = "stop-exi";
26 private NetconfServerSession netconfSession;
28 public DefaultStopExi(final SessionIdType sessionId) {
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(NamespaceURN.BASE, XmlNetconfConstants.OK);
39 LOG.trace("{} operation successful", STOP_EXI);
40 return getSchemaResult;
44 protected String getOperationName() {
49 protected String getOperationNamespace() {
50 return NamespaceURN.EXI;
54 public void setNetconfSession(final NetconfServerSession netconfServerSession) {
55 netconfSession = netconfServerSession;