summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-23 08:31:31 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-23 08:31:31 -0700
commite52e67767076b29cb01939aa7bdd8fee9d205cc1 (patch)
treeb8c2d28231bccc2a280fea429a9af7297c62f58f /framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
parenta912c5ce9968da5936a695064f22083898e7b93d (diff)
Update ONOS src to commit id 69b36d5d11e81e28e56b46ba44e4b8cd701c5867
Change-Id: I9c13045711dbf9c0181106b66a6bf22c72bcf330 Signed-off-by: Ashlee Young <ashlee@onosfw.com>
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java')
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
index 26981e5e..8868bf7c 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
@@ -94,6 +94,17 @@ public final class Instructions {
return new GroupInstruction(groupId);
}
+ /**
+ * Creates a set-queue instruction.
+ *
+ * @param queueId Queue Id
+ * @return set-queue instruction
+ */
+ public static SetQueueInstruction setQueue(final long queueId) {
+ checkNotNull(queueId, "queue ID cannot be null");
+ return new SetQueueInstruction(queueId);
+ }
+
public static MeterInstruction meterTraffic(final MeterId meterId) {
checkNotNull(meterId, "meter id cannot be null");
return new MeterInstruction(meterId);
@@ -625,6 +636,50 @@ public final class Instructions {
}
/**
+ * Set-Queue Instruction.
+ */
+ public static final class SetQueueInstruction implements Instruction {
+ private final long queueId;
+
+ private SetQueueInstruction(long queueId) {
+ this.queueId = queueId;
+ }
+
+ public long queueId() {
+ return queueId;
+ }
+
+ @Override
+ public Type type() {
+ return Type.QUEUE;
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(type().toString())
+ .add("queueId", queueId).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type().ordinal(), queueId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof SetQueueInstruction) {
+ SetQueueInstruction that = (SetQueueInstruction) obj;
+ return Objects.equals(queueId, that.queueId);
+
+ }
+ return false;
+ }
+ }
+
+ /**
* A meter instruction.
*/
public static final class MeterInstruction implements Instruction {