public abstract class OpenflowMessage extends AbstractMessage implements Message
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenflowMessage.Header
Represents the header common to all OpenFlow messages.
|
length| Modifier and Type | Method and Description |
|---|---|
static String |
decodeHeader(byte[] bytes)
A utility method that will attempt to decode the given bytes as an
openflow message header, and return a string representation of the
result.
|
MessageType |
getType()
Returns the message type.
|
ProtocolVersion |
getVersion()
Returns the protocol version of this OpenFlow structure.
|
long |
getXid()
Returns the transaction id of this message.
|
protected static String |
hex(int value)
Returns the given int as a string in hex form.
|
protected static String |
hex(long value)
Returns the given long as a string in hex form.
|
int |
length()
Gets the message length in bytes.
|
String |
toDebugString()
Returns a string representation useful for debugging.
|
String |
toString() |
void |
validate()
Validates this message for completeness and throws an exception
if the message is considered "not complete".
|
public ProtocolVersion getVersion()
StructuregetVersion in interface Structurepublic MessageType getType()
Messagepublic int length()
Messagelength in interface Messagelength in class AbstractMessagepublic long getXid()
Messagepublic String toDebugString()
toString(), but
subclasses are free to override this behavior.toDebugString in interface Structurepublic void validate()
throws IncompleteMessageException
This default implementation does nothing, i.e. default behavior is that messages are considered complete.
Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.
IncompleteMessageException - if the message is not completepublic static String decodeHeader(byte[] bytes)
bytes - the bytes to decodeNullPointerException - if bytes is nullIllegalArgumentException - if the array is too shortprotected static String hex(long value)
value - the valueprotected static String hex(int value)
value - the valueCopyright © 2014. All Rights Reserved.