Class StompFrame
- java.lang.Object
-
- org.apache.activemq.transport.stomp.StompFrame
-
- All Implemented Interfaces:
Command
,DataStructure
- Direct Known Subclasses:
StompFrameError
public class StompFrame extends Object implements Command
Represents all the data in a STOMP frame.- Author:
- chirino
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]
NO_DATA
-
Constructor Summary
Constructors Constructor Description StompFrame()
StompFrame(String command)
StompFrame(String command, Map<String,String> headers)
StompFrame(String command, Map<String,String> headers, byte[] data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format()
String
format(boolean forLogging)
String
getAction()
String
getBody()
int
getCommandId()
byte[]
getContent()
byte
getDataStructureType()
Endpoint
getFrom()
The endpoint within the transport where this message came from which could be null if the transport only supports a single endpoint.Map<String,String>
getHeaders()
Endpoint
getTo()
The endpoint within the transport where this message is going to - null means all endpoints.Object
getTransportContext()
Transports may wish to associate additional data with the connection.boolean
isBrokerInfo()
boolean
isConnectionControl()
boolean
isConsumerControl()
boolean
isMarshallAware()
boolean
isMessage()
boolean
isMessageAck()
boolean
isMessageDispatch()
boolean
isMessageDispatchNotification()
boolean
isResponse()
boolean
isResponseRequired()
boolean
isShutdownInfo()
boolean
isWireFormatInfo()
void
setAction(String command)
void
setCommandId(int value)
void
setContent(byte[] data)
void
setFrom(Endpoint from)
void
setHeaders(Map<String,String> headers)
void
setResponseRequired(boolean responseRequired)
void
setTo(Endpoint to)
void
setTransportContext(Object transportContext)
Transports may wish to associate additional data with the connection.String
toString()
Response
visit(CommandVisitor visitor)
-
-
-
Method Detail
-
getAction
public String getAction()
-
setAction
public void setAction(String command)
-
getContent
public byte[] getContent()
-
getBody
public String getBody()
-
setContent
public void setContent(byte[] data)
-
getCommandId
public int getCommandId()
- Specified by:
getCommandId
in interfaceCommand
- Returns:
- the unique ID of this request used to map responses to requests
-
getFrom
public Endpoint getFrom()
Description copied from interface:Command
The endpoint within the transport where this message came from which could be null if the transport only supports a single endpoint.
-
getTo
public Endpoint getTo()
Description copied from interface:Command
The endpoint within the transport where this message is going to - null means all endpoints.
-
isBrokerInfo
public boolean isBrokerInfo()
- Specified by:
isBrokerInfo
in interfaceCommand
-
isMessageAck
public boolean isMessageAck()
- Specified by:
isMessageAck
in interfaceCommand
-
isMessageDispatch
public boolean isMessageDispatch()
- Specified by:
isMessageDispatch
in interfaceCommand
-
isMessageDispatchNotification
public boolean isMessageDispatchNotification()
- Specified by:
isMessageDispatchNotification
in interfaceCommand
-
isResponse
public boolean isResponse()
- Specified by:
isResponse
in interfaceCommand
-
isResponseRequired
public boolean isResponseRequired()
- Specified by:
isResponseRequired
in interfaceCommand
-
isShutdownInfo
public boolean isShutdownInfo()
- Specified by:
isShutdownInfo
in interfaceCommand
-
isConnectionControl
public boolean isConnectionControl()
- Specified by:
isConnectionControl
in interfaceCommand
-
isConsumerControl
public boolean isConsumerControl()
- Specified by:
isConsumerControl
in interfaceCommand
-
isWireFormatInfo
public boolean isWireFormatInfo()
- Specified by:
isWireFormatInfo
in interfaceCommand
-
setCommandId
public void setCommandId(int value)
- Specified by:
setCommandId
in interfaceCommand
-
setResponseRequired
public void setResponseRequired(boolean responseRequired)
- Specified by:
setResponseRequired
in interfaceCommand
-
visit
public Response visit(CommandVisitor visitor) throws Exception
-
getDataStructureType
public byte getDataStructureType()
- Specified by:
getDataStructureType
in interfaceDataStructure
- Returns:
- The type of the data structure
-
isMarshallAware
public boolean isMarshallAware()
- Specified by:
isMarshallAware
in interfaceDataStructure
-
format
public String format()
-
format
public String format(boolean forLogging)
-
getTransportContext
public Object getTransportContext()
Transports may wish to associate additional data with the connection. For example, an SSL transport may use this field to attach the client certificates used when the connection was established.- Returns:
- the transport context.
-
setTransportContext
public void setTransportContext(Object transportContext)
Transports may wish to associate additional data with the connection. For example, an SSL transport may use this field to attach the client certificates used when the connection was established.- Parameters:
transportContext
- value used to set the transport context
-
-