2 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
4 package org.openflow.protocol.action;
6 import java.nio.ByteBuffer;
9 * Represents an ofp_action_enqueue
10 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
12 public class OFActionEnqueue extends OFAction {
13 public static int MINIMUM_LENGTH = 16;
16 protected int queueId;
18 public OFActionEnqueue() {
19 super.setType(OFActionType.OPAQUE_ENQUEUE);
20 super.setLength((short) MINIMUM_LENGTH);
27 public short getPort() {
35 public void setPort(short port) {
42 public int getQueueId() {
47 * @param queueId the queueId to set
49 public void setQueueId(int queueId) {
50 this.queueId = queueId;
54 public void readFrom(ByteBuffer data) {
56 this.port = data.getShort();
59 this.queueId = data.getInt();
63 public void writeTo(ByteBuffer data) {
65 data.putShort(this.port);
66 data.putShort((short) 0);
68 data.putInt(this.queueId);
72 public int hashCode() {
73 final int prime = 349;
74 int result = super.hashCode();
75 result = prime * result + port;
76 result = prime * result + queueId;
81 public boolean equals(Object obj) {
85 if (!super.equals(obj)) {
88 if (!(obj instanceof OFActionEnqueue)) {
91 OFActionEnqueue other = (OFActionEnqueue) obj;
92 if (port != other.port) {
95 if (queueId != other.queueId) {