public class OfmMutableError extends OfmError implements MutableMessage
OfmError
.length
Modifier and Type | Method and Description |
---|---|
void |
clearXid()
Clears the transaction ID field of this message (sets it to 0).
|
OfmMutableError |
errorCode(ErrorCode code)
Sets the error code; Since 1.0.
|
OfmMutableError |
errorMessage(String msg)
Sets the error message; Since 1.0.
|
OfmMutableError |
errorType(ErrorType type)
Sets the error type; Since 1.0.
|
OfmMutableError |
setData(byte[] data)
Sets the associated data; Since 1.0.
|
OpenflowMessage |
toImmutable()
Returns an immutable instance of this message.
|
String |
toString() |
boolean |
writable()
Returns true if this mutable object is still writable.
|
getData, getErrorCode, getErrorMessage, getErrorType, toDebugString, validate
decodeHeader, getType, getVersion, getXid, hex, hex, length
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getVersion, toDebugString
public void clearXid()
MutableMessage
clearXid
in interface MutableMessage
public OpenflowMessage toImmutable()
MutableMessage
It is expected that the reference to this mutable message will be
dropped. Note that all method calls invoked on a
MutableMessage
after toImmutable()
has been invoked
will result in an InvalidMutableException
being thrown.
toImmutable
in interface MutableMessage
public boolean writable()
MutableObject
#toImmutable()
method (defined on a sub-interface)
has not yet been invoked.writable
in interface MutableObject
public OfmMutableError errorType(ErrorType type)
type
- the error typeNullPointerException
- if type is nullInvalidMutableException
- if this instance is no longer writablepublic OfmMutableError errorCode(ErrorCode code)
IllegalStateException
will be thrown.code
- the error codeNullPointerException
- if type is nullInvalidMutableException
- if this instance is no longer writableIllegalArgumentException
- if code is not appropriate for the typeIllegalStateException
- if the type has not been set yetpublic OfmMutableError setData(byte[] data)
IllegalStateException
will be thrown.
If the error type is HELLO_FAILED
, use
errorMessage(java.lang.String)
instead.data
- the dataNullPointerException
- if data is nullInvalidMutableException
- if this instance is no longer writableIllegalStateException
- if the type has not been set or if it is
HELLO_FAILEDpublic OfmMutableError errorMessage(String msg)
HELLO_FAILED
. The message is encoded as ASCII in the
data field.msg
- the error message to setNullPointerException
- if data is nullInvalidMutableException
- if this instance is no longer writableIllegalStateException
- if the type is not HELLO_FAILEDCopyright © 2015. All Rights Reserved.