Remove unused exceptions 96/74396/3
authorStephen Kitt <skitt@redhat.com>
Tue, 24 Jul 2018 13:10:43 +0000 (15:10 +0200)
committerStephen Kitt <skitt@redhat.com>
Tue, 24 Jul 2018 16:03:12 +0000 (18:03 +0200)
This drops exception declarations which are never used. If nothing
else, it allows simplifying declarations in upstream projects too.

Change-Id: I692a50ebb43e76c15a3a57ad88138be53184ce7b
Signed-off-by: Stephen Kitt <skitt@redhat.com>
92 files changed:
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannel.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallHomeAuthProviderImpl.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/CurrentSchemaContext.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/TransactionProvider.java
netconf/mdsal-netconf-yang-library/src/main/java/org/opendaylight/netconf/mdsal/yang/library/SchemaServiceToMdsalWriter.java
netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/StreamNotificationTopicRegistration.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/messages/NetconfHelloMessage.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactory.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SshClientChannelInitializer.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TcpClientChannelInitializer.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/TlsClientChannelInitializer.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorFactory.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStartExi.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultStopExi.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfSessionMonitoringService.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/util/DeserializerExceptionHandler.java
netconf/netconf-mapping-api/src/main/java/org/opendaylight/netconf/mapping/api/NetconfOperationChainedExecution.java
netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/Get.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfXMLToHelloMessageDecoder.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/Get.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/NetconfSSHProvider.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfNorthboundTcpServer.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/NetconfTCPProvider.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServerHandler.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyYangTextSourceProvider.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/NetconfNodeActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActor.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfConnectorDTO.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImpl.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageUtil.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/AsyncExecutionStrategy.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/PerfClientCallable.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/customrpc/SettableRpc.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedDiscardChanges.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedLock.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpchandler/SettableRpc.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java
protocol-framework/src/main/java/org/opendaylight/protocol/framework/ProtocolSessionPromise.java
protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonToPatchBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlNormalizedNodeBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/XmlToPatchBodyReader.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerHandler.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServerInitializer.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/nn/test/JsonToNnTest.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/JsonNormalizedNodeBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlNormalizedNodeBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonToPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlToPatchBodyReader.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYinBodyWriter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerHandler.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServerInitializer.java

index 02b9d3d0dac2311f357b1e450ec0438fd9361c05..e18facf652d77b834f5bf674f142575b4cd0a139 100644 (file)
@@ -55,8 +55,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     private ChannelOutboundHandlerAdapter createChannelAdapter() {
         return new ChannelOutboundHandlerAdapter() {
             @Override
-            public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise)
-                throws Exception {
+            public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) {
                 sshWriteAsyncHandler.write(ctx, msg, promise);
             }
         };
