Use more versioned STOMP frames rather than generic

This commit is contained in:
Ville Skyttä 2015-07-10 12:06:48 +03:00
parent 970623f52b
commit ebcf0c0080
2 changed files with 4 additions and 3 deletions

View File

@ -165,7 +165,7 @@ public abstract class VersionedStompFrameHandler
public StompFrame handleReceipt(String receiptID)
{
StompFrame receipt = new StompFrame(Stomp.Responses.RECEIPT);
StompFrame receipt = createStompFrame(Stomp.Responses.RECEIPT);
receipt.addHeader(Stomp.Headers.Response.RECEIPT_ID, receiptID);
return receipt;

View File

@ -103,7 +103,8 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
else
{
// not valid
response = new StompFrame(Stomp.Responses.ERROR, true);
response = createStompFrame(Stomp.Responses.ERROR);
response.setNeedsDisconnect(true);
response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
response.setBody("The login account is not valid.");
}
@ -268,7 +269,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
public StompFrame createPingFrame()
{
StompFrame frame = new StompFrame(Stomp.Commands.STOMP);
StompFrame frame = createStompFrame(Stomp.Commands.STOMP);
frame.setPing(true);
return frame;
}