public class MpBodyFactory extends AbstractFactory
MultipartBody
instances.Modifier and Type | Class and Description |
---|---|
static class |
MpBodyFactory.SynthMBodyFlowStats |
Modifier and Type | Field and Description |
---|---|
static int |
DESC_STR_LEN
Description string field length.
|
static int |
SERIAL_NUM_LEN
Serial number string field length.
|
static int |
TABLE_NAME_LEN
Table name string field length.
|
Modifier and Type | Method and Description |
---|---|
static MultipartBody |
createReplyBody(ProtocolVersion pv,
MultipartType type)
Creates the mutable multipart reply body for the given type and
protocol version.
|
static MultipartBody |
createReplyBodyElement(ProtocolVersion pv,
MultipartType type)
Creates the mutable multipart reply body array element for the
given type and protocol version.
|
static MultipartBody |
createRequestBody(ProtocolVersion pv,
MultipartType type)
Creates the mutable multipart request body for the given type,
for the given protocol version.
|
static MBodyFlowStats |
createSyntheticFlowStats(ProtocolVersion pv,
Throwable cause)
Returns a synthetically created MBodyFlowStats element as a placeholder
for unparsable flow stats.
|
static void |
encodeReplyBody(MultipartBody body,
OfPacketWriter pkt)
Encodes a multipart reply body (if it is not null), writing it
into the supplied buffer.
|
static void |
encodeRequestBody(MultipartBody body,
OfPacketWriter pkt)
Encodes a multipart request body (if it is not null), writing it
into the supplied buffer.
|
static MultipartType |
getType(MultipartBody body)
Returns the multipart-type corresponding to the specified
multipart body instance.
|
static MultipartBody |
parseReplyBody(MultipartType type,
OfPacketReader pkt,
ProtocolVersion pv)
Parses a multipart reply message body from the supplied buffer.
|
static MultipartBody |
parseRequestBody(MultipartType type,
OfPacketReader pkt,
ProtocolVersion pv)
Parses a multipart request message body from the supplied buffer.
|
static void |
setReplyType(OfmMutableMultipartReply msg,
MultipartType type)
Sets the type in the message header, and adds the appropriate body.
|
static void |
setRequestType(OfmMutableMultipartRequest msg,
MultipartType type)
Sets the type in the message header, and adds the appropriate body,
if any.
|
protected String |
tag()
Returns an identifying tag for the multipart body factory.
|
mpe, mpe, mpe, mpe
public static final int DESC_STR_LEN
public static final int SERIAL_NUM_LEN
public static final int TABLE_NAME_LEN
protected String tag()
tag
in class AbstractFactory
public static MultipartBody parseRequestBody(MultipartType type, OfPacketReader pkt, ProtocolVersion pv) throws MessageParseException
type
- the type of request body to parsepkt
- the data bufferpv
- the protocol versionMessageParseException
- if unable to parse the bodypublic static MultipartBody parseReplyBody(MultipartType type, OfPacketReader pkt, ProtocolVersion pv) throws MessageParseException
type
- the type of reply body to parsepkt
- the data bufferpv
- the protocol versionMessageParseException
- if unable to parse the bodypublic static void setRequestType(OfmMutableMultipartRequest msg, MultipartType type)
msg
- the mutable requesttype
- its required typepublic static void setReplyType(OfmMutableMultipartReply msg, MultipartType type)
msg
- the mutable requesttype
- its required typepublic static MultipartBody createRequestBody(ProtocolVersion pv, MultipartType type)
pv
- the protocol versiontype
- the required multipart request typeVersionNotSupportedException
- if the version is not supportedNullPointerException
- either parameter is nullIllegalArgumentException
- if the type does not have a bodypublic static MultipartBody createReplyBody(ProtocolVersion pv, MultipartType type)
pv
- the protocol versiontype
- the required multipart reply typeNullPointerException
- if either paramter is nullVersionNotSupportedException
- if the version is not supportedpublic static MultipartBody createReplyBodyElement(ProtocolVersion pv, MultipartType type)
pv
- the protocol versiontype
- the required multipart reply element typeNullPointerException
- if either paramter is nullVersionNotSupportedException
- if the version is not supportedpublic static void encodeRequestBody(MultipartBody body, OfPacketWriter pkt) throws IncompleteStructureException
PacketBuffer
to be advanced by the
length of the body.body
- the body (may be null)pkt
- the buffer into which the body is to be writtenIncompleteStructureException
- if the body is incompletepublic static void encodeReplyBody(MultipartBody body, OfPacketWriter pkt) throws IncompleteStructureException
PacketBuffer
to be advanced by the
length of the body.body
- the body (may be null)pkt
- the buffer into which the body is to be writtenIncompleteStructureException
- if encoding encounters incomplete
or malformed structurepublic static MultipartType getType(MultipartBody body)
array
,
returns the type corresponding to the elements of the array.body
- the body instancepublic static MBodyFlowStats createSyntheticFlowStats(ProtocolVersion pv, Throwable cause)
pv
- the protocol versioncause
- the detected parse exceptionCopyright © 2015. All Rights Reserved.