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);
private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBIPath(final String name) {
final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder builder =
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder();
- builder.node(Nodes.QNAME).nodeWithKey(Node.QNAME, QName.create(Node.QNAME.getNamespace(), Node.QNAME.getRevision(), "id"), name);
+ builder.node(Nodes.QNAME).node(Node.QNAME).nodeWithKey(Node.QNAME, QName.create(Node.QNAME.getNamespace(), Node.QNAME.getRevision(), "id"), name);
return builder.build();
}
}
private Host buildHost() {
- return address.getAddress().getHostAddress() != null
- ? HostBuilder.getDefaultInstance(address.getAddress().getHostAddress())
- : HostBuilder.getDefaultInstance(address.getAddress().getHostName());
+ return HostBuilder.getDefaultInstance(address.getHostString());
}
public String getName() {