public abstract class OpenflowStructure extends Object implements Structure
Modifier and Type | Field and Description |
---|---|
protected Throwable |
parseErrorCause |
protected ProtocolVersion |
version
Every structure knows what version it is representing.
|
Constructor and Description |
---|
OpenflowStructure(ProtocolVersion pv)
Constructs an OpenFlow structure.
|
Modifier and Type | Method and Description |
---|---|
ProtocolVersion |
getVersion()
Returns the protocol version of this OpenFlow structure.
|
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.
|
boolean |
incomplete()
Indicates if an exception was encountered during parsing, resulting
in an incomplete message structure.
|
Throwable |
parseErrorCause()
The exception encountered while parsing this structure, if any.
|
String |
toDebugString()
Returns a string representation useful for debugging.
|
String |
toString() |
void |
validate()
Validates this structure for completeness and throws an exception
if the structure is considered "not complete".
|
protected final ProtocolVersion version
protected Throwable parseErrorCause
public OpenflowStructure(ProtocolVersion pv)
pv
- the protocol versionpublic ProtocolVersion getVersion()
Structure
getVersion
in interface Structure
public String toDebugString()
toString()
, but
subclasses are free to override this behavior.toDebugString
in interface Structure
public void validate() throws IncompleteStructureException
This default implementation does nothing, i.e. default behavior is that structures 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.
IncompleteStructureException
- if the structure is not completepublic boolean incomplete()
parseErrorCause()
.public Throwable parseErrorCause()
protected static String hex(long value)
value
- the valueprotected static String hex(int value)
value
- the valueCopyright © 2015. All Rights Reserved.