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 long
DEFAULT_CONNECTION_TIMEOUT
static long
DEFAULT_MAX_FRAME_SIZE
static int
MAX_DATA_LENGTH
-
Constructor Summary
Constructors Constructor Description StompWireFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getConnectionAttemptTimeout()
int
getMaxDataLength()
long
getMaxFrameSize()
String
getStompVersion()
int
getVersion()
ByteSequence
marshal(Object command)
Packet based marshalingvoid
marshal(Object command, DataOutput os)
Stream based marshalingString
marshalToString(StompFrame stomp)
protected String
parseAction(DataInput in, AtomicLong frameSize)
protected int
parseContentLength(String contentLength, AtomicLong frameSize)
protected HashMap<String,String>
parseHeaders(DataInput in, AtomicLong frameSize)
void
setConnectionAttemptTimeout(long connectionAttemptTimeout)
void
setMaxDataLength(int maxDataLength)
void
setMaxFrameSize(long maxFrameSize)
void
setStompVersion(String stompVersion)
void
setVersion(int version)
Object
unmarshal(DataInput in)
Packet based un-marshalingObject
unmarshal(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:WireFormat
Packet based marshaling- Specified by:
marshal
in interfaceWireFormat
- Throws:
IOException
-
unmarshal
public Object unmarshal(ByteSequence packet) throws IOException
Description copied from interface:WireFormat
Packet based un-marshaling- Specified by:
unmarshal
in interfaceWireFormat
- Throws:
IOException
-
marshal
public void marshal(Object command, DataOutput os) throws IOException
Description copied from interface:WireFormat
Stream based marshaling- Specified by:
marshal
in 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:WireFormat
Packet based un-marshaling- Specified by:
unmarshal
in 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:
getVersion
in interfaceWireFormat
- Returns:
- the version of the wire format
-
setVersion
public void setVersion(int version)
- Specified by:
setVersion
in 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)
-
-