@@ -107,7 +106,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doBind(final SocketAddress localAddress) throws Exception {
+    protected void doBind(final SocketAddress localAddress) {
         throw new UnsupportedOperationException("Bind not supported.");
     }
 
@@ -128,14 +127,14 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doDisconnect() throws Exception {
+    protected void doDisconnect() {
         LOG.info("Disconnect invoked");
         doNettyDisconnect();
         doMinaDisconnect(false);
     }
 
     @Override
-    protected void doClose() throws Exception {
+    protected void doClose() {
         context.removeSelf();
         if (notClosing(session)) {
             session.close(true);
@@ -144,12 +143,12 @@ class MinaSshNettyChannel extends AbstractServerChannel {
     }
 
     @Override
-    protected void doBeginRead() throws Exception {
+    protected void doBeginRead() {
         // Intentional NOOP - read is started by AsyncSshHandlerReader
     }
 
     @Override
-    protected void doWrite(final ChannelOutboundBuffer in) throws Exception {
+    protected void doWrite(final ChannelOutboundBuffer in) {
         throw new IllegalStateException("Outbound writes to SSH should be done by SSH Write handler");
     }
 
@@ -166,7 +165,7 @@ class MinaSshNettyChannel extends AbstractServerChannel {
          * Invoked when SSH session dropped during read using {@link AsyncSshHandlerReader}.
          */
         @Override
-        public void close() throws Exception {
+        public void close() {
             doNettyDisconnect();
         }
     }
index 6b88df398755205c4e82c16ef3e41b2798f3602b..a3e2db5054fdc11d84096e20cc71ed7a58004a85 100644 (file)
@@ -184,7 +184,7 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         acceptor.close(true);
     }
 }
index 15445eb7460a39943163d5c5c1cae1b776acf607..c00bcec83b29dc2d59c65875ebeb17a69449c25d 100644 (file)
@@ -112,7 +112,7 @@ public class CallHomeAuthProviderImpl implements CallHomeAuthorizationProvider,
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         configReg.close();
         deviceReg.close();
         deviceOpReg.close();
index db43d0d39377e6cfc34a214422a52188ba3d2980..8a4979502b29b1521144d07e71fa3895c254190d 100644 (file)
@@ -314,7 +314,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener<Node>, StatusReco
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         reg.close();
     }
 }
index 2d752489a14f83b34f0355acd430bd1ddb46badd..30a10cd5fa5e62b5a4bdc28ceccd426bd0dfb63c 100644 (file)
@@ -121,7 +121,7 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         authProvider.close();
         statusReporter.close();
 
index 165f6310c7753184fa1f34cde2675ff039199199..2c5adb41b3a31b8f0f0819497b897da6d77e70b4 100644 (file)
@@ -51,7 +51,7 @@ public class CurrentSchemaContext implements SchemaContextListener, AutoCloseabl
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         listeners1.clear();
         schemaContextListenerListenerRegistration.close();
         currentContext.set(null);
index 768c7f2c2372b75f5e569cda775848680cbc55c4..5baf6d7d311eafbbf005b0debbd204899ffd9cc6 100644 (file)
@@ -48,7 +48,7 @@ public class TransactionProvider implements AutoCloseable {
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         for (final DOMDataReadWriteTransaction rwt : allOpenReadWriteTransactions) {
             rwt.cancel();
         }
index 69296ffe1c661986cd099272c477179a08c98b43..5fe60f91ff9c3d2201dea3d21dd68884fe5d60ed 100644 (file)
@@ -58,7 +58,7 @@ public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCl
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         // TODO Delete modules-state from operational data store
     }
 
index a77dbdc2e13b9a2fafe45b8d31a90b510209ec1e..01966c207262489f2ad7761586685ea73b522e58 100644 (file)
@@ -160,7 +160,7 @@ class StreamNotificationTopicRegistration extends NotificationTopicRegistration
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         closeStream();
     }
 
index 52ec7e1078ea74c84023100cf9e17688f74aa30c..349a57a64d2aa90badc498de134ec9705cb9f229 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.api.messages;
 import com.google.common.base.Optional;
 import com.google.common.collect.Sets;
 import java.util.Set;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
@@ -31,14 +30,13 @@ public final class NetconfHelloMessage extends NetconfMessage {
 
     private final NetconfHelloMessageAdditionalHeader additionalHeader;
 
-    public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader)
-            throws NetconfDocumentedException {
+    public NetconfHelloMessage(final Document doc, final NetconfHelloMessageAdditionalHeader additionalHeader) {
         super(doc);
         checkHelloMessage(doc);
         this.additionalHeader = additionalHeader;
     }
 
-    public NetconfHelloMessage(final Document doc) throws NetconfDocumentedException {
+    public NetconfHelloMessage(final Document doc) {
         this(doc, null);
     }
 
@@ -55,8 +53,7 @@ public final class NetconfHelloMessage extends NetconfMessage {
     }
 
     public static NetconfHelloMessage createClientHello(final Iterable<String> capabilities,
-            final Optional<NetconfHelloMessageAdditionalHeader> additionalHeaderOptional)
-                    throws NetconfDocumentedException {
+            final Optional<NetconfHelloMessageAdditionalHeader> additionalHeaderOptional) {
         return new NetconfHelloMessage(createHelloMessageDoc(capabilities), additionalHeaderOptional.orNull());
     }
 
@@ -80,8 +77,7 @@ public final class NetconfHelloMessage extends NetconfMessage {
         return doc;
     }
 
-    public static NetconfHelloMessage createServerHello(final Set<String> capabilities, final long sessionId)
-            throws NetconfDocumentedException {
+    public static NetconfHelloMessage createServerHello(final Set<String> capabilities, final long sessionId) {
         Document doc = createHelloMessageDoc(capabilities);
         Element sessionIdElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0,
                 XmlNetconfConstants.SESSION_ID);
index 69dc1059b5535f8914c95c966b69e9ccaa451b68..1816fee0e041f119c0b545e37e4bf21055b2c585 100644 (file)
@@ -154,7 +154,7 @@ public class NetconfClientSessionNegotiator extends
 
     @Override
     protected NetconfClientSession getSession(final NetconfClientSessionListener sessionListener, final Channel channel,
-                                              final NetconfHelloMessage message) throws NetconfDocumentedException {
+                                              final NetconfHelloMessage message) {
         final long sessionId = extractSessionId(message.getDocument());
 
         // Copy here is important: it disconnects the strings from the document
index 8123e5999e04e424c92418b3291e240483100889..d5e722d3e25c792cb6478b86ecd530282560dede 100644 (file)
@@ -19,7 +19,6 @@ import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.util.Set;
 import org.opendaylight.netconf.api.NetconfClientSessionPreferences;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
@@ -111,14 +110,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
             final Channel channel, final Promise<NetconfClientSession> promise) {
 
         NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID);
-        NetconfHelloMessage helloMessage = null;
-        try {
-            helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader);
-        } catch (NetconfDocumentedException e) {
-            LOG.error("Unable to create client hello message with capabilities {} and additional handler {}",
-                    clientCapabilities, additionalHeader);
-            throw new IllegalStateException(e);
-        }
+        NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(clientCapabilities, additionalHeader);
 
         NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage, startExiMessage);
         return new NetconfClientSessionNegotiator(proposal, promise, channel, timer,
index 9adf79cef1d404860ce8bc5cbfd2f5c00b67f3aa..37211c9a791e7fec105335e2a55f3b115f01e9cb 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.netconf.client;
 
 import io.netty.channel.Channel;
 import io.netty.util.concurrent.Promise;
-import java.io.IOException;
 import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler;
@@ -30,13 +29,9 @@ final class SshClientChannelInitializer extends AbstractChannelInitializer<Netco
 
     @Override
     public void initialize(final Channel ch, final Promise<NetconfClientSession> promise) {
-        try {
-            // ssh handler has to be the first handler in pipeline
-            ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise));
-            super.initialize(ch, promise);
-        } catch (final IOException e) {
-            throw new RuntimeException(e);
-        }
+        // ssh handler has to be the first handler in pipeline
+        ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler, promise));
+        super.initialize(ch, promise);
     }
 
     @Override
index 5f25800b4b0c595137485c78fc0bc095c1114e82..c241e17656736052b4cbe3bf48012c8891e02ea4 100644 (file)
@@ -43,7 +43,7 @@ class TcpClientChannelInitializer extends AbstractChannelInitializer<NetconfClie
             @Override
             public void connect(final ChannelHandlerContext ctx, final SocketAddress remoteAddress,
                                 final SocketAddress localAddress,
-                                final ChannelPromise channelPromise) throws Exception {
+                                final ChannelPromise channelPromise) {
                 connectPromise = channelPromise;
                 ChannelPromise tcpConnectFuture = new DefaultChannelPromise(ch);
 
index 27e751fc3d66573f1c1c06a6a21ac3ed98e4285f..5441bdcd268a455ae38290df53b2d2d9ed2ee116 100644 (file)
@@ -52,7 +52,7 @@ final class TlsClientChannelInitializer extends AbstractChannelInitializer<Netco
         }
 
         @Override
-        public void channelActive(ChannelHandlerContext ctx) throws Exception {
+        public void channelActive(ChannelHandlerContext ctx) {
             ctx.pipeline().replace(this, "sslHandler", sslHandlerFactory.createSslHandler())
                           .fireChannelActive();
         }
index b4a5b955e1d0bebf561af699be55701cea7b85ec..3dfd48b656dbd2123eb2611e9edad66429dc0dc5 100644 (file)
@@ -17,7 +17,6 @@ import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.net.SocketAddress;
 import java.util.Set;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
@@ -98,13 +97,8 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
             final Channel channel, final Promise<NetconfServerSession> promise) {
         final long sessionId = idProvider.getNextSessionId();
 
-        NetconfServerSessionPreferences proposal;
-        try {
-            proposal = new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
-        } catch (final NetconfDocumentedException e) {
-            LOG.error("Unable to create hello message for session {} with {}", sessionId, monitoringService);
-            throw new IllegalStateException(e);
-        }
+        NetconfServerSessionPreferences proposal =
+            new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
 
         return new NetconfServerSessionNegotiator(proposal, promise, channel, timer,
                 getListener(Long.toString(sessionId), channel.parent().localAddress()), connectionTimeoutMillis);
@@ -130,7 +124,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     }
 
     private NetconfHelloMessage createHelloMessage(
-            final long sessionId, final NetconfMonitoringService capabilityProvider) throws NetconfDocumentedException {
+            final long sessionId, final NetconfMonitoringService capabilityProvider) {
         return NetconfHelloMessage.createServerHello(Sets.union(transformCapabilities(capabilityProvider
                 .getCapabilities()), baseCapabilities), sessionId);
     }
index f1f57c204a43274a0485e7f6df68453f84864a04..3b4a5604649b329f4cf46ed7a9e7615991956f35 100644 (file)
@@ -52,7 +52,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
 
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document,
-                                                       final XmlElement operationElement) throws DocumentedException {
+                                                       final XmlElement operationElement) {
         final Element getSchemaResult = document.createElementNS(
                 XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
         LOG.trace("{} operation successful", START_EXI);
index a60ffb756aa7595ef012b583263bba9f0eadc6da..cd2d0f1e93c32cb96e53ef8d4918b979cfed969a 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.impl.mapping.operations;
 
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -32,7 +31,7 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
 
     @Override
     protected Element handleWithNoSubsequentOperations(Document document,
-                                                       XmlElement operationElement) throws DocumentedException {
+                                                       XmlElement operationElement) {
         LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
 
         netconfSession.stopExiCommunication();
index 5739488ff539213321caf5a7d9fa453879f29851..fd520a363e9a4b4b9a9050ca79c70f2bfce03b12 100644 (file)
@@ -205,7 +205,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         listeners.clear();
         capabilities.clear();
     }
index 5c4c508f31b6d4e422af4b0954191f80ccd5622d..ff0bc5ce392c235a11023b4e9df2a15152ff02f9 100644 (file)
@@ -80,7 +80,7 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, A
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         capabilityMonitoring.close();
         sessionMonitoring.close();
     }
index ee712b78c3a8d1bf421f2f2dab784105713f74a2..449b0db530585cf752744f92c6bbb3ba387b6435 100644 (file)
@@ -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,
index 72697ffebf1b69fc076b8ac6ca732afe61d5939b..da9a96b6d1de91f638c7ee85af1984925643ad59 100644 (file)
@@ -101,14 +101,14 @@ class NetconfSessionMonitoringService implements SessionListener, AutoCloseable
         }
         return new AutoCloseable() {
             @Override
-            public void close() throws Exception {
+            public void close() {
                 listeners.remove(listener);
             }
         };
     }
 
     @Override
