X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fmapping%2Foperations%2FDefaultStartExi.java;h=a2befbadd287377bb6673394625b7eeca642d397;hp=15cc7bcff6ec29e5c0ca3ec0475e9d31f9d9c936;hb=2476e664eca3001805739246afa857695916814c;hpb=3ab0ebe1df3e7606cce0a61572f79bf12deb17c0 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java index 15cc7bcff6..a2befbadd2 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.netconf.impl.mapping.operations; - -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfSession; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; -import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.google.common.base.Optional; - -public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { - - public static final String START_EXI = "start-exi"; - - private NetconfSession netconfSession; - - private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class); - - public DefaultStartExi(String netconfSessionIdForReporting) { - super(netconfSessionIdForReporting); - } - - @Override - protected String getOperationName() { - return START_EXI; - } - - @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { - - Element getSchemaResult = XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); - - throw new UnsupportedOperationException("Not implemented"); - - /* - try { - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(operationElement); - - netconfSession.addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); - netconfSession.addExiEncoderAfterMessageSent(ExiEncoderHandler.HANDLER_NAME,new ExiEncoderHandler(exiParams)); - - } catch (EXIException e) { - getSchemaResult = document - .createElement(XmlNetconfConstants.RPC_ERROR); - } - - logger.trace("{} operation successful", START_EXI); - logger.debug("received start-exi message {} ", XmlUtil.toString(document)); - return getSchemaResult; - */ - } - - @Override - public void setNetconfSession(NetconfSession s) { - netconfSession = s; - } - - public NetconfSession getNetconfSession() { - return netconfSession; - } - - -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.netconf.impl.mapping.operations; + +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.netconf.api.NetconfSession; +import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; +import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; +import org.opendaylight.controller.netconf.util.xml.XmlElement; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.google.common.base.Optional; + +public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { + + public static final String START_EXI = "start-exi"; + + private NetconfSession netconfSession; + + private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class); + + public DefaultStartExi(String netconfSessionIdForReporting) { + super(netconfSessionIdForReporting); + } + + @Override + protected String getOperationName() { + return START_EXI; + } + + @Override + protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { + + Element getSchemaResult = XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); + + throw new UnsupportedOperationException("Not implemented"); + + /* + try { + ExiParameters exiParams = new ExiParameters(); + exiParams.setParametersFromXmlElement(operationElement); + + netconfSession.addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); + netconfSession.addExiEncoderAfterMessageSent(ExiEncoderHandler.HANDLER_NAME,new ExiEncoderHandler(exiParams)); + + } catch (EXIException e) { + getSchemaResult = document + .createElement(XmlNetconfConstants.RPC_ERROR); + } + + logger.trace("{} operation successful", START_EXI); + logger.debug("received start-exi message {} ", XmlUtil.toString(document)); + return getSchemaResult; + */ + } + + @Override + public void setNetconfSession(NetconfSession s) { + netconfSession = s; + } + + public NetconfSession getNetconfSession() { + return netconfSession; + } + + +}