31a7d320ea98d94b2012fe310df344df57af03a9
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / mapping / operations / DefaultStartExi.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\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
7  */\r
8 package org.opendaylight.controller.netconf.impl.mapping.operations;\r
9 \r
10 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
11 import org.opendaylight.controller.netconf.api.NetconfSession;\r
12 import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation;\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.XmlNetconfConstants;\r
16 import org.opendaylight.controller.netconf.util.xml.XmlUtil;\r
17 import org.slf4j.Logger;\r
18 import org.slf4j.LoggerFactory;\r
19 import org.w3c.dom.Document;\r
20 import org.w3c.dom.Element;\r
21 \r
22 public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {\r
23 \r
24     public static final String START_EXI = "start-exi";\r
25 \r
26     private NetconfSession netconfSession;\r
27 \r
28     private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class);\r
29 \r
30     public DefaultStartExi(String netconfSessionIdForReporting) {\r
31         super(netconfSessionIdForReporting);\r
32     }\r
33 \r
34     @Override\r
35     protected String getOperationName() {\r
36         return START_EXI;\r
37     }\r
38 \r
39     @Override\r
40     protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {\r
41 \r
42 \r
43         Element getSchemaResult = document\r
44                 .createElement(XmlNetconfConstants.OK);\r
45         XmlUtil.addNamespaceAttr(getSchemaResult,\r
46                 XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);\r
47 \r
48 \r
49         throw new UnsupportedOperationException("Not implemented");\r
50 \r
51         /*\r
52         try {\r
53             ExiParameters exiParams = new ExiParameters();\r
54             exiParams.setParametersFromXmlElement(operationElement);\r
55 \r
56             netconfSession.addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams));\r
57             netconfSession.addExiEncoderAfterMessageSent(ExiEncoderHandler.HANDLER_NAME,new ExiEncoderHandler(exiParams));\r
58 \r
59         } catch (EXIException e) {\r
60             getSchemaResult = document\r
61                     .createElement(XmlNetconfConstants.RPC_ERROR);\r
62         }\r
63 \r
64         logger.trace("{} operation successful", START_EXI);\r
65         logger.debug("received start-exi message {} ", XmlUtil.toString(document));\r
66         return getSchemaResult;\r
67         */\r
68     }\r
69 \r
70     @Override\r
71     public void setNetconfSession(NetconfSession s) {\r
72         netconfSession = s;\r
73     }\r
74 \r
75     public NetconfSession getNetconfSession() {\r
76         return netconfSession;\r
77     }\r
78 \r
79 \r
80 }\r