You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/07/09 16:29:19 UTC

[1/2] activemq-artemis git commit: This closes #66 stomp changes

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 2a4e9f191 -> 244493102


This closes #66 stomp changes


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/24449310
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/24449310
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/24449310

Branch: refs/heads/master
Commit: 24449310263c6205033d2f9809bca514421e4651
Parents: 2a4e9f1 54bbcb3
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Jul 9 10:29:14 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Jul 9 10:29:14 2015 -0400

----------------------------------------------------------------------
 .../core/protocol/stomp/StompCommands.java      | 50 --------------------
 .../protocol/stomp/StompProtocolManager.java    |  2 +-
 .../core/protocol/stomp/StompSession.java       |  2 +-
 3 files changed, 2 insertions(+), 52 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: Remove StompCommands

Posted by cl...@apache.org.
Remove StompCommands

It is used in only two places and duplicates constants with
Stomp.Commands and Stomp.Responses.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/54bbcb36
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/54bbcb36
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/54bbcb36

Branch: refs/heads/master
Commit: 54bbcb3663510a46542a609b89814be0575c24a6
Parents: 2a4e9f1
Author: Ville Skyttä <vi...@iki.fi>
Authored: Thu Jul 9 10:06:36 2015 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Jul 9 10:29:14 2015 -0400

----------------------------------------------------------------------
 .../core/protocol/stomp/StompCommands.java      | 50 --------------------
 .../protocol/stomp/StompProtocolManager.java    |  2 +-
 .../core/protocol/stomp/StompSession.java       |  2 +-
 3 files changed, 2 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54bbcb36/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompCommands.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompCommands.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompCommands.java
deleted file mode 100644
index e6317b1..0000000
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompCommands.java
+++ /dev/null
@@ -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;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54bbcb36/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
index 747239c..fd06f92 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
@@ -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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54bbcb36/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
index d5c4b6b..d12fa06 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java
@@ -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);
       }