Remove deprecated constructors from RemoteDeviceId
[controller.git] / opendaylight / md-sal / sal-netconf-connector / src / main / java / org / opendaylight / controller / sal / connect / util / RemoteDeviceId.java
index a280da9228845ae55ee43b271b7e7dc9743ed325..6ccc954716788419036ed49a37a597c25234d347 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);
@@ -77,7 +65,7 @@ public final class RemoteDeviceId {
     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();
     }
@@ -105,9 +93,7 @@ public final class RemoteDeviceId {
     }
 
     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() {