Merge "Simplify code using Java 8 features"
[netconf.git] / netconf / netconf-impl / src / main / java / org / opendaylight / netconf / impl / osgi / NetconfOperationRouterImpl.java
index b7db507ca577133acf9be0b6728ca0e962a9c61e..449b0db530585cf752744f92c6bbb3ba387b6435 100644 (file)
@@ -16,9 +16,9 @@ import java.util.HashSet;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import org.opendaylight.controller.config.util.xml.DocumentedException;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
+import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
+import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.impl.NetconfServerSession;
 import org.opendaylight.netconf.impl.mapping.operations.DefaultCloseSession;
 import org.opendaylight.netconf.impl.mapping.operations.DefaultNetconfOperation;
@@ -90,12 +90,11 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         netconfOperationServiceSnapshot.close();
     }
 
-    private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) throws
-            DocumentedException {
+    private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) {
         LOG.error("{}", message, exception);
         return new DocumentedException("Unexpected error",
                 DocumentedException.ErrorType.APPLICATION,
@@ -104,9 +103,8 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
                 Collections.singletonMap(DocumentedException.ErrorSeverity.ERROR.toString(), exception.toString()));
     }
 
-    private Document executeOperationWithHighestPriority(final Document message,
-                                                         final NetconfOperationExecution netconfOperationExecution)
-            throws DocumentedException {
+    private static Document executeOperationWithHighestPriority(final Document message,
+            final NetconfOperationExecution netconfOperationExecution) throws DocumentedException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Forwarding netconf message {} to {}", XmlUtil.toString(message), netconfOperationExecution
                     .netconfOperation);
@@ -154,7 +152,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
         return sortedPriority;
     }
 
-    private static class NetconfOperationExecution implements NetconfOperationChainedExecution {
+    private static final class NetconfOperationExecution implements NetconfOperationChainedExecution {
         private final NetconfOperation netconfOperation;
         private final NetconfOperationChainedExecution subsequentExecution;