mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-28 14:29:31 +00:00
This closes #66 stomp changes
This commit is contained in:
commit
2444931026
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.core.protocol.stomp;
|
||||
|
||||
public enum StompCommands
|
||||
{
|
||||
ABORT("ABORT"),
|
||||
ACK("ACK"),
|
||||
NACK("NACK"),
|
||||
BEGIN("BEGIN"),
|
||||
COMMIT("COMMIT"),
|
||||
CONNECT("CONNECT"),
|
||||
CONNECTED("CONNECTED"),
|
||||
DISCONNECT("DISCONNECT"),
|
||||
ERROR("ERROR"),
|
||||
MESSAGE("MESSAGE"),
|
||||
RECEIPT("RECEIPT"),
|
||||
SEND("SEND"),
|
||||
STOMP("STOMP"),
|
||||
SUBSCRIBE("SUBSCRIBE"),
|
||||
UNSUBSCRIBE("UNSUBSCRIBE");
|
||||
|
||||
private String command;
|
||||
|
||||
private StompCommands(String command)
|
||||
{
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return command;
|
||||
}
|
||||
|
||||
}
|
@ -209,7 +209,7 @@ class StompProtocolManager implements ProtocolManager<StompFrameInterceptor>, No
|
||||
public boolean isProtocol(byte[] array)
|
||||
{
|
||||
String frameStart = new String(array, StandardCharsets.US_ASCII);
|
||||
return frameStart.startsWith(StompCommands.CONNECT.name()) || frameStart.startsWith(StompCommands.STOMP.name());
|
||||
return frameStart.startsWith(Stomp.Commands.CONNECT) || frameStart.startsWith(Stomp.Commands.STOMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -210,7 +210,7 @@ public class StompSession implements SessionCallback
|
||||
StompSubscription stompSubscription = subscriptions.remove(consumerId.getID());
|
||||
if (stompSubscription != null)
|
||||
{
|
||||
StompFrame frame = connection.getFrameHandler().createStompFrame(StompCommands.ERROR.toString());
|
||||
StompFrame frame = connection.getFrameHandler().createStompFrame(Stomp.Responses.ERROR);
|
||||
frame.setBody("consumer with ID " + consumerId + " disconnected by server");
|
||||
connection.sendFrame(frame);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user