public class MessageContextAdapter extends Object implements MessageContext
MessageContext interface. This class can be
used as a base for unit tests that wish to provide mocked message contexts.| Constructor and Description |
|---|
MessageContextAdapter() |
| Modifier and Type | Method and Description |
|---|---|
MessageContext |
addHint(Hint hint)
Adds a hint to the context.
|
Packet |
decodedPacket()
Returns the decoded packet data generated by the Network Packet Library
facility.
|
boolean |
failedToSend()
This flag is set in the unlikely event that the packet sequencer
failed to send the PacketOut message via the controller.
|
OfmPacketOut |
getCompletedPacketOut()
Returns the PacketOut message that was sent back to the
source datapath.
|
List<Hint> |
getHints()
Returns the hints contained in this context, in the order they were
added by the Advisors.
|
OfmPacketIn |
getPacketIn()
Convenience method that returns the PacketIn message from
the message event.
|
List<ProtocolId> |
getProtocols()
Returns an ordered list of
protocols decoded
from the packet. |
ProtocolVersion |
getVersion()
Returns the protocol version of the associated PacketIn
message event.
|
boolean |
isHandled()
Returns true if the associated message event has already been
handled.
|
boolean |
isTestPacket()
Returns true if the associated packet has been determined to be a
diagnostic test packet.
|
PacketOut |
packetOut()
Returns the API for manipulating the PacketOut message.
|
void |
resetHandled() |
MessageEvent |
srcEvent()
Returns the associated PacketIn message event.
|
String |
toDebugString()
Returns a multi-line string representation of this message context,
suitable for debugging.
|
public MessageEvent srcEvent()
MessageContextsrcEvent in interface MessageContextpublic ProtocolVersion getVersion()
MessageContextgetVersion in interface MessageContextpublic OfmPacketIn getPacketIn()
MessageContextgetPacketIn in interface MessageContextpublic Packet decodedPacket()
MessageContextdecodedPacket in interface MessageContextpublic List<ProtocolId> getProtocols()
MessageContextprotocols decoded
from the packet. The protocols are ordered from outermost to innermost
layer. This will be null if there is no packet data associated
with the PacketIn message.getProtocols in interface MessageContextpublic PacketOut packetOut()
MessageContextpacketOut in interface MessageContextpublic OfmPacketOut getCompletedPacketOut()
MessageContextgetCompletedPacketOut in interface MessageContextpublic MessageContext addHint(Hint hint)
MessageContextaddHint in interface MessageContexthint - the hint to be addedpublic List<Hint> getHints()
MessageContextgetHints in interface MessageContextpublic boolean isHandled()
MessageContextisHandled in interface MessageContextpublic boolean failedToSend()
MessageContextfailedToSend in interface MessageContextpublic String toDebugString()
MessageContexttoDebugString in interface MessageContextpublic boolean isTestPacket()
MessageContextisTestPacket in interface MessageContextpublic void resetHandled()
resetHandled in interface MessageContextCopyright © 2014. All Rights Reserved.