X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fmapping%2Foperations%2FDefaultStartExi.java;h=1dab7e0b458683d98b03acf277a142dabf1546f5;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=3f0ae27dbbcea4e1226694eedd3aaab4a05ce586;hpb=88eb594b583e9e5eb922411a328546fe46ccbe26;p=controller.git 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 3f0ae27dbb..1dab7e0b45 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 @@ -7,40 +7,43 @@ */ package org.opendaylight.controller.netconf.impl.mapping.operations; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType; +import org.opendaylight.controller.config.util.xml.DocumentedException; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorSeverity; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorTag; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorType; +import org.opendaylight.controller.config.util.xml.XmlElement; +import org.opendaylight.controller.config.util.xml.XmlUtil; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution; import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -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; + public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { public static final String START_EXI = "start-exi"; private static final Logger LOG = LoggerFactory.getLogger(DefaultStartExi.class); private NetconfServerSession netconfSession; - public DefaultStartExi(String netconfSessionIdForReporting) { + public DefaultStartExi(final String netconfSessionIdForReporting) { super(netconfSessionIdForReporting); } @Override - public Document handle(Document message, - NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException { - LOG.debug("Received start-exi message {} ", XmlUtil.toString(message)); + public Document handle(final Document message, + final NetconfOperationChainedExecution subsequentOperation) throws DocumentedException { + if (LOG.isDebugEnabled()) { + LOG.debug("Received start-exi message {} ", XmlUtil.toString(message)); + } try { netconfSession.startExiCommunication(new NetconfMessage(message)); } catch (IllegalArgumentException e) { - throw new NetconfDocumentedException("Failed to parse EXI parameters", ErrorType.protocol, + throw new DocumentedException("Failed to parse EXI parameters", ErrorType.protocol, ErrorTag.operation_failed, ErrorSeverity.error); } @@ -48,7 +51,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement } @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws DocumentedException { Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK); LOG.trace("{} operation successful", START_EXI); return getSchemaResult; @@ -65,7 +68,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement } @Override - public void setNetconfSession(NetconfServerSession s) { + public void setNetconfSession(final NetconfServerSession s) { netconfSession = s; } }