-    public synchronized void close() throws Exception {
+    public synchronized void close() {
         stopUpdateSessionStats();
         listeners.clear();
         sessions.clear();
index 18b490ab13b258bb7038483be3abe2b33ada35e0..effccf3701113cae251ba4563f29d00a5f5b86c8 100644 (file)
@@ -22,17 +22,17 @@ public final class DeserializerExceptionHandler implements ChannelHandler {
     private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
 
     @Override
-    public void handlerAdded(final ChannelHandlerContext ctx) throws Exception {
+    public void handlerAdded(final ChannelHandlerContext ctx) {
         // NOOP
     }
 
     @Override
-    public void handlerRemoved(final ChannelHandlerContext ctx) throws Exception {
+    public void handlerRemoved(final ChannelHandlerContext ctx) {
         // NOOP
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         LOG.warn("An exception occurred during message handling", cause);
         handleDeserializerException(ctx, cause);
     }
index b7fae22c00b7d15d60f7201d2f951d23d4533881..8d0385948a133bc34ce40d8f78fca8eeba962f2d 100644 (file)
@@ -37,7 +37,7 @@ public interface NetconfOperationChainedExecution {
         }
 
         @Override
-        public Document execute(Document requestMessage) throws DocumentedException {
+        public Document execute(Document requestMessage) {
             throw new IllegalStateException("This execution represents the termination point in operation execution "
                     + "and cannot be executed itself");
         }
index 7aa2c2a4d7c99e72639953698e501447d1c8ca6e..4eaf60496c69352465de68969c35dfa76f7e3cd1 100644 (file)
@@ -85,8 +85,7 @@ public class Get extends AbstractNetconfOperation {
 
     @Override
     protected Element handle(final Document document, final XmlElement message,
-                             final NetconfOperationChainedExecution subsequentOperation)
-            throws DocumentedException {
+                             final NetconfOperationChainedExecution subsequentOperation) {
         throw new UnsupportedOperationException("Never gets called");
     }
 }
index b6a26804fd3ca9879dd170e879cc509fd51e667a..065a5bc9c42794d518170b3f9ec052e4dc4ffd85 100644 (file)
@@ -141,7 +141,7 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
 
                             channel.close().addListener(new GenericFutureListener<ChannelFuture>() {
                                 @Override
-                                public void operationComplete(final ChannelFuture future) throws Exception {
+                                public void operationComplete(final ChannelFuture future) {
                                     if (future.isSuccess()) {
                                         LOG.debug("Channel {} closed: success", future.channel());
                                     } else {
index 82f707572ce2a160ef45ae10609f810c45333c8d..6e02a3fa97cca9e3a5eab0df66750cfb2ce63b4f 100644 (file)
@@ -21,7 +21,6 @@ import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
-import org.opendaylight.netconf.api.NetconfDocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
@@ -60,7 +59,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder
     @Override
     @VisibleForTesting
     public void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
-            throws IOException, SAXException, NetconfDocumentedException {
+            throws IOException, SAXException {
         if (in.readableBytes() == 0) {
             LOG.debug("No more content in incoming buffer.");
             return;
@@ -108,8 +107,7 @@ public final class NetconfXMLToHelloMessageDecoder extends ByteToMessageDecoder
         }
     }
 
-    private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc)
-            throws NetconfDocumentedException {
+    private static NetconfMessage getNetconfMessage(final String additionalHeader, final Document doc) {
         NetconfMessage msg = new NetconfMessage(doc);
         if (NetconfHelloMessage.isHelloMessage(msg)) {
             if (additionalHeader != null) {
index 2d080ef3fca0e4372937b8bcb11c807fd5a1264a..fa59b344b86ad1ca29c26c3cf7a3d2f971207523 100644 (file)
@@ -63,7 +63,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
     private GenericFutureListener negotiationFutureListener;
 
     public AsyncSshHandler(final AuthenticationHandler authenticationHandler, final SshClient sshClient,
-            final Future<?> negotiationFuture) throws IOException {
+            final Future<?> negotiationFuture) {
         this(authenticationHandler, sshClient);
         this.negotiationFuture = negotiationFuture;
     }
@@ -73,16 +73,14 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
      *
      * @param authenticationHandler authentication handler
      * @param sshClient             started SshClient
-     * @throws IOException          if the I/O operation fails
      */
     public AsyncSshHandler(final AuthenticationHandler authenticationHandler,
-                           final SshClient sshClient) throws IOException {
+                           final SshClient sshClient) {
         this.authenticationHandler = Preconditions.checkNotNull(authenticationHandler);
         this.sshClient = Preconditions.checkNotNull(sshClient);
     }
 
-    public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler)
-            throws IOException {
+    public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler) {
         return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT);
     }
 
@@ -93,10 +91,9 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
      * @param authenticationHandler authentication handler
      * @param negotiationFuture     negotiation future
      * @return                      {@code AsyncSshHandler}
-     * @throws IOException          if the I/O operation fails
      */
     public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler,
-            final Future<?> negotiationFuture) throws IOException {
+            final Future<?> negotiationFuture) {
         return new AsyncSshHandler(authenticationHandler, DEFAULT_CLIENT, negotiationFuture);
     }
 
@@ -212,7 +209,7 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter {
     }
 
     @Override
-    public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
+    public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) {
         disconnect(ctx, promise);
     }
 
index bd7c9d17f98d3bd7a55538a15184f0273aa47010..e55f852a89c76cc50870c1920d2181d0c2f04221 100644 (file)
@@ -54,8 +54,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable {
 
     @Override
     protected Element handle(final Document document, final XmlElement message,
-                             final NetconfOperationChainedExecution subsequentOperation)
-            throws DocumentedException {
+                             final NetconfOperationChainedExecution subsequentOperation) {
         throw new UnsupportedOperationException("Never gets called");
     }
 
@@ -103,7 +102,7 @@ public class Get extends AbstractNetconfOperation implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
 
     }
 }
index 6724d10f14a15269cdfc5f56c755a200e6b4cd84..cc4c57c07b2bc1a81d2f727dfc6a8877a46df001 100644 (file)
@@ -41,7 +41,7 @@ public class Activator implements BundleActivator {
     private NetconfNotificationManager netconfNotificationManager;
 
     @Override
-    public void start(final BundleContext context) throws Exception {
+    public void start(final BundleContext context) {
         netconfNotificationManager = new NetconfNotificationManager();
         // Add properties to autowire with netconf-impl instance for cfg subsystem
         final Dictionary<String, String> props = new Hashtable<>();
@@ -94,7 +94,7 @@ public class Activator implements BundleActivator {
     }
 
     @Override
-    public void stop(final BundleContext context) throws Exception {
+    public void stop(final BundleContext context) {
         if (netconfNotificationCollectorServiceRegistration != null) {
             netconfNotificationCollectorServiceRegistration.unregister();
             netconfNotificationCollectorServiceRegistration = null;
index 971e50631ed5fc11ddfa8d4b89f7d6104f9c22d8..dd2d08970081b269816e116be86c2c47394193ca 100644 (file)
@@ -20,7 +20,6 @@ import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider;
 import org.opendaylight.netconf.auth.AuthProvider;
 import org.opendaylight.netconf.util.NetconfConfiguration;
-import org.osgi.framework.InvalidSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +49,7 @@ public class NetconfSSHProvider {
 
     // Called via blueprint
     @SuppressWarnings("unused")
-    public void init() throws IOException, InvalidSyntaxException {
+    public void init() throws IOException {
         minaTimerExecutor = Executors.newScheduledThreadPool(POOL_SIZE,
             runnable -> new Thread(runnable, "netconf-ssh-server-mina-timers"));
         clientGroup = new NioEventLoopGroup();
@@ -79,7 +78,7 @@ public class NetconfSSHProvider {
     }
 
     private SshProxyServer startSSHServer()
-            throws IOException, InvalidSyntaxException {
+            throws IOException {
 
         final InetSocketAddress sshSocketAddress = netconfConfiguration.getSshServerAddress();
         LOG.info("Starting netconf SSH server at {}", sshSocketAddress);
index 3d91f3aeb4ab35cd1fee451e869860968f584cf0..c016dc395949f3e172f9707f258107d6da101d89 100644 (file)
@@ -17,7 +17,6 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.local.LocalChannel;
 import io.netty.util.concurrent.GenericFutureListener;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
@@ -105,7 +104,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
     }
 
     @Override
-    public void start(final Environment env) throws IOException {
+    public void start(final Environment env) {
         LOG.trace("Establishing internal connection to netconf server for client: {}", getClientAddress());
 
         final Bootstrap clientBootstrap = new Bootstrap();
@@ -113,7 +112,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
 
         clientBootstrap.handler(new ChannelInitializer<LocalChannel>() {
             @Override
-            public void initChannel(final LocalChannel ch) throws Exception {
+            public void initChannel(final LocalChannel ch) {
                 ch.pipeline()
                         .addLast(new SshProxyClientHandler(in, out, netconfHelloMessageAdditionalHeader, callback));
             }
@@ -122,7 +121,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
         clientChannelFuture.addListener(new GenericFutureListener<ChannelFuture>() {
 
             @Override
-            public void operationComplete(final ChannelFuture future) throws Exception {
+            public void operationComplete(final ChannelFuture future) {
                 if (future.isSuccess()) {
                     clientChannel = clientChannelFuture.channel();
                 } else {
@@ -146,7 +145,7 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
             clientChannel.close().addListener(new GenericFutureListener<ChannelFuture>() {
 
                 @Override
-                public void operationComplete(final ChannelFuture future) throws Exception {
+                public void operationComplete(final ChannelFuture future) {
                     if (!future.isSuccess()) {
                         LOG.warn("Unable to release internal connection to netconf server on channel: {}",
                                 clientChannel);
index e8ec506026d24d79255e6788671d28e836b87360..edd63653f1745d8df5eaae6c8e05b2c0dbd8eb02 100644 (file)
@@ -79,7 +79,7 @@ final class SshProxyClientHandler extends ChannelInboundHandlerAdapter {
     }
 
     @Override
-    public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
         asyncSshHandlerWriter.write(ctx, msg, ctx.newPromise());
     }
 
index 8b9caef47b15388755bb308e23d608fe81351c14..69090c283f6a93cd3c8136d701f5e6846791f890 100644 (file)
@@ -48,7 +48,7 @@ public class NetconfNorthboundTcpServer implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (tcpServer.isDone()) {
             tcpServer.channel().close();
         } else {
index d53cf409162c2024911f22df85191762a04dfaf5..54fb94e162e70483f9dce1e8cdf80b917ba335d2 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.tcp;
 import java.net.InetSocketAddress;
 import org.opendaylight.netconf.tcp.netty.ProxyServer;
 import org.opendaylight.netconf.util.NetconfConfiguration;
-import org.osgi.framework.InvalidSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,7 +29,7 @@ public class NetconfTCPProvider {
 
     // Called via blueprint
     @SuppressWarnings("unused")
-    public void init() throws InvalidSyntaxException {
+    public void init() {
         final InetSocketAddress address = netconfConfiguration.getTcpServerAddress();
 
         if (address.getAddress().isAnyLocalAddress()) {
index 58d5a304585da74d9849a96cc869aad029da8940..feabd71cf079bfa333fb9d66d1200f830ce4c6dc 100644 (file)
@@ -38,7 +38,7 @@ public class ProxyServer implements AutoCloseable {
                 .handler(new LoggingHandler(LogLevel.DEBUG))
                 .childHandler(new ChannelInitializer<SocketChannel>() {
                     @Override
-                    public void initChannel(SocketChannel ch) throws Exception {
+                    public void initChannel(SocketChannel ch) {
                         ch.pipeline().addLast(new ProxyServerHandler(clientBootstrap, localAddress));
                     }
                 });
index 4731b0fed965b899fc36fb35cf8b174c41697021..5843f41066f510c0caa59fbc19b9952aca435b52 100644 (file)
@@ -36,7 +36,7 @@ public class ProxyServerHandler extends ChannelInboundHandlerAdapter {
         final ProxyClientHandler clientHandler = new ProxyClientHandler(remoteCtx);
         clientBootstrap.handler(new ChannelInitializer<LocalChannel>() {
             @Override
-            public void initChannel(LocalChannel ch) throws Exception {
+            public void initChannel(LocalChannel ch) {
                 ch.pipeline().addLast(clientHandler);
             }
         });
index 7275be18e6aaeda1620cffcf57e4557882d6c29f..99b541b846d58d342b07cacdf61c7523356fa440 100644 (file)
@@ -120,7 +120,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (!closed.compareAndSet(false, true)) {
             return;
         }
@@ -155,7 +155,7 @@ class NetconfTopologyContext implements ClusterSingletonService, AutoCloseable {
 
             future.onComplete(new OnComplete<Object>() {
                 @Override
-                public void onComplete(final Throwable failure, final Object success) throws Throwable {
+                public void onComplete(final Throwable failure, final Object success) {
                     if (failure != null) {
                         LOG.error("Failed to refresh master actor data: {}", failure);
                         return;
index e9ee161437a629d1292725c5267a1659a7848084..29423dddb18e6322c5795b122b4b3bae2c5a71d0 100644 (file)
@@ -54,7 +54,7 @@ public class ProxyYangTextSourceProvider implements RemoteYangTextSourceProvider
 
         scalaFuture.onComplete(new OnComplete<Object>() {
             @Override
-            public void onComplete(final Throwable failure, final Object success) throws Throwable {
+            public void onComplete(final Throwable failure, final Object success) {
                 if (failure != null) {
                     promise.failure(failure);
                     return;
index f81c7541f179f53a310daa9666b4af0691c520d5..a00bbb7f16df694ba2a9854a67994ea3ec1e09e9 100644 (file)
@@ -111,7 +111,7 @@ public class NetconfNodeActor extends AbstractUntypedActor {
 
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public void handleReceive(final Object message) throws Exception {
+    public void handleReceive(final Object message) {
         LOG.debug("{}:  received message {}", id, message);
 
         if (message instanceof CreateInitialMasterActorData) { // master
index c7a7d232c0c6329651d95f3961856dd125f363d9..abce08922b575af03a0ffa192c28f4087b307fd6 100644 (file)
@@ -32,7 +32,7 @@ class ReadAdapter {
     }
 
     @SuppressWarnings("checkstyle:IllegalThrows")
-    public void handle(final Object message, final ActorRef sender, final ActorRef self) throws Throwable {
+    public void handle(final Object message, final ActorRef sender, final ActorRef self) {
         if (message instanceof ReadRequest) {
 
             final ReadRequest readRequest = (ReadRequest) message;
index 0a2685965d7475e564887199e11a22d73ed22ffd..f96e76bf0becf56f080e18e0a93f7e2c257f32ee 100644 (file)
@@ -35,7 +35,7 @@ public final class ReadTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof ReadActorMessage) {
             readAdapter.handle(message, sender(), self());
         } else {
index eddb34bc5ab07ad4db0ca5f559f7ec23322085c1..0220b62642b31ef7ce7457ce083055852a40faed 100644 (file)
@@ -49,7 +49,7 @@ public final class ReadWriteTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof ReadActorMessage) {
             readAdapter.handle(message, sender(), self());
         } else if (message instanceof WriteActorMessage) {
index c8ab4237a74aa737a3020944716ea8c9cde7bc08..2a5c7ada48ecdd9a5cb4a62172786331ffe6d3cb 100644 (file)
@@ -50,7 +50,7 @@ public final class WriteTransactionActor extends UntypedAbstractActor {
     }
 
     @Override
-    public void onReceive(final Object message) throws Throwable {
+    public void onReceive(final Object message) {
         if (message instanceof WriteActorMessage) {
             writeAdapter.handle(message, sender(), context(), self());
         } else if (message instanceof ReceiveTimeout) {
index 06578783beb4673d5471edeb1e97b07b7aa649d7..53d7e6b7e525eb8ab5044afdd6fed20b2a8bbd7d 100644 (file)
@@ -37,7 +37,7 @@ public class NetconfConnectorDTO implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         if (communicator != null) {
             communicator.close();
         }
index c9ed78508f50b43a0d7a98fec397fb8e176635bc..62690ea6253e99ff923f75d97b20550be20aa886 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.topology.singleton.messages;
 
 import java.io.Externalizable;
-import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
@@ -43,12 +42,12 @@ public class NormalizedNodeMessage implements Externalizable {
     }
 
     @Override
-    public void writeExternal(final ObjectOutput out) throws IOException {
+    public void writeExternal(final ObjectOutput out) {
         SerializationUtils.serializePathAndNode(getIdentifier(), node, out);
     }
 
     @Override
-    public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(final ObjectInput in) {
         SerializationUtils.deserializePathAndNode(in, this, APPLIER);
     }
 
index 33c0b70525344aca04b7abd719d712314d74f35c..721817e809085435ab67da54f7b1a693f87b9e5d 100644 (file)
@@ -398,7 +398,7 @@ public class NetconfNodeManagerTest {
 
         @SuppressWarnings({ "rawtypes", "unchecked" })
         @Override
-        public void handleReceive(Object message) throws Exception {
+        public void handleReceive(Object message) {
             CompletableFuture dropFuture = messagesToDrop.remove(message.getClass());
             if (dropFuture != null) {
                 dropFuture.complete(message);
index 86f08cd5323a461a83e5111081869e43b0de2382..98c45544e2d2f070bf570ba4c89b42186acae548 100644 (file)
@@ -62,7 +62,7 @@ public class NetconfTopologyImpl extends AbstractNetconfTopology
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         // close all existing connectors, delete whole topology in datastore?
         for (final NetconfConnectorDTO connectorDTO : activeConnectors.values()) {
             connectorDTO.close();
index a3f37d6c92e7cde366e881cf8476ea73fb26d4f7..6e16741be273b17cec739ce38d38c4cf2c024fa9 100644 (file)
@@ -66,8 +66,7 @@ public final class NetconfMessageUtil {
         }
     }
 
-    public static Collection<String> extractCapabilitiesFromHello(final Document doc)
-            throws NetconfDocumentedException {
+    public static Collection<String> extractCapabilitiesFromHello(final Document doc) {
         XmlElement responseElement = XmlElement.fromDomDocument(doc);
         // Extract child element <capabilities> from <hello> with or without(fallback) the same namespace
         Optional<XmlElement> capabilitiesElement = responseElement
index 9c4df2b9b1eeedf91a9af2c49aba6c84ee1b70b8..f89d2848ef3cae6f52d11a19b1ce5e2b4738b496 100644 (file)
@@ -100,7 +100,7 @@ public final class SendErrorExceptionUtil {
         }
 
         @Override
-        public void operationComplete(final ChannelFuture channelFuture) throws Exception {
+        public void operationComplete(final ChannelFuture channelFuture) {
             Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception %s", sendErrorException,
                     channelFuture.cause());
         }
index c9ccf93fcbcf54385d1f99179218da152c55636e..fc100b3db80a2ec232db0ad3e15ceb8fdb0f7e42 100644 (file)
@@ -353,7 +353,7 @@ public class NetconfDevice
         }
 
         @Override
-        public DeviceSources call() throws Exception {
+        public DeviceSources call() {
             final NetconfDeviceSchemas availableSchemas =
                     stateSchemasResolver.resolve(deviceRpc, remoteSessionCapabilities, id);
             LOG.debug("{}: Schemas exposed by ietf-netconf-monitoring: {}", id,
index f4b44d9bc453b6742d2a41446e0be3350ea8bb23..b24eb89c9927bcc3da6d7dcd1b8bcc4405de9e75 100644 (file)
@@ -91,7 +91,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         mountInstance.close();
         if (topologyDatastoreAdapter != null) {
             topologyDatastoreAdapter.close();
@@ -154,7 +154,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
         }
 
         @Override
-        public synchronized void close() throws Exception {
+        public synchronized void close() {
             onTopologyDeviceDisconnected();
         }
 
index 0ba6cead958387ab434fd5bd40cbfc03b2cd1411..8cfc267ecd9e0c73ecf65beceecdd1f5c1bae93b 100644 (file)
@@ -19,7 +19,6 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.io.ByteArrayInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nonnull;
@@ -188,7 +187,7 @@ public final class NetconfRemoteSchemaYangSourceProvider implements SchemaSource
         }
 
         @Override
-        public InputStream openStream() throws IOException {
+        public InputStream openStream() {
             return new ByteArrayInputStream(schemaString.get().getBytes(StandardCharsets.UTF_8));
         }
     }
index d4e6683278d10178e5613fe1a81edc273a6c0b1e..9544559d0dbabc4e0d875437b96a03943cb6b9c5 100644 (file)
@@ -137,7 +137,7 @@ public class Execution implements Callable<Void> {
                 }
 
                 @Override
-                public Response onCompleted(Response response) throws Exception {
+                public Response onCompleted(Response response) {
                     semaphore.release();
                     return response;
                 }
@@ -155,7 +155,7 @@ public class Execution implements Callable<Void> {
     }
 
     @Override
-    public Void call() throws Exception {
+    public Void call() {
         if (invokeAsync) {
             this.invokeAsync();
         } else {
index c19cc5574575f48298f8e7cb6bbde2150f16d361..dea8fa819913cdb77b9ea2be0be32b4f99eeebee 100644 (file)
@@ -268,7 +268,7 @@ public class NetconfDeviceSimulator implements Closeable {
     }
 
     private SshProxyServerConfiguration getSshConfiguration(final InetSocketAddress bindingAddress,
-            final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) throws IOException {
+            final LocalAddress tcpLocalAddress, final KeyPairProvider keyPairProvider) {
         return new SshProxyServerConfigurationBuilder()
                 .setBindingAddress(bindingAddress)
                 .setLocalAddress(tcpLocalAddress)
@@ -370,7 +370,7 @@ public class NetconfDeviceSimulator implements Closeable {
             }
 
             @Override
-            public InputStream openStream() throws IOException {
+            public InputStream openStream() {
                 return getClass().getResourceAsStream(resource);
             }
         }), PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class,
index 3f275681aae80eac644e285b975ac5e383b9d952..f67c96e2f4399de2c4fffaccd43b76a1f5d9f849 100644 (file)
@@ -259,7 +259,7 @@ public final class ScaleUtil {
 
     private static class TimeoutGuard implements Callable<Void> {
         @Override
-        public Void call() throws Exception {
+        public Void call() {
             resultsLog.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH);
             root.warn("Timeout for scale test reached after: {} ..aborting", STOPWATCH);
             System.exit(0);
@@ -286,7 +286,7 @@ public final class ScaleUtil {
             }
 
             @Override
-            public T call() throws Exception {
+            public T call() {
                 try {
                     return theCallable.call();
                 } catch (Exception e) {
index 98d38dd475e46d4cafe5f426e301c94d73fe9b82..ecbb6de768f0b2dfe9ceff8b358231219e846ff9 100644 (file)
@@ -58,7 +58,7 @@ public class AsyncExecutionStrategy implements ExecutionStrategy {
                 }
 
                 @Override
-                public Response onCompleted(Response response) throws Exception {
+                public Response onCompleted(Response response) {
                     semaphore.release();
                     return response;
                 }
index 787aa7f4bac7630a56f18007c950326655a11026..59ff9260c9a8ae658e20f3f4b3f8c5a186f24093 100644 (file)
@@ -63,7 +63,7 @@ public class PerfClientCallable implements Callable<Void> {
     }
 
     @Override
-    public Void call() throws Exception {
+    public Void call() {
         executionStrategy.invoke();
         asyncHttpClient.closeAsynchronously();
         return null;
index 94eff3d25d8e64de4c06bf335651d7622df11ddd..55580f6bed01261615629ac42a3edb3cfae716e6 100644 (file)
@@ -69,7 +69,7 @@ public final class RestPerfClient {
 
     }
 
-    public static void main(String[] args) throws IOException {
+    public static void main(String[] args) {
 
         Parameters parameters = parseArgs(args, Parameters.getParser());
         parameters.validate();
index c2868795c95ec66cae7a68023388282ecb932e3f..9a29a1ec9dde73527163f637ce412bbfd3742c95 100644 (file)
@@ -59,7 +59,7 @@ public class StressClientCallable implements Callable<Boolean> {
     }
 
     @Override
-    public Boolean call() throws Exception {
+    public Boolean call() {
         executionStrategy.invoke();
         netconfClientSession.close();
         return Boolean.TRUE;
index d806f768df47172845b67954a18759f92a8822b1..ed43703e3ec413c6e961162e9ec076bcd336768a 100644 (file)
@@ -33,7 +33,7 @@ class SettableRpc implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
+    public HandlingPriority canHandle(final Document message) {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000);
     }
 
index ad647f667fc5038df0a3298212dad1658f710ac6..c985f45f9f93bc74d7900a4161e245dce416f9ae 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedCommit extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index eab9f2c8206a56daf7090394f56f0f1cc938a5fb..8a42baa7a29e6d263ffcc6c15416ff7f93642333 100644 (file)
@@ -25,7 +25,6 @@ import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlRootElement;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
@@ -90,8 +89,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         long delayAggregator = 0;
 
         for (final Map.Entry<Notification, NetconfMessage> notification : notifications.entrySet()) {
index ef5d06beb232a5643e145a773a236f79b0ab99e9..fe54d84f9fae69acc422a09235de5cffab93c0f2 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedDiscardChanges extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index 83897d0c98b81d1c50626039d5f2a62ce8f5669a..e5b197d3c37f4bf4aa51b29efc7d83de48dbda1c 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -27,8 +26,7 @@ public class SimulatedGet extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
 
         for (final XmlElement e : storage.getConfigList()) {
index 572fd961b742b1e9b90228651821aa749c37d05a..4c2a8592a9946111412974fc325b484fc2a7f31d 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.base.Optional;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -60,8 +59,7 @@ public class SimulatedGetConfig extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
 
         for (final XmlElement e : storage.getConfigList()) {
index c7d4e0c13aa16bf31db82d89c119218287ca92b2..1dfbd1f4287e7f77bb1ddb591c916d0c4a39500a 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedLock extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index 6002bea60ac6ef4b30000939a03c2b092a2c0739..bfd0026c37bc42debe4debd7cea6c28382bbc181 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.test.tool.rpc;
 
 import com.google.common.base.Optional;
-import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.xml.XmlElement;
 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.netconf.api.xml.XmlUtil;
@@ -24,8 +23,7 @@ public class SimulatedUnLock extends AbstractLastNetconfOperation {
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
-            throws DocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
index a3e449f05a1d971515d59e2a296f4f706a205c84..a6e0f07773dbadc6a6810fcec128903ab8ae9cd6 100644 (file)
@@ -32,7 +32,7 @@ class SettableRpc implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
+    public HandlingPriority canHandle(final Document message) {
         return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1000);
     }
 
index 51f80848bd2a86463cf333f7eb0e62f12ef1acfa..9ac7b647c0b22412c507331bb752145094809819 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -102,7 +101,7 @@ public final class SchemaSourceCache<T extends SchemaSourceRepresentation>
             }
 
             @Override
-            public InputStream openStream() throws IOException {
+            public InputStream openStream() {
                 return TestToolUtils.getDataAsStream(cachedSource);
             }
         };
index 494ccf8ec4cb5d305dad89d9cf54ed41ab3f3263..2ee8419f8f223f2de26baf1d806f78fee87557cd 100644 (file)
@@ -89,7 +89,7 @@ final class ProtocolSessionPromise<S extends ProtocolSession<?>> extends Default
         }
 
         @Override
-        public void operationComplete(final ChannelFuture cf) throws Exception {
+        public void operationComplete(final ChannelFuture cf) {
             synchronized (lock) {
 
                 LOG.debug("Promise {} connection resolved", lock);
index 87313f4e4cfb1140bc8f2c59e63dc39bddb06bcf..a0728514ed1a4a568938e7595903b808f5185917 100644 (file)
@@ -91,7 +91,7 @@ final class ReconnectPromise<S extends ProtocolSession<?>, L extends SessionList
         }
 
         @Override
-        public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
+        public void channelInactive(final ChannelHandlerContext ctx) {
             // This is the ultimate channel inactive handler, not forwarding
             if (promise.isCancelled()) {
                 return;
index e45ed6e793a00e6a0c64e62d9e2aaf5b742a0dee..707e397a4c1cf40095b3908ca5a426d72f0f68d8 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.md.sal.rest.schema;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -40,8 +39,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<Schem
     @Override
     public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws
+        WebApplicationException {
         try {
             YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream);
         } catch (final XMLStreamException e) {
index f90997354b2ab0305313ac8975e6207bd95c3b6a..85078714834113e203c0f9afa81edecd44ec161a 100644 (file)
@@ -75,8 +75,8 @@ public class JsonNormalizedNodeBodyReader
     @Override
     public NormalizedNodeContext readFrom(final Class<NormalizedNodeContext> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws
+        WebApplicationException {
         try {
             return readFrom(getInstanceIdentifierContext(), entityStream, isPost());
         } catch (final Exception e) {
index 53cc16f8d35053e7d06f95147c9c2741233291e4..852e3033492266baf46874f80fd351d5692b7df6 100644 (file)
@@ -83,7 +83,7 @@ public class JsonToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider
     public PatchContext readFrom(final Class<PatchContext> type, final Type genericType,
                                  final Annotation[] annotations, final MediaType mediaType,
                                  final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(getInstanceIdentifierContext(), entityStream);
         } catch (final Exception e) {
index c1ca200d13dc59ea80548004b5da2fdd56b0f995..13ceb2e63ca2e95f2a4813dc00a7c52dbb567cce 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.netconf.sal.rest.impl;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     public void writeTo(final PatchStatusContext patchStatusContext, final Class<?> type, final Type genericType,
                         final Annotation[] annotations, final MediaType mediaType,
                         final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final XMLStreamWriter xmlWriter =
@@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context)
-            throws XMLStreamException, IOException {
+            throws XMLStreamException {
         writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch");
         writer.writeStartElement("patch-id");
         writer.writeCharacters(context.getPatchId());
@@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void reportErrors(final List<RestconfError> errors, final XMLStreamWriter writer)
-            throws IOException, XMLStreamException {
+            throws XMLStreamException {
         writer.writeStartElement("errors");
 
         for (final RestconfError restconfError : errors) {
index 510a6cf3440a32096246e461990f56f1d74f75f0..59b7a0f4820bd2ff62b00f13a73bee97fafee25a 100644 (file)
@@ -86,8 +86,8 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro
     @Override
     public NormalizedNodeContext readFrom(final Class<NormalizedNodeContext> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws
+        WebApplicationException {
         try {
             return readFrom(entityStream);
         } catch (final RestconfDocumentedException e) {
index 071f8bda595a32125eea3606c8e04db1376f7af3..4f88e14d5c28d1b43a15fc6a0aab677fbf676e8c 100644 (file)
@@ -95,7 +95,7 @@ public class XmlToPatchBodyReader extends AbstractIdentifierAwareJaxRsProvider i
     public PatchContext readFrom(final Class<PatchContext> type, final Type genericType,
                                  final Annotation[] annotations, final MediaType mediaType,
                                  final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final InstanceIdentifierContext<?> path = getInstanceIdentifierContext();
index 55ea16db73f3364fc73047cdff92b4c12d3006a7..877deda59f31cdb1363858a9b116412b55728c7b 100644 (file)
@@ -50,7 +50,7 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B
     }
 
     @Override
-    public final void close() throws Exception {
+    public final void close() {
         this.registration.close();
         this.registration = null;
         unregister();
index a11d7bf803ba2829c0e8a43c649658e031d3cdc3..aa56910523bcf44e74e531838e3df95ae3c3e6f9 100755 (executable)
@@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
 import io.netty.util.CharsetUtil;
-import java.io.IOException;
 import java.util.List;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
 import org.opendaylight.netconf.sal.streams.listeners.ListenerAdapter;
@@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     private WebSocketServerHandshaker handshaker;
 
     @Override
-    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) {
         if (msg instanceof FullHttpRequest) {
             handleHttpRequest(ctx, (FullHttpRequest) msg);
         } else if (msg instanceof WebSocketFrame) {
@@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param req
      *            FullHttpRequest
      */
-    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception {
+    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) {
         // Handle a bad request.
         if (!req.getDecoderResult().isSuccess()) {
             sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));
@@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param frame
      *            {@link WebSocketFrame}
      */
-    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException {
+    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) {
         if (frame instanceof CloseWebSocketFrame) {
             this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
             final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText());
@@ -182,7 +181,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         ctx.close();
     }
 
index c13535bf1946a16f0a7a084fca3c1e32668c38f8..365e982c49113908ec249951a04a92e554a6414b 100644 (file)
@@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec;
 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
 
     @Override
-    protected void initChannel(final SocketChannel ch) throws Exception {
+    protected void initChannel(final SocketChannel ch) {
         ChannelPipeline pipeline = ch.pipeline();
         pipeline.addLast("codec-http", new HttpServerCodec());
         pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
index b6289b400976515319ecc04679cb542beec39da6..8c021273645b195caa0e9e588a80c09071aec0eb 100644 (file)
@@ -15,7 +15,6 @@ import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
 import javax.ws.rs.WebApplicationException;
@@ -280,7 +279,7 @@ public class JsonToNnTest extends AbstractBodyReaderTest {
         try {
             normalizedNodeContext = this.jsonBodyReader.readFrom(null, null, null,
                     this.mediaType, null, inputStream);
-        } catch (WebApplicationException | IOException e) {
+        } catch (WebApplicationException e) {
             // TODO Auto-generated catch block
         }
 
index 37a39b62d9c3874d5e0be9ae8eb498152dc0521b..a8c79f356015f1fdd61a149153d69cac77f9f82b 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.restconf.nb.rfc8040.jersey.providers;
 
 import com.google.common.collect.Iterables;
 import com.google.gson.stream.JsonReader;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
@@ -62,7 +61,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected NormalizedNodeContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(path, entityStream, isPost());
         } catch (final Exception e) {
@@ -72,8 +71,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyRead
     }
 
     public static NormalizedNodeContext readFrom(
-            final InstanceIdentifierContext<?> path, final InputStream entityStream, final boolean isPost)
-            throws IOException {
+            final InstanceIdentifierContext<?> path, final InputStream entityStream, final boolean isPost) {
         final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
         final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
 
index 62fd33a51f1f7deba2bec1373fb3d92b83898b38..debebb9d311c92e1de70cef57448a7e5f0a27203 100644 (file)
@@ -73,7 +73,7 @@ public class XmlNormalizedNodeBodyReader extends AbstractNormalizedNodeBodyReade
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected NormalizedNodeContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream);
             return parse(path,doc);
index 232a9a7c03ff4b5eeac6a67f2c3c8189395bab23..2b39c8a0d5c0bfdf4604f1a347544cd21c43d927 100644 (file)
@@ -66,7 +66,7 @@ public class JsonToPatchBodyReader extends AbstractToPatchBodyReader {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected PatchContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             return readFrom(path, entityStream);
         } catch (final Exception e) {
index e80dd14a16e84f98e7dc7bd07fe8563f1ea57b19..d7d264fdab92d6fd6cb789264f8f3bfb43b8d2e9 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -57,7 +56,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     public void writeTo(final PatchStatusContext patchStatusContext, final Class<?> type, final Type genericType,
                         final Annotation[] annotations, final MediaType mediaType,
                         final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
 
         try {
             final XMLStreamWriter xmlWriter =
@@ -71,7 +70,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void writeDocument(final XMLStreamWriter writer, final PatchStatusContext context)
-            throws XMLStreamException, IOException {
+            throws XMLStreamException {
         writer.writeStartElement("", "yang-patch-status", "urn:ietf:params:xml:ns:yang:ietf-yang-patch");
         writer.writeStartElement("patch-id");
         writer.writeCharacters(context.getPatchId());
@@ -107,7 +106,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
     }
 
     private static void reportErrors(final List<RestconfError> errors, final XMLStreamWriter writer)
-            throws IOException, XMLStreamException {
+            throws XMLStreamException {
         writer.writeStartElement("errors");
 
         for (final RestconfError restconfError : errors) {
index 8364572de4874a2e2b8ca807e07375e9805eab32..bf452ec49f01f2a4781e7ccf0a40f44650bf6cc5 100644 (file)
@@ -76,7 +76,7 @@ public class XmlToPatchBodyReader extends AbstractToPatchBodyReader {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected PatchContext readBody(final InstanceIdentifierContext<?> path, final InputStream entityStream)
-            throws IOException, WebApplicationException {
+            throws WebApplicationException {
         try {
             final Document doc = UntrustedXML.newDocumentBuilder().parse(entityStream);
             return parse(path, doc);
index 0cd7e327b0147e430e35856e0aa763d6c41bd29d..baae974370ffaafa8cac9b71105b83562854b11c 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema;
 
-import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
@@ -42,8 +41,8 @@ public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<Schem
     @Override
     public void writeTo(final SchemaExportContext context, final Class<?> type, final Type genericType,
             final Annotation[] annotations, final MediaType mediaType,
-            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
-            WebApplicationException {
+            final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws
+        WebApplicationException {
         try {
             YinExportUtils.writeModuleAsYinText(context.getModule(), entityStream);
         } catch (final XMLStreamException e) {
index f516e5f1d45f2882e0f599a6d6f0bfe3bc453d0a..c77fa97ae21dc101a2c6ce060072fe483c02bb46 100644 (file)
@@ -81,7 +81,7 @@ public abstract class AbstractIdentifierAwareJaxRsProvider<T> implements Message
     protected abstract T emptyBody(InstanceIdentifierContext<?> path);
 
     protected abstract T readBody(InstanceIdentifierContext<?> path, InputStream entityStream)
-            throws IOException, WebApplicationException;
+            throws WebApplicationException;
 
 
     private String getIdentifier() {
index 5efca62de73e4feba25732a261c68a3751e57ae6..3e31ea6d5f498af9c884f5fa5b2fd1b4facf56e6 100644 (file)
@@ -225,12 +225,7 @@ public class JSONRestconfServiceRfc8040Impl implements JSONRestconfService, Auto
         }
 
         final InputStream entityStream = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8));
-        try {
-            return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost);
-        } catch (final IOException e) {
-            propagateExceptionAs(uriPath, e, "GET");
-            return null;
-        }
+        return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost);
     }
 
     private  String toJson(final PatchStatusContext patchStatusContext) throws IOException {
index fce83008d5aded16545e797a0f114a845a7d2f2d..55aacdaee809052c9a91119dac63fe233509f817 100755 (executable)
@@ -34,7 +34,6 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
 import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
 import io.netty.util.CharsetUtil;
-import java.io.IOException;
 import java.util.List;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenerAdapter;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationListenerAdapter;
@@ -54,7 +53,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     private WebSocketServerHandshaker handshaker;
 
     @Override
-    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) throws Exception {
+    protected void channelRead0(final ChannelHandlerContext ctx, final Object msg) {
         if (msg instanceof FullHttpRequest) {
             handleHttpRequest(ctx, (FullHttpRequest) msg);
         } else if (msg instanceof WebSocketFrame) {
@@ -70,7 +69,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param req
      *            FullHttpRequest
      */
-    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception {
+    private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) {
         // Handle a bad request.
         if (!req.getDecoderResult().isSuccess()) {
             sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));
@@ -154,7 +153,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
      * @param frame
      *            {@link WebSocketFrame}
      */
-    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) throws IOException {
+    private void handleWebSocketFrame(final ChannelHandlerContext ctx, final WebSocketFrame frame) {
         if (frame instanceof CloseWebSocketFrame) {
             this.handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
             final String streamName = Notificator.createStreamNameFromUri(((CloseWebSocketFrame) frame).reasonText());
@@ -181,7 +180,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
     }
 
     @Override
-    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
+    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
         ctx.close();
     }
 
index 2c768d83a56915e371ba685aa0bae4265eb7d23c..5ab8639b2164f4b6a2656bb55a7642a5156b5bd0 100644 (file)
@@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpServerCodec;
 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
 
     @Override
-    protected void initChannel(final SocketChannel ch) throws Exception {
+    protected void initChannel(final SocketChannel ch) {
         ChannelPipeline pipeline = ch.pipeline();
         pipeline.addLast("codec-http", new HttpServerCodec());
         pipeline.addLast("aggregator", new HttpObjectAggregator(65536));