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/ForwardAction.java b/src/main/java/net/onrc/onos/core/intent/ForwardAction.java
new file mode 100644
index 0000000..2294d65
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/intent/ForwardAction.java
@@ -0,0 +1,40 @@
+package net.onrc.onos.core.intent;
+
+import net.onrc.onos.ofcontroller.util.FlowEntryAction;
+
+/**
+ *
+ * @author Brian O'Connor <bocon@onlab.us>
+ *
+ */
+
+class ForwardAction extends Action {
+ protected long dstPort;
+
+ public ForwardAction(long dstPort) {
+ this.dstPort = dstPort;
+ }
+
+ public String toString() {
+ return Long.toString(dstPort);
+ }
+
+ @Override
+ public FlowEntryAction getFlowEntryAction() {
+ FlowEntryAction action = new FlowEntryAction();
+ action.setActionOutput(new net.onrc.onos.ofcontroller.util.Port((short) dstPort));
+ return action;
+ }
+
+ public int hashCode() {
+ return (int) dstPort;
+ }
+
+ public boolean equals(Object o) {
+ if(!(o instanceof ForwardAction)) {
+ return false;
+ }
+ ForwardAction action = (ForwardAction) o;
+ return this.dstPort == action.dstPort;
+ }
+}