You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/03/30 12:16:10 UTC

[1/2] qpid-broker-j git commit: QPID-8147: [Broker-J] Report received bytes as part of operational log message for unsupported protocol header

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 8e6d2c1f2 -> 3c0dc1e97


QPID-8147: [Broker-J] Report received bytes as part of operational log message for unsupported protocol header


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/e09d58b9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/e09d58b9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/e09d58b9

Branch: refs/heads/master
Commit: e09d58b9b680cd85111cf2d3ae6e273c87406b89
Parents: 8e6d2c1
Author: Alex Rudyy <or...@apache.org>
Authored: Fri Mar 30 13:02:11 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Mar 30 13:15:15 2018 +0100

----------------------------------------------------------------------
 .../org/apache/qpid/server/logging/messages/PortMessages.java  | 6 +++---
 .../qpid/server/logging/messages/Port_logmessages.properties   | 2 +-
 .../qpid/server/transport/MultiVersionProtocolEngine.java      | 4 +++-
 .../org/apache/qpid/server/logging/GenerateLogMessages.java    | 5 ++---
 4 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/e09d58b9/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
index c331c8f..a3add21 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
@@ -623,16 +623,16 @@ public class PortMessages
 
     /**
      * Log a Port message of the Format:
-     * <pre>PRT-1007 : Unsupported protocol header received, replying with {0}</pre>
+     * <pre>PRT-1007 : Unsupported protocol header received {0}, replying with {1}</pre>
      * Optional values are contained in [square brackets] and are numbered
      * sequentially in the method call.
      *
      */
-    public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1)
+    public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1, String param2)
     {
         String rawMessage = _messages.getString("UNSUPPORTED_PROTOCOL_HEADER");
 
-        final Object[] messageArguments = {param1};
+        final Object[] messageArguments = {param1, param2};
         // Create a new MessageFormat to ensure thread safety.
         // Sharing a MessageFormat and using applyPattern is not thread safe
         MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/e09d58b9/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
index 6d338a7..043721f 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
@@ -26,7 +26,7 @@ CONNECTION_REJECTED_TOO_MANY = PRT-1005 : Connection from {0} rejected. Maximum
 
 DELETE = PRT-1006 : Delete {0} Port "{1}"
 
-UNSUPPORTED_PROTOCOL_HEADER = PRT-1007 : Unsupported protocol header received, replying with {0}
+UNSUPPORTED_PROTOCOL_HEADER = PRT-1007 : Unsupported protocol header received {0}, replying with {1}
 CONNECTION_REJECTED_CLOSED = PRT-1008 : Connection from {0} rejected. Port closed.
 BIND_FAILED = PRT-1009 : FAILED to bind {0} service to {1,number,#} - port in use
 

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/e09d58b9/broker-core/src/main/java/org/apache/qpid/server/transport/MultiVersionProtocolEngine.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/transport/MultiVersionProtocolEngine.java b/broker-core/src/main/java/org/apache/qpid/server/transport/MultiVersionProtocolEngine.java
index 2533777..56a0fa6 100755
--- a/broker-core/src/main/java/org/apache/qpid/server/transport/MultiVersionProtocolEngine.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/transport/MultiVersionProtocolEngine.java
@@ -46,6 +46,7 @@ import org.apache.qpid.server.model.port.AmqpPort;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.server.security.ManagedPeerCertificateTrustStore;
 import org.apache.qpid.server.transport.network.Ticker;
+import org.apache.qpid.server.transport.util.Functions;
 import org.apache.qpid.server.util.Action;
 
 public class MultiVersionProtocolEngine implements ProtocolEngine
@@ -462,7 +463,8 @@ public class MultiVersionProtocolEngine implements ProtocolEngine
                     }
 
                     _broker.getEventLogger().message(new PortLogSubject(_port),
-                                                     PortMessages.UNSUPPORTED_PROTOCOL_HEADER(supportedReplyVersion.toString()));
+                                                     PortMessages.UNSUPPORTED_PROTOCOL_HEADER(Functions.str(headerBytes),
+                                                                                              supportedReplyVersion.toString()));
 
                     try (QpidByteBuffer supportedReplyBuf = QpidByteBuffer.allocateDirect(supportedReplyBytes.length))
                     {

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/e09d58b9/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java b/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
index 3df084c..ad0f6e9 100644
--- a/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
+++ b/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
@@ -468,12 +468,12 @@ public class GenerateLogMessages
                 */
 
                 int typeIndex = parametersString[index].indexOf(",");
-
+                int typeIndexEnd = parametersString[index].indexOf("}", typeIndex);
                 // The parameter type
                 String type;
 
                 //Be default all types are Strings
-                if (typeIndex == -1)
+                if (typeIndex == -1 || typeIndexEnd == -1)
                 {
                     type = "String";
                 }
@@ -483,7 +483,6 @@ public class GenerateLogMessages
                     // to identify this parameter as an integer
                     // This allows for a style value to be present
                     // Only check the text inside the braces '{}'
-                    int typeIndexEnd = parametersString[index].indexOf("}", typeIndex);
                     String typeString = parametersString[index].substring(typeIndex, typeIndexEnd);
                     if (typeString.contains("number") || typeString.contains("choice"))
                     {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/2] qpid-broker-j git commit: NO-JIRA: [Broker-J] Remove unused methods

Posted by or...@apache.org.
NO-JIRA: [Broker-J] Remove unused methods


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/3c0dc1e9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/3c0dc1e9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/3c0dc1e9

Branch: refs/heads/master
Commit: 3c0dc1e9771fa5e37eb03088837f3812cd7d43e5
Parents: e09d58b
Author: Alex Rudyy <or...@apache.org>
Authored: Fri Mar 30 13:02:54 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Fri Mar 30 13:15:23 2018 +0100

----------------------------------------------------------------------
 .../server/logging/messages/BrokerMessages.java | 124 -------------------
 .../logging/messages/VirtualHostMessages.java   | 124 -------------------
 2 files changed, 248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/3c0dc1e9/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
index 79319be..7651d11 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
@@ -75,8 +75,6 @@ public class BrokerMessages
     public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
     public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down";
     public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
-    public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
-    public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
     public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
 
     static
@@ -94,8 +92,6 @@ public class BrokerMessages
         LoggerFactory.getLogger(READY_LOG_HIERARCHY);
         LoggerFactory.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
         LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
-        LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
-        LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
         LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
 
         _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale);
