org.openflow.protocol
Class OFError

java.lang.Object
  extended by org.openflow.protocol.OFMessage
      extended by org.openflow.protocol.OFError
All Implemented Interfaces:
OFMessageFactoryAware
Direct Known Subclasses:
OFVendorError

public class OFError
extends OFMessage
implements OFMessageFactoryAware

Represents an ofp_error_msg

Author:
David Erickson (daviderickson@cs.stanford.edu), Rob Sherwood (rob.sherwood@stanford.edu)

Nested Class Summary
static class OFError.OFBadActionCode
           
static class OFError.OFBadInstructionCode
           
static class OFError.OFBadMatchCode
           
static class OFError.OFBadRequestCode
           
static class OFError.OFErrorType
           
static class OFError.OFFlowModFailedCode
           
static class OFError.OFGroupModFailedCode
           
static class OFError.OFHelloFailedCode
           
static class OFError.OFMeterModFailedCode
           
static class OFError.OFPortModFailedCode
           
static class OFError.OFQueueOpFailedCode
           
static class OFError.OFRoleRequestFailedCode
           
static class OFError.OFSwitchConfigFailedCode
           
static class OFError.OFTableFeaturesFailedCode
           
static class OFError.OFTableModFailedCode
           
 
Field Summary
protected  byte[] error
           
protected  short errorCode
           
protected  boolean errorIsAscii
           
protected  short errorType
           
protected  OFMessageFactory factory
           
static int MINIMUM_LENGTH
           
 
Fields inherited from class org.openflow.protocol.OFMessage
length, OFP_VERSION, type, version, xid
 
Constructor Summary
OFError()
           
 
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)
           
 byte[] getError()
           
 short getErrorCode()
           
 java.lang.String getErrorCodeName(OFError.OFErrorType errorType, int errorCode)
           
 short getErrorType()
           
 OFMessageFactory getFactory()
           
 OFMessage getOffendingMsg()
           
 int hashCode()
           
 boolean isErrorIsAscii()
           
 void readFrom(java.nio.ByteBuffer data)
          Read this message off the wire from the specified ByteBuffer
 OFError setError(byte[] error)
           
 OFError setErrorCode(OFError.OFBadActionCode code)
           
 OFError setErrorCode(OFError.OFBadRequestCode code)
           
 OFError setErrorCode(OFError.OFFlowModFailedCode code)
           
 OFError setErrorCode(OFError.OFHelloFailedCode code)
           
 OFError setErrorCode(OFError.OFPortModFailedCode code)
           
 OFError setErrorCode(OFError.OFQueueOpFailedCode code)
           
 OFError setErrorCode(short errorCode)
           
 OFError setErrorIsAscii(boolean errorIsAscii)
           
 OFError setErrorType(OFError.OFErrorType type)
           
 OFError setErrorType(short errorType)
           
 void setMessageFactory(OFMessageFactory factory)
          Sets the message factory for this object
 OFError setOffendingMsg(OFMessage offendingMsg)
          Write this offending message into the payload of the Error message
 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

errorType

protected short errorType

errorCode

protected short errorCode

factory

protected OFMessageFactory factory

error

protected byte[] error

errorIsAscii

protected boolean errorIsAscii
Constructor Detail

OFError

public OFError()
Method Detail

getErrorType

public short getErrorType()
Returns:
the errorType

setErrorType

public OFError setErrorType(short errorType)
Parameters:
errorType - the errorType to set

setErrorType

public OFError setErrorType(OFError.OFErrorType type)

getErrorCode

public short getErrorCode()
Returns:
the errorCode

setErrorCode

public OFError setErrorCode(OFError.OFHelloFailedCode code)
Parameters:
errorCode - the errorCode to set

setErrorCode

public OFError setErrorCode(short errorCode)

setErrorCode

public OFError setErrorCode(OFError.OFBadRequestCode code)

setErrorCode

public OFError setErrorCode(OFError.OFBadActionCode code)

setErrorCode

public OFError setErrorCode(OFError.OFFlowModFailedCode code)

setErrorCode

public OFError setErrorCode(OFError.OFPortModFailedCode code)

setErrorCode

public OFError setErrorCode(OFError.OFQueueOpFailedCode code)

getOffendingMsg

public OFMessage getOffendingMsg()

setOffendingMsg

public OFError setOffendingMsg(OFMessage offendingMsg)
Write this offending message into the payload of the Error message

Parameters:
offendingMsg -

getFactory

public OFMessageFactory getFactory()

setMessageFactory

public void setMessageFactory(OFMessageFactory factory)
Description copied from interface: OFMessageFactoryAware
Sets the message factory for this object

Specified by:
setMessageFactory in interface OFMessageFactoryAware

getError

public byte[] getError()
Returns:
the error

setError

public OFError setError(byte[] error)
Parameters:
error - the error to set

isErrorIsAscii

public boolean isErrorIsAscii()
Returns:
the errorIsAscii

setErrorIsAscii

public OFError setErrorIsAscii(boolean errorIsAscii)
Parameters:
errorIsAscii - the errorIsAscii 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

getErrorCodeName

public java.lang.String getErrorCodeName(OFError.OFErrorType errorType,
                                         int errorCode)

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