X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2Fstatistics%2FOFPFlowStatisticsRequest.java;fp=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2Fstatistics%2FOFPFlowStatisticsRequest.java;h=0000000000000000000000000000000000000000;hb=64fe0fbca1a6c2b77ad25f568d73a7eb64236d16;hp=e9e6756ce4da577f09d89ee699f3d0cec664e69d;hpb=8b9a3ff2bbc83941254b46b818cbbae5cc1a3a5b;p=openflowjava.git diff --git a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/statistics/OFPFlowStatisticsRequest.java b/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/statistics/OFPFlowStatisticsRequest.java deleted file mode 100644 index e9e6756c..00000000 --- a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/statistics/OFPFlowStatisticsRequest.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.openflow.codec.protocol.statistics; - -import java.io.Serializable; - -import org.openflow.codec.io.IDataBuffer; -import org.openflow.codec.protocol.OFPMatch; - -/** - * Represents an ofp_flow_stats_request structure - * - * @author David Erickson (daviderickson@cs.stanford.edu) - * @author AnilGujele - */ -public class OFPFlowStatisticsRequest implements OFPStatistics, Serializable { - private static final int MINIMUM_LENGTH = 40; - - protected byte tableId; - protected int outPort; - private int outGroup; - private long cookie; - private long cookieMask; - protected OFPMatch match; - - /** - * @return the match - */ - public OFPMatch getMatch() { - return match; - } - - /** - * @param match - * the match to set - */ - public void setMatch(OFPMatch match) { - this.match = match; - } - - /** - * @return the tableId - */ - public byte getTableId() { - return tableId; - } - - /** - * @param tableId - * the tableId to set - */ - public void setTableId(byte tableId) { - this.tableId = tableId; - } - - /** - * @return the outPort - */ - public int getOutPort() { - return outPort; - } - - /** - * @param outPort - * the outPort to set - */ - public void setOutPort(int outPort) { - this.outPort = outPort; - } - - /** - * - * @return - */ - public int getOutGroup() { - return outGroup; - } - - /** - * - * @param outGroup - */ - - public void setOutGroup(int outGroup) { - this.outGroup = outGroup; - } - - /** - * - * @return - */ - public long getCookie() { - return cookie; - } - - /** - * - * @param cookie - */ - public void setCookie(long cookie) { - this.cookie = cookie; - } - - /** - * - * @return - */ - public long getCookieMask() { - return cookieMask; - } - - /** - * - * @param cookieMask - */ - public void setCookieMask(long cookieMask) { - this.cookieMask = cookieMask; - } - - @Override - public int getLength() { - return MINIMUM_LENGTH; - } - - @Override - public void readFrom(IDataBuffer data) { - - this.tableId = data.get(); - data.get(); // pad - data.getShort(); // pad - this.outPort = data.getInt(); - this.setOutGroup(data.getInt()); - data.getInt(); // pad - this.setCookie(data.getLong()); - this.setCookieMask(data.getLong()); - if (this.match == null) - this.match = new OFPMatch(); - this.match.readFrom(data); - } - - @Override - public void writeTo(IDataBuffer data) { - data.put(this.tableId); - data.put((byte) 0); - data.putShort((short) 0); - data.putInt(this.outPort); - data.putInt(this.getOutGroup()); - data.putInt(0); - data.putLong(this.getCookie()); - data.putLong(this.getCookieMask()); - this.match.writeTo(data); - } - - @Override - public int hashCode() { - final int prime = 421; - int result = 1; - result = prime * result + ((match == null) ? 0 : match.hashCode()); - result = prime * result + (int) (cookie ^ (cookie >>> 32)); - result = prime * result + (int) (cookieMask ^ (cookieMask >>> 32)); - result = prime * result + outPort; - result = prime * result + outGroup; - result = prime * result + tableId; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof OFPFlowStatisticsRequest)) { - return false; - } - OFPFlowStatisticsRequest other = (OFPFlowStatisticsRequest) obj; - if (tableId != other.tableId) { - return false; - } - if (outPort != other.outPort) { - return false; - } - if (getOutGroup() != other.getOutGroup()) { - return false; - } - if (getCookie() != other.getCookie()) { - return false; - } - if (getCookieMask() != other.getCookieMask()) { - return false; - } - if (match == null) { - if (other.match != null) { - return false; - } - } else if (!match.equals(other.match)) { - return false; - } - - return true; - } -}