@@ -818,126 +814,6 @@ public class BrokerMessages
 
     /**
      * Log a Broker message of the Format:
-     * <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
-     * Optional values are contained in [square brackets] and are numbered
-     * sequentially in the method call.
-     *
-     */
-    public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
-    {
-        String rawMessage = _messages.getString("STATS_DATA");
-
-        final Object[] messageArguments = {param1, param2, param3};
-        // Create a new MessageFormat to ensure thread safety.
-        // Sharing a MessageFormat and using applyPattern is not thread safe
-        MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
-
-        final String message = formatter.format(messageArguments);
-
-        return new LogMessage()
-        {
-            @Override
-            public String toString()
-            {
-                return message;
-            }
-
-            @Override
-            public String getLogHierarchy()
-            {
-                return STATS_DATA_LOG_HIERARCHY;
-            }
-
-            @Override
-            public boolean equals(final Object o)
-            {
-                if (this == o)
-                {
-                    return true;
-                }
-                if (o == null || getClass() != o.getClass())
-                {
-                    return false;
-                }
-
-                final LogMessage that = (LogMessage) o;
-
-                return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
-
-            }
-
-            @Override
-            public int hashCode()
-            {
-                int result = toString().hashCode();
-                result = 31 * result + getLogHierarchy().hashCode();
-                return result;
-            }
-        };
-    }
-
-    /**
-     * Log a Broker message of the Format:
-     * <pre>BRK-1009 : {0,choice,0#delivered|1#received} : {1,number,#.###} msg/s peak : {2,number,#} msgs total</pre>
-     * Optional values are contained in [square brackets] and are numbered
-     * sequentially in the method call.
-     *
-     */
-    public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
-    {
-        String rawMessage = _messages.getString("STATS_MSGS");
-
-        final Object[] messageArguments = {param1, param2, param3};
-        // Create a new MessageFormat to ensure thread safety.
-        // Sharing a MessageFormat and using applyPattern is not thread safe
-        MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
-
-        final String message = formatter.format(messageArguments);
-
-        return new LogMessage()
-        {
-            @Override
-            public String toString()
-            {
-                return message;
-            }
-
-            @Override
-            public String getLogHierarchy()
-            {
-                return STATS_MSGS_LOG_HIERARCHY;
-            }
-
-            @Override
-            public boolean equals(final Object o)
-            {
-                if (this == o)
-                {
-                    return true;
-                }
-                if (o == null || getClass() != o.getClass())
-                {
-                    return false;
-                }
-
-                final LogMessage that = (LogMessage) o;
-
-                return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
-
-            }
-
-            @Override
-            public int hashCode()
-            {
-                int result = toString().hashCode();
-                result = 31 * result + getLogHierarchy().hashCode();
-                return result;
-            }
-        };
-    }
-
-    /**
-     * Log a Broker message of the Format:
      * <pre>BRK-1005 : Stopped</pre>
      * Optional values are contained in [square brackets] and are numbered
      * sequentially in the method call.

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/3c0dc1e9/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
index 7350504..a4413f4 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
@@ -69,8 +69,6 @@ public class VirtualHostMessages
     public static final String FILESYSTEM_FULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.filesystem_full";
     public static final String FILESYSTEM_NOTFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.filesystem_notfull";
     public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.operation";
-    public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_data";
-    public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_msgs";
 
     static
     {
@@ -81,8 +79,6 @@ public class VirtualHostMessages
         LoggerFactory.getLogger(FILESYSTEM_FULL_LOG_HIERARCHY);
         LoggerFactory.getLogger(FILESYSTEM_NOTFULL_LOG_HIERARCHY);
         LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
-        LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
-        LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
 
         _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.VirtualHost_logmessages", _currentLocale);
     }
@@ -447,126 +443,6 @@ public class VirtualHostMessages
         };
     }
 
-    /**
-     * Log a VirtualHost message of the Format:
-     * <pre>VHT-1003 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} kB/s peak : {3,number,#} bytes total</pre>
-     * Optional values are contained in [square brackets] and are numbered
-     * sequentially in the method call.
-     *
-     */
-    public static LogMessage STATS_DATA(String param1, Number param2, Number param3, Number param4)
-    {
-        String rawMessage = _messages.getString("STATS_DATA");
-
-        final Object[] messageArguments = {param1, param2, param3, param4};
-        // Create a new MessageFormat to ensure thread safety.
-        // Sharing a MessageFormat and using applyPattern is not thread safe
-        MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
-
-        final String message = formatter.format(messageArguments);
-
-        return new LogMessage()
-        {
-            @Override
-            public String toString()
-            {
-                return message;
-            }
-
-            @Override
-            public String getLogHierarchy()
-            {
-                return STATS_DATA_LOG_HIERARCHY;
-            }
-
-            @Override
-            public boolean equals(final Object o)
-            {
-                if (this == o)
-                {
-                    return true;
-                }
-                if (o == null || getClass() != o.getClass())
-                {
-                    return false;
-                }
-
-                final LogMessage that = (LogMessage) o;
-
-                return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
-
-            }
-
-            @Override
-            public int hashCode()
-            {
-                int result = toString().hashCode();
-                result = 31 * result + getLogHierarchy().hashCode();
-                return result;
-            }
-        };
-    }
-
-    /**
-     * Log a VirtualHost message of the Format:
-     * <pre>VHT-1004 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} msg/s peak : {3,number,#} msgs total</pre>
-     * Optional values are contained in [square brackets] and are numbered
-     * sequentially in the method call.
-     *
-     */
-    public static LogMessage STATS_MSGS(String param1, Number param2, Number param3, Number param4)
-    {
-        String rawMessage = _messages.getString("STATS_MSGS");
-
-        final Object[] messageArguments = {param1, param2, param3, param4};
-        // Create a new MessageFormat to ensure thread safety.
-        // Sharing a MessageFormat and using applyPattern is not thread safe
-        MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
-
-        final String message = formatter.format(messageArguments);
-
-        return new LogMessage()
-        {
-            @Override
-            public String toString()
-            {
-                return message;
-            }
-
-            @Override
-            public String getLogHierarchy()
-            {
-                return STATS_MSGS_LOG_HIERARCHY;
-            }
-
-            @Override
-            public boolean equals(final Object o)
-            {
-                if (this == o)
-                {
-                    return true;
-                }
-                if (o == null || getClass() != o.getClass())
-                {
-                    return false;
-                }
-
-                final LogMessage that = (LogMessage) o;
-
-                return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
-
-            }
-
-            @Override
-            public int hashCode()
-            {
-                int result = toString().hashCode();
-                result = 31 * result + getLogHierarchy().hashCode();
-                return result;
-            }
-        };
-    }
-
 
     private VirtualHostMessages()
     {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org