public class OfmMultipartRequest extends OpenflowMessage
Important Note: Although MULTIPART_REQUEST messages were only added to the protocol at 1.3, they are semantically equivalent to the (now deprecated) STATS_REQUEST messages in 1.0, 1.1 and 1.2.
For example, to create a "switch description request" message (Stats-Request/DESC) to send to a switch running OpenFlow 1.0, one would do the following:
OfmMutableMultipartRequest req = (OfmMutableMultipartRequest) MessageFactory.create(ProtocolVersion.V_1_0, MULTIPART_REQUEST); req.type(MultipartType.DESC); OpenflowMessage msgToSend = req.toImmutable();When the message is encoded, the
MessageFactory
will use the version
of the message to decide whether to encode it as a MULTIPART_REQUEST or
a STATS_REQUEST.OfmMultipartReply
length
Modifier and Type | Method and Description |
---|---|
MultipartBody |
getBody()
Returns the body of the message; Since 1.3.
|
Set<MultipartRequestFlag> |
getFlags()
Returns the set of multipart message request flags; Since 1.3.
|
MultipartType |
getMultipartType()
Returns the multipart message type; Since 1.3.
|
boolean |
hasMore()
Returns
true if the MultipartRequestFlag.REQUEST_MORE
flag is present. |
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".
|
decodeHeader, getType, getVersion, getXid, hex, hex, length
public String toString()
toString
in class OpenflowMessage
public String toDebugString()
OpenflowMessage
OpenflowMessage.toString()
, but
subclasses are free to override this behavior.toDebugString
in interface Structure
toDebugString
in class OpenflowMessage
public void validate() throws IncompleteMessageException
OpenflowMessage
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.
validate
in class OpenflowMessage
IncompleteMessageException
- if the message is not completepublic MultipartType getMultipartType()
public Set<MultipartRequestFlag> getFlags()
public boolean hasMore()
true
if the MultipartRequestFlag.REQUEST_MORE
flag is present.
The presence of this flag indicates to the receiver that more
(related) multipart-requests are on their way; Only the last request
in such a sequence will have this flag false
(cleared).
public MultipartBody getBody()
Copyright © 2016. All Rights Reserved.