package org.opendaylight.controller.netconf.impl.mapping.operations;\r
\r
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
-import org.opendaylight.controller.netconf.api.NetconfSession;\r
-import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation;\r
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;\r
+import org.opendaylight.controller.netconf.impl.NetconfServerSession;\r
import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;\r
import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
import org.w3c.dom.Document;\r
public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {\r
\r
public static final String STOP_EXI = "stop-exi";\r
- private NetconfSession netconfSession;\r
+ private NetconfServerSession netconfSession;\r
\r
private static final Logger logger = LoggerFactory\r
.getLogger(DefaultStartExi.class);\r
super(netconfSessionIdForReporting);\r
}\r
\r
+ @Override\r
+ protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {\r
+ logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));\r
+\r
+ netconfSession.stopExiCommunication();\r
+\r
+ Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);\r
+ logger.trace("{} operation successful", STOP_EXI);\r
+ return getSchemaResult;\r
+ }\r
+\r
@Override\r
protected String getOperationName() {\r
return STOP_EXI;\r
}\r
\r
@Override\r
- protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement)\r
- throws NetconfDocumentedException {\r
- throw new UnsupportedOperationException("Not implemented");\r
- /*\r
- netconfSession.remove(ExiDecoderHandler.class);\r
- netconfSession.removeAfterMessageSent(ExiEncoderHandler.HANDLER_NAME);\r
-\r
- Element getSchemaResult = document.createElement(XmlNetconfConstants.OK);\r
- XmlUtil.addNamespaceAttr(getSchemaResult,\r
- XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);\r
- logger.trace("{} operation successful", STOP_EXI);\r
- logger.debug("received stop-exi message {} ", XmlUtil.toString(document));\r
- return getSchemaResult;\r
- */\r
+ protected String getOperationNamespace() {\r
+ return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;\r
}\r
\r
@Override\r
- public void setNetconfSession(NetconfSession s) {\r
+ public void setNetconfSession(NetconfServerSession s) {\r
this.netconfSession = s;\r
}\r
-\r
- public NetconfSession getNetconfSession() {\r
- return netconfSession;\r
- }\r
}\r