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