Added unit tests for the event abstractions.
Added Element as the notion of common ancestry between Device and Host.
diff --git a/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java b/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
index 4048fbb..ac2f4a4 100644
--- a/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
+++ b/net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
@@ -3,6 +3,10 @@
import org.onlab.onos.net.Device;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.MastershipRole;
+import org.onlab.onos.net.Port;
+import org.onlab.onos.net.PortNumber;
+
+import java.util.List;
/**
* Service for interacting with the inventory of infrastructure devices.
@@ -34,7 +38,21 @@
Device getDevice(DeviceId deviceId);
-// List<Port> getPorts(DeviceId deviceId);
+ /**
+ * Returns the list of ports associated with the device.
+ *
+ * @param deviceId device identifier
+ * @return list of ports
+ */
+ List<Port> getPorts(DeviceId deviceId);
+
+ /**
+ * Returns the port with the specified number and hosted by the given device.
+ * @param deviceId device identifier
+ * @param portNumber port number
+ * @return device port
+ */
+ Port getPort(DeviceId deviceId, PortNumber portNumber);
/**
* Adds the specified device listener.
@@ -49,4 +67,5 @@
* @param listener device listener
*/
void removeListener(DeviceListener listener);
+
}