org.openflow.protocol
Class OFMeterMod

java.lang.Object
  extended by org.openflow.protocol.OFMessage
      extended by org.openflow.protocol.OFMeterMod
All Implemented Interfaces:
java.lang.Cloneable, OFMeterBandFactoryAware

public class OFMeterMod
extends OFMessage
implements java.lang.Cloneable, OFMeterBandFactoryAware

Corresponds to the struct ofp_meter_mod OpenFlow structure

Author:
Srini Seetharaman (srini.seetharaman@gmail.com)

Nested Class Summary
static class OFMeterMod.OFMeterFlags
           
 
Field Summary
protected  java.util.List<OFMeterBand> bands
           
protected  short command
           
protected  short flags
           
protected  OFMeterBandFactory meterBandFactory
           
protected  int meterId
           
static int MINIMUM_LENGTH
           
static int OFPMC_ADD
           
static int OFPMC_DELETE
           
static int OFPMC_MODIFY
           
 
Fields inherited from class org.openflow.protocol.OFMessage
length, OFP_VERSION, type, version, xid
 
Constructor Summary
OFMeterMod()
           
 
Method Summary
 OFMeterMod clone()
           
 void computeLength()
          This method computes the command of the OFMeterMod message, both setting the command field and returning the value.
 boolean equals(java.lang.Object obj)
           
 java.util.List<OFMeterBand> getBands()
           
 short getCommand()
           
 int getCommandU()
          Get the unsigned int command
 int getFlags()
           
 int getMeterId()
           
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
          Read this message off the wire from the specified ByteBuffer
 OFMeterMod setBands(java.util.List<OFMeterBand> bands)
           
 void setCommand(short command)
           
 OFMeterMod setFlags(short flags)
           
 void setMeterBandFactory(OFMeterBandFactory meterBandFactory)
          Sets the OFMeterBandFactory
 OFMeterMod setMeterId(int meterId)
           
 java.lang.String toString()
          Returns a summary of the message
 void writeTo(java.nio.ByteBuffer data)
          Write this message's binary format to the specified ByteBuffer
 
Methods inherited from class org.openflow.protocol.OFMessage
getLength, getLengthU, getType, getVersion, getXid, setLength, setLengthU, setType, setVersion, setXid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

OFPMC_ADD

public static final int OFPMC_ADD
See Also:
Constant Field Values

OFPMC_MODIFY

public static final int OFPMC_MODIFY
See Also:
Constant Field Values

OFPMC_DELETE

public static final int OFPMC_DELETE
See Also:
Constant Field Values

meterBandFactory

protected OFMeterBandFactory meterBandFactory

meterId

protected int meterId

flags

protected short flags

command

protected short command

bands

protected java.util.List<OFMeterBand> bands
Constructor Detail

OFMeterMod

public OFMeterMod()
Method Detail

getMeterId

public int getMeterId()
Returns:
the meterId

setMeterId

public OFMeterMod setMeterId(int meterId)
Parameters:
meterId - the meterId to set

getFlags

public int getFlags()
Returns:
the flags

setFlags

public OFMeterMod setFlags(short flags)
Parameters:
flags - the flags associated with the meter

getCommand

public short getCommand()
Returns:
the command

getCommandU

public int getCommandU()
Get the unsigned int command

Returns:

setCommand

public void setCommand(short command)
Parameters:
command - the command to set

getBands

public java.util.List<OFMeterBand> getBands()
Returns:
the bands

setBands

public OFMeterMod setBands(java.util.List<OFMeterBand> bands)
Parameters:
bands - the bands to set

readFrom

public void readFrom(java.nio.ByteBuffer data)
Description copied from class: OFMessage
Read this message off the wire from the specified ByteBuffer

Overrides:
readFrom in class OFMessage

writeTo

public void writeTo(java.nio.ByteBuffer data)
Description copied from class: OFMessage
Write this message's binary format to the specified ByteBuffer

Overrides:
writeTo in class OFMessage

hashCode

public int hashCode()
Overrides:
hashCode in class OFMessage

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class OFMessage

clone

public OFMeterMod clone()
Overrides:
clone in class java.lang.Object

setMeterBandFactory

public void setMeterBandFactory(OFMeterBandFactory meterBandFactory)
Description copied from interface: OFMeterBandFactoryAware
Sets the OFMeterBandFactory

Specified by:
setMeterBandFactory in interface OFMeterBandFactoryAware

toString

public java.lang.String toString()
Description copied from class: OFMessage
Returns a summary of the message

Overrides:
toString in class OFMessage
Returns:
"ofmsg=v=$version;t=$type:l=$len:xid=$xid"

computeLength

public void computeLength()
This method computes the command of the OFMeterMod message, both setting the command field and returning the value.

Overrides:
computeLength in class OFMessage