Renamed the intent package
net.onrc.onos.intent.* => net.onrc.onos.core.intent.*
Change-Id: Id61f79ed52acf3b91af4ebad2515ac5b7d6dc5e1
diff --git a/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java b/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java
new file mode 100644
index 0000000..9a39627
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java
@@ -0,0 +1,75 @@
+package net.onrc.onos.core.intent;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.util.Dpid;
+
+/**
+ * @author Toshio Koide (t-koide@onlab.us)
+ */
+public class ShortestPathIntent extends Intent {
+ protected long srcSwitchDpid;
+ protected long srcPortNumber;
+ protected long srcMacAddress;
+ protected long dstSwitchDpid;
+ protected long dstPortNumber;
+ protected long dstMacAddress;
+ protected String pathIntentId = null;
+
+ /**
+ * Default constructor for Kryo deserialization
+ */
+ protected ShortestPathIntent() {
+ }
+
+ public ShortestPathIntent(String id,
+ long srcSwitch, long srcPort, long srcMac,
+ long dstSwitch, long dstPort, long dstMac) {
+ super(id);
+ srcSwitchDpid = srcSwitch;
+ srcPortNumber = srcPort;
+ srcMacAddress = srcMac;
+ dstSwitchDpid = dstSwitch;
+ dstPortNumber = dstPort;
+ dstMacAddress = dstMac;
+ }
+
+ public long getSrcSwitchDpid() {
+ return srcSwitchDpid;
+ }
+
+ public long getSrcPortNumber() {
+ return srcPortNumber;
+ }
+
+ public long getSrcMac() {
+ return srcMacAddress;
+ }
+
+ public long getDstSwitchDpid() {
+ return dstSwitchDpid;
+ }
+
+ public long getDstPortNumber() {
+ return dstPortNumber;
+ }
+
+ public long getDstMac() {
+ return dstMacAddress;
+ }
+
+ public void setPathIntent(PathIntent pathIntent) {
+ pathIntentId = pathIntent.getId();
+ }
+
+ public String getPathIntentId() {
+ return pathIntentId;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("id:%s, state:%s, srcDpid:%s, srcPort:%d, srcMac:%s, dstDpid:%s, dstPort:%d, dstMac:%s",
+ getId(), getState(),
+ new Dpid(srcSwitchDpid), srcPortNumber, MACAddress.valueOf(srcMacAddress),
+ new Dpid(dstSwitchDpid), dstPortNumber, MACAddress.valueOf(dstMacAddress));
+ }
+}