From da98de0459e2978fb72499725bda0334412466f1 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Tue, 18 Nov 2008 13:57:01 +0000 Subject: [PATCH] fix for AMQ-2003 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@718592 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/transport/stomp/StompFrame.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java index cded7fd5d1..751e866e8d 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java @@ -40,12 +40,22 @@ public class StompFrame implements Command { private Map headers = new HashMap(); private byte[] content = NO_DATA; + public StompFrame(String command) { + this(command, null, null); + } + + public StompFrame(String command, Map headers) { + this(command, headers, null); + } + public StompFrame(String command, Map headers, byte[] data) { this.action = command; - this.headers = headers; - this.content = data; + if (headers != null) + this.headers = headers; + if (data != null) + this.content = data; } - + public StompFrame() { } @@ -60,6 +70,10 @@ public class StompFrame implements Command { public byte[] getContent() { return content; } + + public String getBody() { + return new String(content); + } public void setContent(byte[] data) { this.content = data;