2 * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations
18 package org.openflow.protocol.statistics;
21 import org.jboss.netty.buffer.ChannelBuffer;
24 * Represents an ofp_queue_stats_request structure
25 * @author David Erickson (daviderickson@cs.stanford.edu)
27 public class OFQueueStatisticsRequest implements OFStatistics {
28 protected short portNumber;
29 protected int queueId;
32 * @return the portNumber
34 public short getPortNumber() {
39 * @param portNumber the portNumber to set
41 public void setPortNumber(short portNumber) {
42 this.portNumber = portNumber;
48 public int getQueueId() {
53 * @param queueId the queueId to set
55 public void setQueueId(int queueId) {
56 this.queueId = queueId;
60 public int getLength() {
65 public void readFrom(ChannelBuffer data) {
66 this.portNumber = data.readShort();
67 data.readShort(); // pad
68 this.queueId = data.readInt();
72 public void writeTo(ChannelBuffer data) {
73 data.writeShort(this.portNumber);
74 data.writeShort((short) 0); // pad
75 data.writeInt(this.queueId);
79 public int hashCode() {
80 final int prime = 443;
82 result = prime * result + portNumber;
83 result = prime * result + queueId;
88 public boolean equals(Object obj) {
95 if (!(obj instanceof OFQueueStatisticsRequest)) {
98 OFQueueStatisticsRequest other = (OFQueueStatisticsRequest) obj;
99 if (portNumber != other.portNumber) {
102 if (queueId != other.queueId) {