org.openflow.protocol
Class OFStatisticsMessageBase

java.lang.Object
  extended by org.openflow.protocol.OFMessage
      extended by org.openflow.protocol.OFStatisticsMessageBase
All Implemented Interfaces:
OFStatisticsFactoryAware
Direct Known Subclasses:
OFStatisticsReply, OFStatisticsRequest

public abstract class OFStatisticsMessageBase
extends OFMessage
implements OFStatisticsFactoryAware

Base class for multipart messages (primarily statistics requests/replies)

Author:
David Erickson (daviderickson@cs.stanford.edu) - Mar 27, 2010

Field Summary
protected  short flags
           
static int MINIMUM_LENGTH
           
protected  java.util.List<? extends OFStatistics> statistics
           
protected  OFStatisticsFactory statisticsFactory
           
protected  OFStatisticsType statisticsType
           
 
Fields inherited from class org.openflow.protocol.OFMessage
length, OFP_VERSION, type, version, xid
 
Constructor Summary
OFStatisticsMessageBase()
          Construct a ofp_statistics_* message
 
Method Summary
 void computeLength()
          This method is called during the writeTo method for serialization and is expected to set the length of the message.
 boolean equals(java.lang.Object obj)
           
 OFStatistics getFirstStatistics()
           
 short getFlags()
           
 OFStatisticsType getStatisticsType()
           
 int hashCode()
           
 void readFrom(java.nio.ByteBuffer data)
          Read this message off the wire from the specified ByteBuffer
 OFStatisticsMessageBase setFlags(short flags)
           
 void setStatistics(java.util.List<? extends OFStatistics> statistics)
           
 void setStatisticsFactory(OFStatisticsFactory statisticsFactory)
          Sets the OFStatisticsFactory
 OFStatisticsMessageBase setStatisticsType(OFStatisticsType statisticsType)
           
 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

statisticsFactory

protected OFStatisticsFactory statisticsFactory

statisticsType

protected OFStatisticsType statisticsType

flags

protected short flags

statistics

protected java.util.List<? extends OFStatistics> statistics
Constructor Detail

OFStatisticsMessageBase

public OFStatisticsMessageBase()
Construct a ofp_statistics_* message

Method Detail

getStatisticsType

public OFStatisticsType getStatisticsType()
Returns:
the statisticsType

setStatisticsType

public OFStatisticsMessageBase setStatisticsType(OFStatisticsType statisticsType)
Parameters:
statisticsType - the statisticsType to set

getFlags

public short getFlags()
Returns:
the flags

setFlags

public OFStatisticsMessageBase setFlags(short flags)
Parameters:
flags - the flags to set

getFirstStatistics

public OFStatistics getFirstStatistics()

setStatistics

public void setStatistics(java.util.List<? extends OFStatistics> statistics)
Parameters:
statistics - the statistics to set

setStatisticsFactory

public void setStatisticsFactory(OFStatisticsFactory statisticsFactory)
Description copied from interface: OFStatisticsFactoryAware
Sets the OFStatisticsFactory

Specified by:
setStatisticsFactory in interface OFStatisticsFactoryAware

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

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()
Description copied from class: OFMessage
This method is called during the writeTo method for serialization and is expected to set the length of the message. If your class manually sets the length you should override this to do nothing.

Overrides:
computeLength in class OFMessage