Add GSON models for device registration 77/95177/9
authorIllia <illia.ihushev@pantheon.tech>
Mon, 15 Feb 2021 18:03:51 +0000 (20:03 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 11 May 2021 18:27:20 +0000 (18:27 +0000)
Intention is to use the PATCH method for node registration(no matter if
that's a single node registration or multiple nodes).

JIRA: NETCONF-758
Change-Id: Ia624cfe2f953f6f5dc7a4ebd0d7cfbb0c0185f1a
Signed-off-by: Illia <illia.ihushev@pantheon.tech>
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Node.java [new file with mode: 0644]
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Payload.java [new file with mode: 0644]
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Topology.java [new file with mode: 0644]

diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Node.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Node.java
new file mode 100644 (file)
index 0000000..76acc99
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.test.tool.model;
+
+public class Node {
+    private String nodeId;
+    private String host;
+    private Integer port;
+    private String username;
+    private String password;
+    private Boolean tcpOnly;
+    private Integer keepaliveDelay;
+    private Boolean schemaless;
+
+    public Node() {
+
+    }
+
+    public Node(final String nodeId, final String host, final Integer port, final String username,
+                final String password, final Boolean tcpOnly, final Integer keepaliveDelay, final Boolean schemaless) {
+        this.nodeId = nodeId;
+        this.host = host;
+        this.port = port;
+        this.username = username;
+        this.password = password;
+        this.tcpOnly = tcpOnly;
+        this.keepaliveDelay = keepaliveDelay;
+        this.schemaless = schemaless;
+    }
+
+    public String getNodeId() {
+        return nodeId;
+    }
+
+    public void setNodeId(final String nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(final String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(final String password) {
+        this.password = password;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(final String host) {
+        this.host = host;
+    }
+
+    public Integer getKeepaliveDelay() {
+        return keepaliveDelay;
+    }
+
+    public void setKeepaliveDelay(final Integer keepaliveDelay) {
+        this.keepaliveDelay = keepaliveDelay;
+    }
+
+    public Integer getPort() {
+        return port;
+    }
+
+    public void setPort(final Integer port) {
+        this.port = port;
+    }
+
+    public Boolean getSchemaless() {
+        return schemaless;
+    }
+
+    public void setSchemaless(final Boolean schemaless) {
+        this.schemaless = schemaless;
+    }
+
+    public Boolean getTcpOnly() {
+        return tcpOnly;
+    }
+
+    public void setTcpOnly(final Boolean tcpOnly) {
+        this.tcpOnly = tcpOnly;
+    }
+}
\ No newline at end of file
diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Payload.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Payload.java
new file mode 100644 (file)
index 0000000..2bcf7ad
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.test.tool.model;
+
+public class Payload {
+    private Topology topology;
+
+    public Payload() {
+
+    }
+
+    public Payload(final Topology topology) {
+        this.topology = topology;
+    }
+
+    public Topology getTopology() {
+        return topology;
+    }
+
+    public void setTopology(Topology topology) {
+        this.topology = topology;
+    }
+}
diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Topology.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/model/Topology.java
new file mode 100644 (file)
index 0000000..4fb1ee1
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.test.tool.model;
+
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Topology {
+    private String topologyId;
+
+    @SerializedName("node")
+    private List<Node> nodeList = new ArrayList<>();
+
+    public Topology() {
+
+    }
+
+    public Topology(final String topologyId) {
+        this.topologyId = topologyId;
+    }
+
+    public void addNode(final Node node) {
+        this.nodeList.add(node);
+    }
+
+    public String getTopologyId() {
+        return topologyId;
+    }
+
+    public void setTopologyId(String topologyId) {
+        this.topologyId = topologyId;
+    }
+
+    public List<Node> getNodeList() {
+        return nodeList;
+    }
+
+    public void setNodeList(List<Node> nodeList) {
+        this.nodeList = nodeList;
+    }
+}