Class StompWireFormat
- java.lang.Object
-
- org.apache.activemq.transport.stomp.StompWireFormat
-
- All Implemented Interfaces:
WireFormat
public class StompWireFormat extends Object implements WireFormat
Implements marshalling and unmarsalling the Stomp protocol.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_CONNECTION_TIMEOUTstatic longDEFAULT_MAX_FRAME_SIZEstatic intMAX_DATA_LENGTH
-
Constructor Summary
Constructors Constructor Description StompWireFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetConnectionAttemptTimeout()intgetMaxDataLength()longgetMaxFrameSize()StringgetStompVersion()intgetVersion()ByteSequencemarshal(Object command)Packet based marshalingvoidmarshal(Object command, DataOutput os)Stream based marshalingStringmarshalToString(StompFrame stomp)protected StringparseAction(DataInput in, AtomicLong frameSize)protected intparseContentLength(String contentLength, AtomicLong frameSize)protected HashMap<String,String>parseHeaders(DataInput in, AtomicLong frameSize)voidsetConnectionAttemptTimeout(long connectionAttemptTimeout)voidsetMaxDataLength(int maxDataLength)voidsetMaxFrameSize(long maxFrameSize)voidsetStompVersion(String stompVersion)voidsetVersion(int version)Objectunmarshal(DataInput in)Packet based un-marshalingObjectunmarshal(ByteSequence packet)Packet based un-marshaling
-
-
-
Field Detail
-
MAX_DATA_LENGTH
public static final int MAX_DATA_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FRAME_SIZE
public static final long DEFAULT_MAX_FRAME_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_CONNECTION_TIMEOUT
public static final long DEFAULT_CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
marshal
public ByteSequence marshal(Object command) throws IOException
Description copied from interface:WireFormatPacket based marshaling- Specified by:
marshalin interfaceWireFormat- Throws:
IOException
-
unmarshal
public Object unmarshal(ByteSequence packet) throws IOException
Description copied from interface:WireFormatPacket based un-marshaling- Specified by:
unmarshalin interfaceWireFormat- Throws:
IOException
-
marshal
public void marshal(Object command, DataOutput os) throws IOException
Description copied from interface:WireFormatStream based marshaling- Specified by:
marshalin interfaceWireFormat- Throws:
IOException
-
marshalToString
public String marshalToString(StompFrame stomp) throws IOException
- Throws:
IOException
-
unmarshal
public Object unmarshal(DataInput in) throws IOException
Description copied from interface:WireFormatPacket based un-marshaling- Specified by:
unmarshalin interfaceWireFormat- Throws:
IOException
-
parseAction
protected String parseAction(DataInput in, AtomicLong frameSize) throws IOException
- Throws:
IOException
-
parseHeaders
protected HashMap<String,String> parseHeaders(DataInput in, AtomicLong frameSize) throws IOException
- Throws:
IOException
-
parseContentLength
protected int parseContentLength(String contentLength, AtomicLong frameSize) throws ProtocolException
- Throws:
ProtocolException
-
getVersion
public int getVersion()
- Specified by:
getVersionin interfaceWireFormat- Returns:
- the version of the wire format
-
setVersion
public void setVersion(int version)
- Specified by:
setVersionin interfaceWireFormat- Parameters:
version- the version of the wire format
-
getStompVersion
public String getStompVersion()
-
setStompVersion
public void setStompVersion(String stompVersion)
-
setMaxDataLength
public void setMaxDataLength(int maxDataLength)
-
getMaxDataLength
public int getMaxDataLength()
-
getMaxFrameSize
public long getMaxFrameSize()
-
setMaxFrameSize
public void setMaxFrameSize(long maxFrameSize)
-
getConnectionAttemptTimeout
public long getConnectionAttemptTimeout()
-
setConnectionAttemptTimeout
public void setConnectionAttemptTimeout(long connectionAttemptTimeout)
-
-