Add Intent class and its extended classes
- Intent class is an abstract class for the intents
- ShortestPathIntent class extends Intent class that expresses shortest hop between source-destination pair
- ConstrainedShortestPathIntent class extends ShortestPathIntent class that expresses bandwidth as an additional intention to ShortestPathIntent
- PathIntent class extends Intent class that expresses path
Change-Id: Ia5e8ddb55b333841d9eb438f9eb28866f6e3e300
diff --git a/src/main/java/net/onrc/onos/intent/ConstrainedShortestPathIntent.java b/src/main/java/net/onrc/onos/intent/ConstrainedShortestPathIntent.java
new file mode 100644
index 0000000..c5db590
--- /dev/null
+++ b/src/main/java/net/onrc/onos/intent/ConstrainedShortestPathIntent.java
@@ -0,0 +1,32 @@
+package net.onrc.onos.intent;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.networkgraph.NetworkGraph;
+import net.onrc.onos.ofcontroller.networkgraph.Port;
+
+/**
+ * @author Toshio Koide (t-koide@onlab.us)
+ */
+public class ConstrainedShortestPathIntent extends ShortestPathIntent {
+ protected Double bandwidth;
+
+ public ConstrainedShortestPathIntent(
+ Port srcPort, MACAddress srcMac,
+ Port dstPort, MACAddress dstMac,
+ Double bandwidth) {
+ super(srcPort, srcMac, dstPort, dstMac);
+ this.bandwidth = bandwidth;
+ }
+
+ public ConstrainedShortestPathIntent(NetworkGraph graph,
+ Long srcSwitch, Long srcPort, long srcMac,
+ Long dstSwitch, Long dstPort, long dstMac,
+ Double bandwidth) {
+ super(graph, srcSwitch, srcPort, srcMac, dstSwitch, dstPort, dstMac);
+ this.bandwidth = bandwidth;
+ }
+
+ public Double getBandwidth() {
+ return bandwidth;
+ }
+}