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 d1c107c3a4c0c5a353d040675ca0e5aab1eaf46f..6ccc954716788419036ed49a37a597c25234d347 100644 (file)
@@ -37,26 +37,14 @@ public final class RemoteDeviceId {
     private InetSocketAddress address;
     private Host host;
 
     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) {
     public RemoteDeviceId(final ModuleIdentifier identifier, InetSocketAddress address) {
-        this(identifier);
+        this(Preconditions.checkNotNull(identifier).getInstanceName());
         this.address = address;
         this.host = buildHost();
     }
 
         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);
         this.key = new NodeKey(new NodeId(name));
         this.path = createBIPath(name);
         this.bindingPath = createBindingPath(key);
index 34972dffe2d4f09493e8b3bf5bba08557a00c552..6fa109c9ae78b8bc19364b1521b5d59290207ac3 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 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;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -271,7 +272,7 @@ public class NetconfDeviceTest {
     }
 
     public RemoteDeviceId getId() {
     }
 
     public RemoteDeviceId getId() {
-        return new RemoteDeviceId("test-D");
+        return new RemoteDeviceId("test-D", InetSocketAddress.createUnresolved("localhost", 22));
     }
 
     public ExecutorService getExecutor() {
     }
 
     public ExecutorService getExecutor() {
index 0ff5e2d3d50014dcaf5ddc6184e9fda4a1ecb295..1fe6885f0cab31e63255153068f7b7e2da233dfd 100644 (file)
@@ -85,7 +85,7 @@ public class NetconfDeviceCommunicatorTest {
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks( this );
 
     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")
     }
 
     @SuppressWarnings("unchecked")
@@ -383,7 +383,7 @@ public class NetconfDeviceCommunicatorTest {
         final EventLoopGroup group = new NioEventLoopGroup();
         final Timer time = new HashedWheelTimer();
         try {
         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)
             final NetconfReconnectingClientConfiguration cfg = NetconfReconnectingClientConfigurationBuilder.create()
                     .withAddress(new InetSocketAddress("localhost", 65000))
                     .withReconnectStrategy(reconnectStrategy)
index 029aefff6e3016cfde27022de2cc9c4c6e76e449..f15c41a4540484bb66617d4d4aa96c433917e08e 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();
         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 {
     }
 
     public AuthProvider getAuthProvider() throws Exception {