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 Stringformat()Stringformat(boolean forLogging)StringgetAction()StringgetBody()intgetCommandId()byte[]getContent()bytegetDataStructureType()EndpointgetFrom()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()EndpointgetTo()The endpoint within the transport where this message is going to - null means all endpoints.ObjectgetTransportContext()Transports may wish to associate additional data with the connection.booleanisBrokerInfo()booleanisConnectionControl()booleanisConsumerControl()booleanisMarshallAware()booleanisMessage()booleanisMessageAck()booleanisMessageDispatch()booleanisMessageDispatchNotification()booleanisResponse()booleanisResponseRequired()booleanisShutdownInfo()booleanisWireFormatInfo()voidsetAction(String command)voidsetCommandId(int value)voidsetContent(byte[] data)voidsetFrom(Endpoint from)voidsetHeaders(Map<String,String> headers)voidsetResponseRequired(boolean responseRequired)voidsetTo(Endpoint to)voidsetTransportContext(Object transportContext)Transports may wish to associate additional data with the connection.StringtoString()Responsevisit(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:
getCommandIdin interfaceCommand- Returns:
- the unique ID of this request used to map responses to requests
-
getFrom
public Endpoint getFrom()
Description copied from interface:CommandThe 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:CommandThe endpoint within the transport where this message is going to - null means all endpoints.
-
isBrokerInfo
public boolean isBrokerInfo()
- Specified by:
isBrokerInfoin interfaceCommand
-
isMessageAck
public boolean isMessageAck()
- Specified by:
isMessageAckin interfaceCommand
-
isMessageDispatch
public boolean isMessageDispatch()
- Specified by:
isMessageDispatchin interfaceCommand
-
isMessageDispatchNotification
public boolean isMessageDispatchNotification()
- Specified by:
isMessageDispatchNotificationin interfaceCommand
-
isResponse
public boolean isResponse()
- Specified by:
isResponsein interfaceCommand
-
isResponseRequired
public boolean isResponseRequired()
- Specified by:
isResponseRequiredin interfaceCommand
-
isShutdownInfo
public boolean isShutdownInfo()
- Specified by:
isShutdownInfoin interfaceCommand
-
isConnectionControl
public boolean isConnectionControl()
- Specified by:
isConnectionControlin interfaceCommand
-
isConsumerControl
public boolean isConsumerControl()
- Specified by:
isConsumerControlin interfaceCommand
-
isWireFormatInfo
public boolean isWireFormatInfo()
- Specified by:
isWireFormatInfoin interfaceCommand
-
setCommandId
public void setCommandId(int value)
- Specified by:
setCommandIdin interfaceCommand
-
setResponseRequired
public void setResponseRequired(boolean responseRequired)
- Specified by:
setResponseRequiredin interfaceCommand
-
visit
public Response visit(CommandVisitor visitor) throws Exception
-
getDataStructureType
public byte getDataStructureType()
- Specified by:
getDataStructureTypein interfaceDataStructure- Returns:
- The type of the data structure
-
isMarshallAware
public boolean isMarshallAware()
- Specified by:
isMarshallAwarein 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
-
-