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 |
isBlocked()
Returns true if response (packet-out message) to the associated
message event has been blocked.
|
boolean |
isHandled()
Returns true if the associated message event has already been handled.
|
boolean |
isSent()
Returns true if response (packet-out message) to the associated
message event has been sent.
|
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.
|
boolean |
requiresProcessing()
Returns true if the associated packet is not a test packet, and has
not yet been blocked or sent and thus continues to require processing.
|
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()
MessageContext
srcEvent
in interface MessageContext
public ProtocolVersion getVersion()
MessageContext
getVersion
in interface MessageContext
public OfmPacketIn getPacketIn()
MessageContext
getPacketIn
in interface MessageContext
public Packet decodedPacket()
MessageContext
decodedPacket
in interface MessageContext
public List<ProtocolId> getProtocols()
MessageContext
protocols
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 MessageContext
public PacketOut packetOut()
MessageContext
packetOut
in interface MessageContext
public OfmPacketOut getCompletedPacketOut()
MessageContext
getCompletedPacketOut
in interface MessageContext
public MessageContext addHint(Hint hint)
MessageContext
addHint
in interface MessageContext
hint
- the hint to be addedpublic List<Hint> getHints()
MessageContext
getHints
in interface MessageContext
public boolean isHandled()
MessageContext
isHandled
in interface MessageContext
public boolean isBlocked()
MessageContext
isBlocked
in interface MessageContext
public boolean isSent()
MessageContext
isSent
in interface MessageContext
public boolean failedToSend()
MessageContext
failedToSend
in interface MessageContext
public String toDebugString()
MessageContext
toDebugString
in interface MessageContext
public boolean isTestPacket()
MessageContext
isTestPacket
in interface MessageContext
public boolean requiresProcessing()
MessageContext
requiresProcessing
in interface MessageContext
Copyright © 2015. All Rights Reserved.