mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-03-04 08:19:56 +00:00
Remove StompCommands
It is used in only two places and duplicates constants with Stomp.Commands and Stomp.Responses.
This commit is contained in:
parent
2a4e9f191a
commit
54bbcb3663
@ -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)
|
public boolean isProtocol(byte[] array)
|
||||||
{
|
{
|
||||||
String frameStart = new String(array, StandardCharsets.US_ASCII);
|
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
|
@Override
|
||||||
|
@ -210,7 +210,7 @@ public class StompSession implements SessionCallback
|
|||||||
StompSubscription stompSubscription = subscriptions.remove(consumerId.getID());
|
StompSubscription stompSubscription = subscriptions.remove(consumerId.getID());
|
||||||
if (stompSubscription != null)
|
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");
|
frame.setBody("consumer with ID " + consumerId + " disconnected by server");
|
||||||
connection.sendFrame(frame);
|
connection.sendFrame(frame);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user