Remove deprecated constructors from RemoteDeviceId 99/24099/5
authorMaros Marsalek <mmarsale@cisco.com>
Tue, 14 Jul 2015 12:26:15 +0000 (14:26 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 22 Jul 2015 08:42:00 +0000 (08:42 +0000)
Change-Id: I26d48930a16213d2264de964f60103e67f80b9bd
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/RemoteDeviceId.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTest.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/listener/NetconfDeviceCommunicatorTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java

index d1c107c..6ccc954 100644 (file)
@@ -37,26 +37,14 @@ public final class RemoteDeviceId {
     private InetSocketAddress address;
     private Host host;
 
-    @Deprecated
-    public RemoteDeviceId(final ModuleIdentifier identifier) {
-        this(Preconditions.checkNotNull(identifier).getInstanceName());
-    }
-
-    public RemoteDeviceId(final ModuleIdentifier identifier, Host host) {
-        this(identifier);
-        this.host = host;
-    }
-
     public RemoteDeviceId(final ModuleIdentifier identifier, InetSocketAddress address) {
-        this(identifier);
+        this(Preconditions.checkNotNull(identifier).getInstanceName());
         this.address = address;
         this.host = buildHost();
     }
 
-    @Deprecated
-    public RemoteDeviceId(final String name) {
-        Preconditions.checkNotNull(name);
-        this.name = name;
+    private RemoteDeviceId(final String name) {
+        this.name = Preconditions.checkNotNull(name);
         this.key = new NodeKey(new NodeId(name));
         this.path = createBIPath(name);
         this.bindingPath = createBindingPath(key);
index 34972df..6fa109c 100644 (file)
@@ -24,6 +24,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.Futures;
 import java.io.InputStream;
+import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -271,7 +272,7 @@ public class NetconfDeviceTest {
     }
 
     public RemoteDeviceId getId() {
-        return new RemoteDeviceId("test-D");
+        return new RemoteDeviceId("test-D", InetSocketAddress.createUnresolved("localhost", 22));
     }
 
     public ExecutorService getExecutor() {
index 0ff5e2d..1fe6885 100644 (file)
@@ -85,7 +85,7 @@ public class NetconfDeviceCommunicatorTest {
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks( this );
 
-        communicator = new NetconfDeviceCommunicator( new RemoteDeviceId( "test" ), mockDevice);
+        communicator = new NetconfDeviceCommunicator( new RemoteDeviceId( "test", InetSocketAddress.createUnresolved("localhost", 22)), mockDevice);
     }
 
     @SuppressWarnings("unchecked")
@@ -383,7 +383,7 @@ public class NetconfDeviceCommunicatorTest {
         final EventLoopGroup group = new NioEventLoopGroup();
         final Timer time = new HashedWheelTimer();
         try {
-            final NetconfDeviceCommunicator listener = new NetconfDeviceCommunicator(new RemoteDeviceId("test"), device);
+            final NetconfDeviceCommunicator listener = new NetconfDeviceCommunicator(new RemoteDeviceId("test", InetSocketAddress.createUnresolved("localhost", 22)), device);
             final NetconfReconnectingClientConfiguration cfg = NetconfReconnectingClientConfigurationBuilder.create()
                     .withAddress(new InetSocketAddress("localhost", 65000))
                     .withReconnectStrategy(reconnectStrategy)
index 029aeff..f15c41a 100644 (file)
@@ -201,7 +201,7 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest {
         RemoteDevice<NetconfSessionPreferences, NetconfMessage, NetconfDeviceCommunicator> mockedRemoteDevice = mock(RemoteDevice.class);
         doNothing().when(mockedRemoteDevice).onRemoteSessionUp(any(NetconfSessionPreferences.class), any(NetconfDeviceCommunicator.class));
         doNothing().when(mockedRemoteDevice).onRemoteSessionDown();
-        return new NetconfDeviceCommunicator(new RemoteDeviceId("secure-test"), mockedRemoteDevice);
+        return new NetconfDeviceCommunicator(new RemoteDeviceId("secure-test", InetSocketAddress.createUnresolved("localhost", 22)), mockedRemoteDevice);
     }
 
     public AuthProvider getAuthProvider() throws Exception {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.