Change-Id: I26d48930a16213d2264de964f60103e67f80b9bd
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
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(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);
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;
}
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() {
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")
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)
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 {