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%2FDefaultCloseSession.java;h=3aa40b55a694dd3ac74d32d3ae5a462652b59e81;hp=303352c9c557f111cabde8866e4376698cb96190;hb=refs%2Fchanges%2F13%2F23413%2F26;hpb=071a641d7c12c0e6112d5ce0afe806b54f116ed2 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java index 303352c9c5..3aa40b55a6 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java @@ -11,12 +11,12 @@ package org.opendaylight.controller.netconf.impl.mapping.operations; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import java.util.Collections; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.config.util.xml.DocumentedException; +import org.opendaylight.controller.config.util.xml.XmlElement; +import org.opendaylight.controller.config.util.xml.XmlUtil; import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.controller.netconf.impl.NetconfServerSession; 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; @@ -47,17 +47,17 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation imple */ @Override protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) - throws NetconfDocumentedException { + throws DocumentedException { try { sessionResources.close(); Preconditions.checkNotNull(session, "Session was not set").delayedClose(); LOG.info("Session {} closing", session.getSessionId()); } catch (Exception e) { - throw new NetconfDocumentedException("Unable to properly close session " - + getNetconfSessionIdForReporting(), NetconfDocumentedException.ErrorType.application, - NetconfDocumentedException.ErrorTag.operation_failed, - NetconfDocumentedException.ErrorSeverity.error, Collections.singletonMap( - NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage())); + throw new DocumentedException("Unable to properly close session " + + getNetconfSessionIdForReporting(), DocumentedException.ErrorType.application, + DocumentedException.ErrorTag.operation_failed, + DocumentedException.ErrorSeverity.error, Collections.singletonMap( + DocumentedException.ErrorSeverity.error.toString(), e.getMessage())); } return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent()); }