diff options
| author | Robert Gemmell <robbie@apache.org> | 2013-09-29 17:45:16 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2013-09-29 17:45:16 +0000 |
| commit | 892553739c601f60f8bf16cdec982c3f46e33513 (patch) | |
| tree | 92108a3af91e844649af6926437fec0a71084d16 /qpid/java/broker-core/src | |
| parent | db2c9599ca639ffc357dab2661f1a6b3bff89a33 (diff) | |
| download | qpid-python-892553739c601f60f8bf16cdec982c3f46e33513.tar.gz | |
QPID-5192: commit the protocol and logging files output by running the updated explicit generation process
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1527366 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-core/src')
13 files changed, 3465 insertions, 0 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java new file mode 100644 index 0000000000..9894db5000 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java @@ -0,0 +1,128 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of AccessControl_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class AccessControlMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String ACCESSCONTROL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol"; + public static final String DENIED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.denied"; + public static final String ALLOWED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.allowed"; + + static + { + Logger.getLogger(ACCESSCONTROL_LOG_HIERARCHY); + Logger.getLogger(DENIED_LOG_HIERARCHY); + Logger.getLogger(ALLOWED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.AccessControl_logmessages", _currentLocale); + } + + /** + * Log a AccessControl message of the Format: + * <pre>ACL-1002 : Denied : {0} {1} {2}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DENIED(String param1, String param2, String param3) + { + String rawMessage = _messages.getString("DENIED"); + + 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DENIED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a AccessControl message of the Format: + * <pre>ACL-1001 : Allowed : {0} {1} {2}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage ALLOWED(String param1, String param2, String param3) + { + String rawMessage = _messages.getString("ALLOWED"); + + 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return ALLOWED_LOG_HIERARCHY; + } + }; + } + + + private AccessControlMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java new file mode 100644 index 0000000000..f160235e43 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java @@ -0,0 +1,146 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Binding_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class BindingMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String BINDING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding.created"; + public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "binding.deleted"; + + static + { + Logger.getLogger(BINDING_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(DELETED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Binding_logmessages", _currentLocale); + } + + /** + * Log a Binding message of the Format: + * <pre>BND-1001 : Create[ : Arguments : {0}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED(String param1, boolean opt1) + { + String rawMessage = _messages.getString("CREATED"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : : Arguments : {0}. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + } + + rawMessage = msg.toString(); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Binding message of the Format: + * <pre>BND-1002 : Deleted</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DELETED() + { + String rawMessage = _messages.getString("DELETED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DELETED_LOG_HIERARCHY; + } + }; + } + + + private BindingMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java new file mode 100644 index 0000000000..d4ba32673f --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java @@ -0,0 +1,458 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Broker_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class BrokerMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String BROKER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker"; + public static final String LOG_CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.log_config"; + public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config"; + public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data"; + public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped"; + public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs"; + public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.listening"; + public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory"; + public static final String PLATFORM_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.platform"; + public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down"; + public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode"; + public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup"; + public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready"; + + static + { + Logger.getLogger(BROKER_LOG_HIERARCHY); + Logger.getLogger(LOG_CONFIG_LOG_HIERARCHY); + Logger.getLogger(CONFIG_LOG_HIERARCHY); + Logger.getLogger(STATS_DATA_LOG_HIERARCHY); + Logger.getLogger(STOPPED_LOG_HIERARCHY); + Logger.getLogger(STATS_MSGS_LOG_HIERARCHY); + Logger.getLogger(LISTENING_LOG_HIERARCHY); + Logger.getLogger(MAX_MEMORY_LOG_HIERARCHY); + Logger.getLogger(PLATFORM_LOG_HIERARCHY); + Logger.getLogger(SHUTTING_DOWN_LOG_HIERARCHY); + Logger.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY); + Logger.getLogger(STARTUP_LOG_HIERARCHY); + Logger.getLogger(READY_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale); + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1007 : Using logging configuration : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage LOG_CONFIG(String param1) + { + String rawMessage = _messages.getString("LOG_CONFIG"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return LOG_CONFIG_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1006 : Using configuration : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CONFIG(String param1) + { + String rawMessage = _messages.getString("CONFIG"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CONFIG_LOG_HIERARCHY; + } + }; + } + + /** + * 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STATS_DATA_LOG_HIERARCHY; + } + }; + } + + /** + * 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. + * + */ + public static LogMessage STOPPED() + { + String rawMessage = _messages.getString("STOPPED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STOPPED_LOG_HIERARCHY; + } + }; + } + + /** + * 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STATS_MSGS_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage LISTENING(String param1, Number param2) + { + String rawMessage = _messages.getString("LISTENING"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return LISTENING_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1011 : Maximum Memory : {0,number} bytes</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage MAX_MEMORY(Number param1) + { + String rawMessage = _messages.getString("MAX_MEMORY"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return MAX_MEMORY_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1010 : Platform : JVM : {0} version: {1} OS : {2} version: {3} arch: {4}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage PLATFORM(String param1, String param2, String param3, String param4, String param5) + { + String rawMessage = _messages.getString("PLATFORM"); + + final Object[] messageArguments = {param1, param2, param3, param4, param5}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return PLATFORM_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage SHUTTING_DOWN(String param1, Number param2) + { + String rawMessage = _messages.getString("SHUTTING_DOWN"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return SHUTTING_DOWN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1012 : Management Mode : User Details : {0} / {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage MANAGEMENT_MODE(String param1, String param2) + { + String rawMessage = _messages.getString("MANAGEMENT_MODE"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return MANAGEMENT_MODE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STARTUP(String param1, String param2) + { + String rawMessage = _messages.getString("STARTUP"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STARTUP_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Broker message of the Format: + * <pre>BRK-1004 : Qpid Broker Ready</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage READY() + { + String rawMessage = _messages.getString("READY"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return READY_LOG_HIERARCHY; + } + }; + } + + + private BrokerMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java new file mode 100644 index 0000000000..66fdc93c6d --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java @@ -0,0 +1,453 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Channel_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class ChannelMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String CHANNEL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel"; + public static final String FLOW_ENFORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_enforced"; + public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.create"; + public static final String FLOW_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow"; + public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close"; + public static final String PREFETCH_SIZE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.prefetch_size"; + public static final String CLOSE_FORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close_forced"; + public static final String DEADLETTERMSG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.deadlettermsg"; + public static final String DISCARDMSG_NOALTEXCH_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noaltexch"; + public static final String IDLE_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.idle_txn"; + public static final String DISCARDMSG_NOROUTE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noroute"; + public static final String OPEN_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.open_txn"; + public static final String FLOW_REMOVED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_removed"; + + static + { + Logger.getLogger(CHANNEL_LOG_HIERARCHY); + Logger.getLogger(FLOW_ENFORCED_LOG_HIERARCHY); + Logger.getLogger(CREATE_LOG_HIERARCHY); + Logger.getLogger(FLOW_LOG_HIERARCHY); + Logger.getLogger(CLOSE_LOG_HIERARCHY); + Logger.getLogger(PREFETCH_SIZE_LOG_HIERARCHY); + Logger.getLogger(CLOSE_FORCED_LOG_HIERARCHY); + Logger.getLogger(DEADLETTERMSG_LOG_HIERARCHY); + Logger.getLogger(DISCARDMSG_NOALTEXCH_LOG_HIERARCHY); + Logger.getLogger(IDLE_TXN_LOG_HIERARCHY); + Logger.getLogger(DISCARDMSG_NOROUTE_LOG_HIERARCHY); + Logger.getLogger(OPEN_TXN_LOG_HIERARCHY); + Logger.getLogger(FLOW_REMOVED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Channel_logmessages", _currentLocale); + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1005 : Flow Control Enforced (Queue {0})</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage FLOW_ENFORCED(String param1) + { + String rawMessage = _messages.getString("FLOW_ENFORCED"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return FLOW_ENFORCED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1001 : Create</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATE() + { + String rawMessage = _messages.getString("CREATE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1002 : Flow {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage FLOW(String param1) + { + String rawMessage = _messages.getString("FLOW"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return FLOW_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1003 : Close</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE() + { + String rawMessage = _messages.getString("CLOSE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage PREFETCH_SIZE(Number param1, Number param2) + { + String rawMessage = _messages.getString("PREFETCH_SIZE"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return PREFETCH_SIZE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1003 : Close : {0,number} - {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE_FORCED(Number param1, String param2) + { + String rawMessage = _messages.getString("CLOSE_FORCED"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_FORCED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1011 : Message : {0,number} moved to dead letter queue : {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DEADLETTERMSG(Number param1, String param2) + { + String rawMessage = _messages.getString("DEADLETTERMSG"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DEADLETTERMSG_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1009 : Discarded message : {0,number} as no alternate exchange configured for queue : {1} routing key : {2}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DISCARDMSG_NOALTEXCH(Number param1, String param2, String param3) + { + String rawMessage = _messages.getString("DISCARDMSG_NOALTEXCH"); + + 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DISCARDMSG_NOALTEXCH_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1008 : Idle Transaction : {0,number} ms</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage IDLE_TXN(Number param1) + { + String rawMessage = _messages.getString("IDLE_TXN"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return IDLE_TXN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1010 : Discarded message : {0,number} as no binding on alternate exchange : {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DISCARDMSG_NOROUTE(Number param1, String param2) + { + String rawMessage = _messages.getString("DISCARDMSG_NOROUTE"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DISCARDMSG_NOROUTE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1007 : Open Transaction : {0,number} ms</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage OPEN_TXN(Number param1) + { + String rawMessage = _messages.getString("OPEN_TXN"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return OPEN_TXN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Channel message of the Format: + * <pre>CHN-1006 : Flow Control Removed</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage FLOW_REMOVED() + { + String rawMessage = _messages.getString("FLOW_REMOVED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return FLOW_REMOVED_LOG_HIERARCHY; + } + }; + } + + + private ChannelMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java new file mode 100644 index 0000000000..a07e0e3fe4 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java @@ -0,0 +1,210 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of ConfigStore_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class ConfigStoreMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String CONFIGSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore"; + public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_complete"; + public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.close"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.created"; + public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.store_location"; + public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_start"; + + static + { + Logger.getLogger(CONFIGSTORE_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY); + Logger.getLogger(CLOSE_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_START_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ConfigStore_logmessages", _currentLocale); + } + + /** + * Log a ConfigStore message of the Format: + * <pre>CFG-1005 : Recovery Complete</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_COMPLETE() + { + String rawMessage = _messages.getString("RECOVERY_COMPLETE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_COMPLETE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ConfigStore message of the Format: + * <pre>CFG-1003 : Closed</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE() + { + String rawMessage = _messages.getString("CLOSE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ConfigStore message of the Format: + * <pre>CFG-1001 : Created</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED() + { + String rawMessage = _messages.getString("CREATED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ConfigStore message of the Format: + * <pre>CFG-1002 : Store location : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STORE_LOCATION(String param1) + { + String rawMessage = _messages.getString("STORE_LOCATION"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STORE_LOCATION_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ConfigStore message of the Format: + * <pre>CFG-1004 : Recovery Start</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_START() + { + String rawMessage = _messages.getString("RECOVERY_START"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_START_LOG_HIERARCHY; + } + }; + } + + + private ConfigStoreMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java new file mode 100644 index 0000000000..639705edbf --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java @@ -0,0 +1,195 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Connection_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class ConnectionMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String CONNECTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection"; + public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.open"; + public static final String IDLE_CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.idle_close"; + public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.close"; + + static + { + Logger.getLogger(CONNECTION_LOG_HIERARCHY); + Logger.getLogger(OPEN_LOG_HIERARCHY); + Logger.getLogger(IDLE_CLOSE_LOG_HIERARCHY); + Logger.getLogger(CLOSE_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Connection_logmessages", _currentLocale); + } + + /** + * Log a Connection message of the Format: + * <pre>CON-1001 : Open[ : Client ID : {0}][ : Protocol Version : {1}][ : Client Version : {2}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage OPEN(String param1, String param2, String param3, boolean opt1, boolean opt2, boolean opt3) + { + String rawMessage = _messages.getString("OPEN"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : : Client ID : {0}. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + + // Add Option : : Protocol Version : {1}. + end = parts[2].indexOf(']'); + if (opt2) + { + msg.append(parts[2].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[2].substring(end + 1)); + + // Add Option : : Client Version : {2}. + end = parts[3].indexOf(']'); + if (opt3) + { + msg.append(parts[3].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[3].substring(end + 1)); + } + + rawMessage = msg.toString(); + + 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return OPEN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Connection message of the Format: + * <pre>CON-1003 : Closed due to inactivity</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage IDLE_CLOSE() + { + String rawMessage = _messages.getString("IDLE_CLOSE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return IDLE_CLOSE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Connection message of the Format: + * <pre>CON-1002 : Close</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE() + { + String rawMessage = _messages.getString("CLOSE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_LOG_HIERARCHY; + } + }; + } + + + private ConnectionMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java new file mode 100644 index 0000000000..f9e86ef8b3 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java @@ -0,0 +1,180 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Exchange_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class ExchangeMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String EXCHANGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange"; + public static final String DISCARDMSG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.discardmsg"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.created"; + public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "exchange.deleted"; + + static + { + Logger.getLogger(EXCHANGE_LOG_HIERARCHY); + Logger.getLogger(DISCARDMSG_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(DELETED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Exchange_logmessages", _currentLocale); + } + + /** + * Log a Exchange message of the Format: + * <pre>EXH-1003 : Discarded Message : Name: {0} Routing Key: {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DISCARDMSG(String param1, String param2) + { + String rawMessage = _messages.getString("DISCARDMSG"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DISCARDMSG_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Exchange message of the Format: + * <pre>EXH-1001 : Create :[ Durable] Type: {0} Name: {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED(String param1, String param2, boolean opt1) + { + String rawMessage = _messages.getString("CREATED"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : Durable. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + } + + rawMessage = msg.toString(); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Exchange message of the Format: + * <pre>EXH-1002 : Deleted</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DELETED() + { + String rawMessage = _messages.getString("DELETED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DELETED_LOG_HIERARCHY; + } + }; + } + + + private ExchangeMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java new file mode 100644 index 0000000000..df700b2222 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java @@ -0,0 +1,332 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of ManagementConsole_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class ManagementConsoleMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String MANAGEMENTCONSOLE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole"; + public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.open"; + public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.listening"; + public static final String SSL_KEYSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.ssl_keystore"; + public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.stopped"; + public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.close"; + public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.shutting_down"; + public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.startup"; + public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.ready"; + + static + { + Logger.getLogger(MANAGEMENTCONSOLE_LOG_HIERARCHY); + Logger.getLogger(OPEN_LOG_HIERARCHY); + Logger.getLogger(LISTENING_LOG_HIERARCHY); + Logger.getLogger(SSL_KEYSTORE_LOG_HIERARCHY); + Logger.getLogger(STOPPED_LOG_HIERARCHY); + Logger.getLogger(CLOSE_LOG_HIERARCHY); + Logger.getLogger(SHUTTING_DOWN_LOG_HIERARCHY); + Logger.getLogger(STARTUP_LOG_HIERARCHY); + Logger.getLogger(READY_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ManagementConsole_logmessages", _currentLocale); + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1007 : Open : User {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage OPEN(String param1) + { + String rawMessage = _messages.getString("OPEN"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return OPEN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1002 : Starting : {0} : Listening on port {1,number,#}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage LISTENING(String param1, Number param2) + { + String rawMessage = _messages.getString("LISTENING"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return LISTENING_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1006 : Using SSL Keystore : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage SSL_KEYSTORE(String param1) + { + String rawMessage = _messages.getString("SSL_KEYSTORE"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return SSL_KEYSTORE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1005 : {0} Management Stopped</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STOPPED(String param1) + { + String rawMessage = _messages.getString("STOPPED"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STOPPED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1008 : Close : User {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE(String param1) + { + String rawMessage = _messages.getString("CLOSE"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1003 : Shutting down : {0} : port {1,number,#}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage SHUTTING_DOWN(String param1, Number param2) + { + String rawMessage = _messages.getString("SHUTTING_DOWN"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return SHUTTING_DOWN_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1001 : {0} Management Startup</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STARTUP(String param1) + { + String rawMessage = _messages.getString("STARTUP"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STARTUP_LOG_HIERARCHY; + } + }; + } + + /** + * Log a ManagementConsole message of the Format: + * <pre>MNG-1004 : {0} Management Ready</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage READY(String param1) + { + String rawMessage = _messages.getString("READY"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return READY_LOG_HIERARCHY; + } + }; + } + + + private ManagementConsoleMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java new file mode 100644 index 0000000000..2c700df31c --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java @@ -0,0 +1,331 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of MessageStore_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class MessageStoreMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String MESSAGESTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore"; + public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_complete"; + public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.closed"; + public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.overfull"; + public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovered"; + public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.underfull"; + public static final String PASSIVATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.passivate"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.created"; + public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.store_location"; + public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_start"; + + static + { + Logger.getLogger(MESSAGESTORE_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY); + Logger.getLogger(CLOSED_LOG_HIERARCHY); + Logger.getLogger(OVERFULL_LOG_HIERARCHY); + Logger.getLogger(RECOVERED_LOG_HIERARCHY); + Logger.getLogger(UNDERFULL_LOG_HIERARCHY); + Logger.getLogger(PASSIVATE_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_START_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.MessageStore_logmessages", _currentLocale); + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1006 : Recovery Complete</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_COMPLETE() + { + String rawMessage = _messages.getString("RECOVERY_COMPLETE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_COMPLETE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1003 : Closed</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSED() + { + String rawMessage = _messages.getString("CLOSED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1008 : Store overfull, flow control will be enforced</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage OVERFULL() + { + String rawMessage = _messages.getString("OVERFULL"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return OVERFULL_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1005 : Recovered {0,number} messages</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERED(Number param1) + { + String rawMessage = _messages.getString("RECOVERED"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1009 : Store overfull condition cleared</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage UNDERFULL() + { + String rawMessage = _messages.getString("UNDERFULL"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return UNDERFULL_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1007 : Store Passivated</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage PASSIVATE() + { + String rawMessage = _messages.getString("PASSIVATE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return PASSIVATE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1001 : Created</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED() + { + String rawMessage = _messages.getString("CREATED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1002 : Store location : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STORE_LOCATION(String param1) + { + String rawMessage = _messages.getString("STORE_LOCATION"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STORE_LOCATION_LOG_HIERARCHY; + } + }; + } + + /** + * Log a MessageStore message of the Format: + * <pre>MST-1004 : Recovery Start</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_START() + { + String rawMessage = _messages.getString("RECOVERY_START"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_START_LOG_HIERARCHY; + } + }; + } + + + private MessageStoreMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java new file mode 100644 index 0000000000..75fa5b533e --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java @@ -0,0 +1,254 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Queue_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class QueueMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue"; + public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.overfull"; + public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.underfull"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.created"; + public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.deleted"; + + static + { + Logger.getLogger(QUEUE_LOG_HIERARCHY); + Logger.getLogger(OVERFULL_LOG_HIERARCHY); + Logger.getLogger(UNDERFULL_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(DELETED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Queue_logmessages", _currentLocale); + } + + /** + * Log a Queue message of the Format: + * <pre>QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage OVERFULL(Number param1, Number param2) + { + String rawMessage = _messages.getString("OVERFULL"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return OVERFULL_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Queue message of the Format: + * <pre>QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage UNDERFULL(Number param1, Number param2) + { + String rawMessage = _messages.getString("UNDERFULL"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return UNDERFULL_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Queue message of the Format: + * <pre>QUE-1001 : Create :[ Owner: {0}][ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED(String param1, Number param2, boolean opt1, boolean opt2, boolean opt3, boolean opt4, boolean opt5) + { + String rawMessage = _messages.getString("CREATED"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : Owner: {0}. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + + // Add Option : AutoDelete. + end = parts[2].indexOf(']'); + if (opt2) + { + msg.append(parts[2].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[2].substring(end + 1)); + + // Add Option : Durable. + end = parts[3].indexOf(']'); + if (opt3) + { + msg.append(parts[3].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[3].substring(end + 1)); + + // Add Option : Transient. + end = parts[4].indexOf(']'); + if (opt4) + { + msg.append(parts[4].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[4].substring(end + 1)); + + // Add Option : Priority: {1,number,#}. + end = parts[5].indexOf(']'); + if (opt5) + { + msg.append(parts[5].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[5].substring(end + 1)); + } + + rawMessage = msg.toString(); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Queue message of the Format: + * <pre>QUE-1002 : Deleted</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage DELETED() + { + String rawMessage = _messages.getString("DELETED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return DELETED_LOG_HIERARCHY; + } + }; + } + + + private QueueMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java new file mode 100644 index 0000000000..b58b324ece --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java @@ -0,0 +1,190 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of Subscription_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class SubscriptionMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String SUBSCRIPTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription"; + public static final String STATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.state"; + public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.create"; + public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.close"; + + static + { + Logger.getLogger(SUBSCRIPTION_LOG_HIERARCHY); + Logger.getLogger(STATE_LOG_HIERARCHY); + Logger.getLogger(CREATE_LOG_HIERARCHY); + Logger.getLogger(CLOSE_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Subscription_logmessages", _currentLocale); + } + + /** + * Log a Subscription message of the Format: + * <pre>SUB-1003 : State : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STATE(String param1) + { + String rawMessage = _messages.getString("STATE"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STATE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Subscription message of the Format: + * <pre>SUB-1001 : Create[ : Durable][ : Arguments : {0}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATE(String param1, boolean opt1, boolean opt2) + { + String rawMessage = _messages.getString("CREATE"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : : Durable. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + + // Add Option : : Arguments : {0}. + end = parts[2].indexOf(']'); + if (opt2) + { + msg.append(parts[2].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[2].substring(end + 1)); + } + + rawMessage = msg.toString(); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a Subscription message of the Format: + * <pre>SUB-1002 : Close</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSE() + { + String rawMessage = _messages.getString("CLOSE"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSE_LOG_HIERARCHY; + } + }; + } + + + private SubscriptionMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java new file mode 100644 index 0000000000..22c54f0ec7 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java @@ -0,0 +1,368 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of TransactionLog_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class TransactionLogMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String TRANSACTIONLOG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog"; + public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.closed"; + public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_complete"; + public static final String XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_message"; + public static final String XA_INCOMPLETE_QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_queue"; + public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovered"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.created"; + public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.store_location"; + public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_start"; + + static + { + Logger.getLogger(TRANSACTIONLOG_LOG_HIERARCHY); + Logger.getLogger(CLOSED_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY); + Logger.getLogger(XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY); + Logger.getLogger(XA_INCOMPLETE_QUEUE_LOG_HIERARCHY); + Logger.getLogger(RECOVERED_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(STORE_LOCATION_LOG_HIERARCHY); + Logger.getLogger(RECOVERY_START_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.TransactionLog_logmessages", _currentLocale); + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1003 : Closed</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSED() + { + String rawMessage = _messages.getString("CLOSED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1006 : Recovery Complete[ : {0}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_COMPLETE(String param1, boolean opt1) + { + String rawMessage = _messages.getString("RECOVERY_COMPLETE"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : : {0}. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + } + + rawMessage = msg.toString(); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_COMPLETE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1008 : XA transaction recover for xid {0} incomplete as it references a message {1} which was not durably retained</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage XA_INCOMPLETE_MESSAGE(String param1, String param2) + { + String rawMessage = _messages.getString("XA_INCOMPLETE_MESSAGE"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1007 : XA transaction recover for xid {0} incomplete as it references a queue {1} which was not durably retained</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage XA_INCOMPLETE_QUEUE(String param1, String param2) + { + String rawMessage = _messages.getString("XA_INCOMPLETE_QUEUE"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return XA_INCOMPLETE_QUEUE_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1005 : Recovered {0,number} messages for queue {1}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERED(Number param1, String param2) + { + String rawMessage = _messages.getString("RECOVERED"); + + 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); + + final String message = formatter.format(messageArguments); + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1001 : Created</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED() + { + String rawMessage = _messages.getString("CREATED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1002 : Store location : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage STORE_LOCATION(String param1) + { + String rawMessage = _messages.getString("STORE_LOCATION"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STORE_LOCATION_LOG_HIERARCHY; + } + }; + } + + /** + * Log a TransactionLog message of the Format: + * <pre>TXN-1004 : Recovery Start[ : {0}]</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage RECOVERY_START(String param1, boolean opt1) + { + String rawMessage = _messages.getString("RECOVERY_START"); + StringBuffer msg = new StringBuffer(); + + // Split the formatted message up on the option values so we can + // rebuild the message based on the configured options. + String[] parts = rawMessage.split("\\["); + msg.append(parts[0]); + + int end; + if (parts.length > 1) + { + + // Add Option : : {0}. + end = parts[1].indexOf(']'); + if (opt1) + { + msg.append(parts[1].substring(0, end)); + } + + // Use 'end + 1' to remove the ']' from the output + msg.append(parts[1].substring(end + 1)); + } + + rawMessage = msg.toString(); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return RECOVERY_START_LOG_HIERARCHY; + } + }; + } + + + private TransactionLogMessages() + { + } + +} diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java new file mode 100644 index 0000000000..149d6d2e89 --- /dev/null +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java @@ -0,0 +1,220 @@ +/* + * 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.qpid.server.logging.messages; + +import static org.apache.qpid.server.logging.AbstractRootMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX; + +import org.apache.log4j.Logger; +import org.apache.qpid.server.configuration.BrokerProperties; +import org.apache.qpid.server.logging.LogMessage; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED. + * + * Generated using GenerateLogMessages and LogMessages.vm + * This file is based on the content of VirtualHost_logmessages.properties + * + * To regenerate, edit the templates/properties and run the build with -Dgenerate=true + */ +public class VirtualHostMessages +{ + private static ResourceBundle _messages; + private static Locale _currentLocale = BrokerProperties.getLocale(); + + public static final String VIRTUALHOST_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost"; + public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.closed"; + 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"; + public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.created"; + public static final String ERRORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.errored"; + + static + { + Logger.getLogger(VIRTUALHOST_LOG_HIERARCHY); + Logger.getLogger(CLOSED_LOG_HIERARCHY); + Logger.getLogger(STATS_DATA_LOG_HIERARCHY); + Logger.getLogger(STATS_MSGS_LOG_HIERARCHY); + Logger.getLogger(CREATED_LOG_HIERARCHY); + Logger.getLogger(ERRORED_LOG_HIERARCHY); + + _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.VirtualHost_logmessages", _currentLocale); + } + + /** + * Log a VirtualHost message of the Format: + * <pre>VHT-1002 : Closed</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CLOSED() + { + String rawMessage = _messages.getString("CLOSED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CLOSED_LOG_HIERARCHY; + } + }; + } + + /** + * 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STATS_DATA_LOG_HIERARCHY; + } + }; + } + + /** + * 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return STATS_MSGS_LOG_HIERARCHY; + } + }; + } + + /** + * Log a VirtualHost message of the Format: + * <pre>VHT-1001 : Created : {0}</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage CREATED(String param1) + { + String rawMessage = _messages.getString("CREATED"); + + final Object[] messageArguments = {param1}; + // 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() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return CREATED_LOG_HIERARCHY; + } + }; + } + + /** + * Log a VirtualHost message of the Format: + * <pre>VHT-1005 : Unexpected fatal error</pre> + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ + public static LogMessage ERRORED() + { + String rawMessage = _messages.getString("ERRORED"); + + final String message = rawMessage; + + return new LogMessage() + { + public String toString() + { + return message; + } + + public String getLogHierarchy() + { + return ERRORED_LOG_HIERARCHY; + } + }; + } + + + private VirtualHostMessages() + { + } + +} |
