Modifier and Type | Field and Description |
---|---|
static int |
EMPTY_FRAME_SIZE
EMPTY_FRAME_SIZE = 8 = 1 + 2 + 4 + 1
1 byte of frame type
2 bytes of channel number
4 bytes of frame payload length
1 byte of payload trailer FRAME_END byte
See
checkEmptyFrameSize() , an assertion checked at
startup. |
Constructor and Description |
---|
AMQCommand()
Construct a command ready to fill in by reading frames
|
AMQCommand(Method method)
Construct a command with just a method, and without header or body.
|
AMQCommand(Method method,
AMQContentHeader contentHeader,
byte[] body)
Construct a command with a specified method, header and body.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkPreconditions()
Called to check internal code assumptions.
|
byte[] |
getContentBody()
Public API - Retrieves the body byte array that travelled as part of this
Command, if any.
|
AMQContentHeader |
getContentHeader()
Public API - Retrieves the ContentHeader subclass instance held as part of this Command, if any.
|
Method |
getMethod()
Public API - Retrieves the
Method held within this Command. |
boolean |
handleFrame(Frame f) |
String |
toString() |
String |
toString(boolean suppressBody) |
void |
transmit(AMQChannel channel)
Sends this command down the named channel on the channel's
connection, possibly in multiple frames.
|
public static final int EMPTY_FRAME_SIZE
checkEmptyFrameSize()
, an assertion checked at
startup.public AMQCommand()
public AMQCommand(Method method)
method
- the wrapped methodpublic AMQCommand(Method method, AMQContentHeader contentHeader, byte[] body)
method
- the wrapped methodcontentHeader
- the wrapped content headerbody
- the message body datapublic Method getMethod()
Method
held within this Command. Downcast to
concrete (implementation-specific!) subclasses as necessary.public AMQContentHeader getContentHeader()
AMQP.BasicProperties
, as appropriate.getContentHeader
in interface Command
ContentHeader
, or null if nonepublic byte[] getContentBody()
getContentBody
in interface Command
public boolean handleFrame(Frame f) throws IOException
IOException
public void transmit(AMQChannel channel) throws IOException
channel
- the channel on which to transmit the commandIOException
- if an error is encounteredpublic String toString(boolean suppressBody)
public static void checkPreconditions()
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.