Added Type and ID to support multi layer topology
Fixed checkstyle errors
removed ID . For now we decided to store it in map
Updated javadoc comments
Change-Id: Ieda7cf4054b2b69ed6d39333e9d5c4a1fa4b7601
diff --git a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java b/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
index 0ba23dd..19fe0a7 100644
--- a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
@@ -62,4 +62,15 @@
boolean removeAttachmentPoint(Port port) {
return this.attachmentPoints.remove(port);
}
+
+
+ /**
+ * Returns the type of topology object.
+ *
+ * @return the type of the topology object
+ */
+ @Override
+ public String getType() {
+ throw new UnsupportedOperationException("Not implemented yet");
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/LinkImpl.java b/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
index 4c7e1c5..d0276d1 100644
--- a/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/LinkImpl.java
@@ -96,4 +96,15 @@
getCapacity(),
getDstPort().toString());
}
+
+
+ /**
+ * Returns the type of topology object.
+ *
+ * @return the type of the topology object
+ */
+ @Override
+ public String getType() {
+ throw new UnsupportedOperationException("Not implemented yet");
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/PortImpl.java b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
index 792d9f1..9332764 100644
--- a/src/main/java/net/onrc/onos/core/topology/PortImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
@@ -114,4 +114,15 @@
getSwitch().getDpid(),
getNumber());
}
+
+
+ /**
+ * Returns the type of topology object.
+ *
+ * @return the type of the topology object
+ */
+ @Override
+ public String getType() {
+ throw new UnsupportedOperationException("Not implemented yet");
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
index ad13a79..9457cb5 100644
--- a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
@@ -140,4 +140,14 @@
public String toString() {
return dpid.toString();
}
+
+ /**
+ * Returns the type of topology object.
+ *
+ * @return the type of the topology object
+ */
+ @Override
+ public String getType() {
+ throw new UnsupportedOperationException("Not implemented yet");
+ }
}
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyObject.java b/src/main/java/net/onrc/onos/core/topology/TopologyObject.java
index 2dfd613..cdf51bd 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyObject.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyObject.java
@@ -1,10 +1,11 @@
package net.onrc.onos.core.topology;
+
/**
* Base class for Topology Objects.
*/
-public class TopologyObject {
+public abstract class TopologyObject {
/**
* Topology instance this object belongs to.
@@ -20,4 +21,13 @@
this.topology = topology;
}
+
+ /**
+ * Returns the type of topology object.
+ *
+ * @return the type of the topology object
+ */
+ public abstract String getType();
+
+
}