You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2017/07/30 19:49:12 UTC
[1/6] qpid-broker-j git commit: QPID-7869: [Java Broker] [Truststore]
Make all TrustStores implement getCertificateDetails
Repository: qpid-broker-j
Updated Branches:
refs/heads/master 47ac14c69 -> f218a1dd8
QPID-7869: [Java Broker] [Truststore] Make all TrustStores implement getCertificateDetails
Within the UI, made the certficateDetails grid common to all truststores
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/391f0b81
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/391f0b81
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/391f0b81
Branch: refs/heads/master
Commit: 391f0b81bab5ba64aa8aee89770a24414a140215
Parents: f28d3b5
Author: Keith Wall <ke...@gmail.com>
Authored: Tue Jul 25 21:45:19 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Sun Jul 30 18:07:22 2017 +0100
----------------------------------------------------------------------
.../apache/qpid/server/model/TrustStore.java | 5 +
.../server/security/CertificateDetailsImpl.java | 111 ++++++++
.../server/security/FileTrustStoreImpl.java | 25 +-
.../ManagedPeerCertificateTrustStore.java | 8 +-
.../ManagedPeerCertificateTrustStoreImpl.java | 83 ------
.../security/MutableCertificateTrustStore.java | 29 +++
.../qpid/server/security/NonJavaTrustStore.java | 12 -
.../server/security/NonJavaTrustStoreImpl.java | 68 +----
.../server/security/SiteSpecificTrustStore.java | 20 --
.../security/SiteSpecificTrustStoreImpl.java | 57 +---
.../security/SiteSpecificTrustStoreTest.java | 29 ++-
.../resources/js/qpid/management/TrustStore.js | 38 ++-
.../management/store/CertificateGridWidget.js | 261 +++++++++++++++++++
.../store/managedcertificatestore/show.js | 183 +------------
.../management/store/nonjavatruststore/show.js | 43 +--
.../src/main/java/resources/showTrustStore.html | 3 +
.../resources/store/CertificateGridWidget.html | 34 +++
.../store/managedcertificatestore/show.html | 13 -
.../resources/store/nonjavatruststore/show.html | 4 -
.../store/sitespecifictruststore/show.html | 25 --
20 files changed, 540 insertions(+), 511 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
index 4fa9306..10a59d6 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
@@ -26,6 +26,8 @@ import java.util.List;
import javax.net.ssl.TrustManager;
+import org.apache.qpid.server.security.CertificateDetails;
+
@ManagedObject( defaultType = "FileTrustStore" )
public interface TrustStore<X extends TrustStore<X>> extends ConfiguredObject<X>
{
@@ -38,6 +40,9 @@ public interface TrustStore<X extends TrustStore<X>> extends ConfiguredObject<X>
@ManagedAttribute( defaultValue = "[]", description = "If 'exposedAsMessageSource' is true and 'includedVirtualHostNodeMessageSources' is empty, the trust store will expose its certificates only to VirtualHostNodes who are not in this list." )
List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources();
+ @DerivedAttribute(description = "List of details about the certificates like validity dates, SANs, issuer and subject names, etc.")
+ List<CertificateDetails> getCertificateDetails();
+
TrustManager[] getTrustManagers() throws GeneralSecurityException;
Certificate[] getCertificates() throws GeneralSecurityException;
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetailsImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetailsImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetailsImpl.java
new file mode 100644
index 0000000..8561b59
--- /dev/null
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetailsImpl.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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.security;
+
+import java.security.cert.CertificateParsingException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.qpid.server.model.ManagedAttributeValue;
+
+public class CertificateDetailsImpl implements CertificateDetails, ManagedAttributeValue
+{
+ private final X509Certificate _x509cert;
+
+ public CertificateDetailsImpl(final X509Certificate x509cert)
+ {
+ _x509cert = x509cert;
+ }
+
+ @Override
+ public String getSerialNumber()
+ {
+ return _x509cert.getSerialNumber().toString();
+ }
+
+ @Override
+ public int getVersion()
+ {
+ return _x509cert.getVersion();
+ }
+
+ @Override
+ public String getSignatureAlgorithm()
+ {
+ return _x509cert.getSigAlgName();
+ }
+
+ @Override
+ public String getIssuerName()
+ {
+ return _x509cert.getIssuerX500Principal().getName();
+ }
+
+ @Override
+ public String getSubjectName()
+ {
+ return _x509cert.getSubjectX500Principal().getName();
+ }
+
+ @Override
+ public List<String> getSubjectAltNames()
+ {
+ try
+ {
+ List<String> altNames = new ArrayList<>();
+ final Collection<List<?>> altNameObjects = _x509cert.getSubjectAlternativeNames();
+ if (altNameObjects != null)
+ {
+ for (List<?> entry : altNameObjects)
+ {
+ final int type = (Integer) entry.get(0);
+ if (type == 1 || type == 2)
+ {
+ altNames.add(entry.get(1).toString().trim());
+ }
+ }
+ }
+ return altNames;
+ }
+ catch (CertificateParsingException e)
+ {
+
+ return Collections.emptyList();
+ }
+ }
+
+ @Override
+ public Date getValidFrom()
+ {
+ return _x509cert.getNotBefore();
+ }
+
+ @Override
+ public Date getValidUntil()
+ {
+ return _x509cert.getNotAfter();
+ }
+}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
index d0ce045..ae7e781 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
@@ -29,12 +29,15 @@ import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
@@ -119,7 +122,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
// verify that it is not in use
String storeName = getName();
- Collection<Port<?>> ports = new ArrayList<Port<?>>(_broker.getPorts());
+ Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
for (Port port : ports)
{
Collection<TrustStore> trustStores = port.getTrustStores();
@@ -138,7 +141,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
}
}
- Collection<AuthenticationProvider> authenticationProviders = new ArrayList<AuthenticationProvider>(_broker.getAuthenticationProviders());
+ Collection<AuthenticationProvider> authenticationProviders = new ArrayList<>(_broker.getAuthenticationProviders());
for (AuthenticationProvider authProvider : authenticationProviders)
{
if (authProvider instanceof SimpleLDAPAuthenticationManager)
@@ -272,7 +275,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
final TrustManagerFactory tmf = TrustManagerFactory
.getInstance(trustManagerFactoryAlgorithm);
tmf.init(ts);
- final Collection<TrustManager> trustManagersCol = new ArrayList<TrustManager>();
+ final Collection<TrustManager> trustManagersCol = new ArrayList<>();
final QpidMultipleTrustManager mulTrustManager = new QpidMultipleTrustManager();
TrustManager[] delegateManagers = tmf.getTrustManagers();
for (TrustManager tm : delegateManagers)
@@ -345,6 +348,22 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
}
+ @Override
+ public List<CertificateDetails> getCertificateDetails()
+ {
+ try
+ {
+ return Arrays.stream(getCertificates())
+ .filter(cert -> cert instanceof X509Certificate)
+ .map(x509cert -> new CertificateDetailsImpl((X509Certificate) x509cert))
+ .collect(Collectors.toList());
+ }
+ catch (GeneralSecurityException e)
+ {
+ throw new IllegalConfigurationException("Failed to extract certificate details", e);
+ }
+ }
+
private static URL getUrlFromString(String urlString) throws MalformedURLException
{
URL url;
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
index 0647fd0..580696a 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
@@ -23,7 +23,6 @@ package org.apache.qpid.server.security;
import java.security.cert.Certificate;
import java.util.List;
-import org.apache.qpid.server.model.DerivedAttribute;
import org.apache.qpid.server.model.ManagedAttribute;
import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.ManagedOperation;
@@ -32,7 +31,9 @@ import org.apache.qpid.server.model.TrustStore;
@ManagedObject(category = false, type = ManagedPeerCertificateTrustStore.TYPE_NAME,
description = "Stores multiple PEM or DER encoded certificates in the broker configuration which the Trust Store will trust for secure connections (e.g., HTTPS or AMQPS)")
-public interface ManagedPeerCertificateTrustStore<X extends ManagedPeerCertificateTrustStore<X>> extends TrustStore<X>
+public interface ManagedPeerCertificateTrustStore<X extends ManagedPeerCertificateTrustStore<X>> extends TrustStore<X>,
+ MutableCertificateTrustStore
+
{
String TYPE_NAME = "ManagedCertificateStore";
@@ -52,9 +53,6 @@ public interface ManagedPeerCertificateTrustStore<X extends ManagedPeerCertifica
mandatory = true)
Certificate certificate);
- @DerivedAttribute(description = "List of details about the certificates like validity dates, SANs, issuer and subject names, etc.")
- List<CertificateDetails> getCertificateDetails();
-
@ManagedOperation(description = "Remove given certificates from the Trust Store.",
changesConfiguredObjectState = true)
void removeCertificates(@Param(name = "certificates", description = "List of certificate details to be removed. The details should take the form given by the certificateDetails attribute", mandatory = true)
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
index 3f8db76..6133192 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
@@ -24,12 +24,10 @@ import java.io.IOException;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.cert.Certificate;
-import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -56,7 +54,6 @@ import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.ConfiguredObject;
import org.apache.qpid.server.model.IntegrityViolationException;
import org.apache.qpid.server.model.ManagedAttributeField;
-import org.apache.qpid.server.model.ManagedAttributeValue;
import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
import org.apache.qpid.server.model.Port;
@@ -325,86 +322,6 @@ public class ManagedPeerCertificateTrustStoreImpl
}
}
- public static class CertificateDetailsImpl implements CertificateDetails, ManagedAttributeValue
- {
- private final X509Certificate _x509cert;
-
- public CertificateDetailsImpl(final X509Certificate x509cert)
- {
- _x509cert = x509cert;
- }
-
- @Override
- public String getSerialNumber()
- {
- return _x509cert.getSerialNumber().toString();
- }
-
- @Override
- public int getVersion()
- {
- return _x509cert.getVersion();
- }
-
- @Override
- public String getSignatureAlgorithm()
- {
- return _x509cert.getSigAlgName();
- }
-
- @Override
- public String getIssuerName()
- {
- return _x509cert.getIssuerX500Principal().getName();
- }
-
- @Override
- public String getSubjectName()
- {
- return _x509cert.getSubjectX500Principal().getName();
- }
-
- @Override
- public List<String> getSubjectAltNames()
- {
- try
- {
- List<String> altNames = new ArrayList<String>();
- final Collection<List<?>> altNameObjects = _x509cert.getSubjectAlternativeNames();
- if(altNameObjects != null)
- {
- for (List<?> entry : altNameObjects)
- {
- final int type = (Integer) entry.get(0);
- if (type == 1 || type == 2)
- {
- altNames.add(entry.get(1).toString().trim());
- }
-
- }
- }
- return altNames;
- }
- catch (CertificateParsingException e)
- {
-
- return Collections.emptyList();
- }
- }
-
- @Override
- public Date getValidFrom()
- {
- return _x509cert.getNotBefore();
- }
-
- @Override
- public Date getValidUntil()
- {
- return _x509cert.getNotAfter();
- }
- }
-
@Override
protected void logOperation(final String operation)
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/MutableCertificateTrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/MutableCertificateTrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/MutableCertificateTrustStore.java
new file mode 100644
index 0000000..06d2325
--- /dev/null
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/MutableCertificateTrustStore.java
@@ -0,0 +1,29 @@
+/*
+ * 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.security;
+
+import org.apache.qpid.server.model.ManagedAnnotation;
+import org.apache.qpid.server.model.ManagedInterface;
+
+@ManagedAnnotation
+public interface MutableCertificateTrustStore extends ManagedInterface
+{
+}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStore.java
index 701beec..7b34419 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStore.java
@@ -38,16 +38,4 @@ public interface NonJavaTrustStore<X extends NonJavaTrustStore<X>> extends Trust
@ManagedAttribute( mandatory = true, oversize = true, oversizedAltText = OVER_SIZED_ATTRIBUTE_ALTERNATIVE_TEXT )
String getCertificatesUrl();
- enum CertificateDetails
- {
- SUBJECT_NAME,
- ISSUER_NAME,
- VALID_START,
- VALID_END
-
- }
-
- @DerivedAttribute
- List<Map<CertificateDetails,Object>> getCertificateDetails();
-
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
index a593a90..385ea02 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
@@ -28,18 +28,16 @@ import java.security.GeneralSecurityException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
-import java.util.EnumMap;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
-import javax.naming.InvalidNameException;
-import javax.naming.ldap.LdapName;
-import javax.naming.ldap.Rdn;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
-import javax.security.auth.x500.X500Principal;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
@@ -63,8 +61,8 @@ import org.apache.qpid.server.model.StateTransition;
import org.apache.qpid.server.model.TrustStore;
import org.apache.qpid.server.model.VirtualHostNode;
import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
-import org.apache.qpid.server.util.urlstreamhandler.data.Handler;
import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
+import org.apache.qpid.server.util.urlstreamhandler.data.Handler;
@ManagedObject( category = false )
public class NonJavaTrustStoreImpl
@@ -112,61 +110,15 @@ public class NonJavaTrustStoreImpl
@Override
- public List<Map<CertificateDetails,Object>> getCertificateDetails()
+ public List<CertificateDetails> getCertificateDetails()
{
- List<Map<CertificateDetails,Object>> certificateDetails = new ArrayList<>();
- if(_certificates != null)
- {
- for (X509Certificate certificate : _certificates)
- {
- Map<CertificateDetails, Object> details = new EnumMap<>(CertificateDetails.class);
-
- details.put(CertificateDetails.SUBJECT_NAME, getNameFromCertificate(certificate));
- details.put(CertificateDetails.ISSUER_NAME, certificate.getIssuerX500Principal().getName());
- details.put(CertificateDetails.VALID_START, certificate.getNotBefore());
- details.put(CertificateDetails.VALID_END, certificate.getNotAfter());
- certificateDetails.add(details);
- }
- }
- return certificateDetails;
+ return (_certificates == null)
+ ? Collections.emptyList()
+ : Arrays.stream(_certificates)
+ .map(CertificateDetailsImpl::new)
+ .collect(Collectors.toList());
}
- private String getNameFromCertificate(final X509Certificate certificate)
- {
- String name;
- X500Principal subjectX500Principal = certificate.getSubjectX500Principal();
- name = getCommonNameFromPrincipal(subjectX500Principal);
-
- return name;
- }
-
- private String getCommonNameFromPrincipal(final X500Principal subjectX500Principal)
- {
- String name;
- String dn = subjectX500Principal.getName();
- try
- {
- LdapName ldapDN = new LdapName(dn);
- name = dn;
- for (Rdn rdn : ldapDN.getRdns())
- {
- if (rdn.getType().equalsIgnoreCase("CN"))
- {
- name = String.valueOf(rdn.getValue());
- break;
- }
- }
-
- }
- catch (InvalidNameException e)
- {
- LOGGER.error("Error getting subject name from certificate");
- name = null;
- }
- return name;
- }
-
-
@Override
public TrustManager[] getTrustManagers() throws GeneralSecurityException
{
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
index c901438..baec638 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
@@ -20,8 +20,6 @@
*/
package org.apache.qpid.server.security;
-import java.util.Date;
-
import org.apache.qpid.server.model.DerivedAttribute;
import org.apache.qpid.server.model.ManagedAttribute;
import org.apache.qpid.server.model.ManagedContextDefault;
@@ -49,24 +47,6 @@ public interface SiteSpecificTrustStore<X extends SiteSpecificTrustStore<X>> ext
@DerivedAttribute(persist = true, description = "The X.509 certificate obtained from the given URL as base64 encoded representation of the ASN.1 DER encoding")
String getCertificate();
- @DerivedAttribute(description = "The distinguished name of the issuer of the certificate or null if no issuer information is present")
- String getCertificateIssuer();
-
- @DerivedAttribute(description = "The distinguished name of the subject of the certificate or null if no subject information is present")
- String getCertificateSubject();
-
- @DerivedAttribute(description = "The serial number of the certificate assigned by the CA or null if no serial number is present")
- String getCertificateSerialNumber();
-
- @DerivedAttribute(description = "A (possibly truncated) hex encoded representation of the signature. The bytes are separated by spaces. null if no signature information is present")
- String getCertificateSignature();
-
- @DerivedAttribute(description = "The start date of the validity of the certificate")
- Date getCertificateValidFromDate();
-
- @DerivedAttribute(description = "The end date of the validity of the certificate")
- Date getCertificateValidUntilDate();
-
@ManagedOperation(description = "Re-download the certificate from the URL",
changesConfiguredObjectState = false /* This should really be true but pragmatically it is set to false because we do not want to block the config thread while getting the certificate from the remote host */)
void refreshCertificate();
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
index 95e4c8d..891403b 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
@@ -33,7 +33,7 @@ import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -74,7 +74,6 @@ import org.apache.qpid.server.model.TrustStore;
import org.apache.qpid.server.model.VirtualHostNode;
import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
-import org.apache.qpid.server.transport.util.Functions;
import org.apache.qpid.server.util.Strings;
@ManagedObject( category = false )
@@ -405,42 +404,10 @@ public class SiteSpecificTrustStoreImpl
}
@Override
- public String getCertificateIssuer()
+ public List<CertificateDetails> getCertificateDetails()
{
- return _x509Certificate == null ? null : _x509Certificate.getIssuerX500Principal().toString();
+ return Collections.singletonList(new CertificateDetailsImpl(_x509Certificate));
}
-
- @Override
- public String getCertificateSubject()
- {
- return _x509Certificate == null ? null : _x509Certificate.getSubjectX500Principal().toString();
- }
-
-
- @Override
- public String getCertificateSerialNumber()
- {
- return _x509Certificate == null ? null : _x509Certificate.getSerialNumber().toString();
- }
-
- @Override
- public String getCertificateSignature()
- {
- return _x509Certificate == null ? null : Functions.hex(_x509Certificate.getSignature(),4096, " ");
- }
-
- @Override
- public Date getCertificateValidFromDate()
- {
- return _x509Certificate == null ? null : _x509Certificate.getNotBefore();
- }
-
- @Override
- public Date getCertificateValidUntilDate()
- {
- return _x509Certificate == null ? null :_x509Certificate.getNotAfter();
- }
-
@Override
public void refreshCertificate()
{
@@ -490,20 +457,16 @@ public class SiteSpecificTrustStoreImpl
private ThreadFactory getThreadFactory(final String name)
{
- return new ThreadFactory()
+ return runnable ->
{
- @Override
- public Thread newThread(final Runnable r)
- {
- final Thread thread = Executors.defaultThreadFactory().newThread(r);
- if (!thread.isDaemon())
- {
- thread.setDaemon(true);
- }
- thread.setName(name);
- return thread;
+ final Thread thread = Executors.defaultThreadFactory().newThread(runnable);
+ if (!thread.isDaemon())
+ {
+ thread.setDaemon(true);
}
+ thread.setName(name);
+ return thread;
};
}
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-core/src/test/java/org/apache/qpid/server/security/SiteSpecificTrustStoreTest.java
----------------------------------------------------------------------
diff --git a/broker-core/src/test/java/org/apache/qpid/server/security/SiteSpecificTrustStoreTest.java b/broker-core/src/test/java/org/apache/qpid/server/security/SiteSpecificTrustStoreTest.java
index 637a04b..2ac12f6 100644
--- a/broker-core/src/test/java/org/apache/qpid/server/security/SiteSpecificTrustStoreTest.java
+++ b/broker-core/src/test/java/org/apache/qpid/server/security/SiteSpecificTrustStoreTest.java
@@ -32,6 +32,7 @@ import java.net.Socket;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -56,8 +57,8 @@ import org.apache.qpid.test.utils.TestSSLConstants;
public class SiteSpecificTrustStoreTest extends QpidTestCase
{
- private static final String EXPECTED_SUBJECT = "CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown";
- private static final String EXPECTED_ISSUER = "CN=MyRootCA, O=ACME, ST=Ontario, C=CA";
+ private static final String EXPECTED_SUBJECT = "CN=localhost,OU=Unknown,O=Unknown,L=Unknown,ST=Unknown,C=Unknown";
+ private static final String EXPECTED_ISSUER = "CN=MyRootCA,O=ACME,ST=Ontario,C=CA";
private final Broker<?> _broker = mock(Broker.class);
private final TaskExecutor _taskExecutor = CurrentThreadTaskExecutor.newStartedInstance();
private final Model _model = BrokerModel.getInstance();
@@ -161,8 +162,12 @@ public class SiteSpecificTrustStoreTest extends QpidTestCase
final SiteSpecificTrustStore trustStore =
(SiteSpecificTrustStore) _factory.create(TrustStore.class, attributes, _broker);
- assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, trustStore.getCertificateSubject());
- assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, trustStore.getCertificateIssuer());
+ List<CertificateDetails> certDetails = trustStore.getCertificateDetails();
+ assertEquals("Unexpected number of certificates", 1, certDetails.size());
+ CertificateDetails certificateDetails = certDetails.get(0);
+
+ assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, certificateDetails.getSubjectName());
+ assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, certificateDetails.getIssuerName());
}
public void testRefreshCertificate() throws Exception
@@ -175,13 +180,21 @@ public class SiteSpecificTrustStoreTest extends QpidTestCase
final SiteSpecificTrustStore trustStore =
(SiteSpecificTrustStore) _factory.create(TrustStore.class, attributes, _broker);
- assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, trustStore.getCertificateSubject());
- assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, trustStore.getCertificateIssuer());
+ List<CertificateDetails> certDetails = trustStore.getCertificateDetails();
+ assertEquals("Unexpected number of certificates",1, certDetails.size());
+
+ CertificateDetails certificateDetails = certDetails.get(0);
+
+ assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, certificateDetails.getSubjectName());
+ assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, certificateDetails.getIssuerName());
trustStore.refreshCertificate();
- assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, trustStore.getCertificateSubject());
- assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, trustStore.getCertificateIssuer());
+ certDetails = trustStore.getCertificateDetails();
+ certificateDetails = certDetails.get(0);
+
+ assertEquals("Unexpected certificate subject", EXPECTED_SUBJECT, certificateDetails.getSubjectName());
+ assertEquals("Unexpected certificate issuer", EXPECTED_ISSUER, certificateDetails.getIssuerName());
}
private Map<String, Object> getTrustStoreAttributes(final int listeningPort)
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
index 80d2774..7114351 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
@@ -18,22 +18,20 @@
* under the License.
*
*/
-define(["dojo/dom",
+define(["dojo/_base/lang",
"dojo/parser",
"dojo/query",
"dojo/_base/connect",
"dijit/registry",
+ "qpid/management/store/CertificateGridWidget",
"dojox/html/entities",
- "qpid/common/properties",
"qpid/common/updater",
"qpid/common/util",
- "qpid/common/formatter",
"qpid/management/addStore",
"dojo/text!showTrustStore.html",
"dojo/domReady!"],
- function (dom, parser, query, connect, registry, entities, properties, updater, util, formatter, addStore, template)
+ function (lang, parser, query, connect, registry, CertificateGridWidget, entities, updater, util, addStore, template)
{
-
function TrustStore(kwArgs)
{
this.controller = kwArgs.controller;
@@ -64,15 +62,15 @@ define(["dojo/dom",
});
var deleteTrustStoreButton = query(".deleteStoreButton", contentPane.containerNode)[0];
- var node = registry.byNode(deleteTrustStoreButton);
- connect.connect(node, "onClick", function (evt)
+ var deleteButtonNode = registry.byNode(deleteTrustStoreButton);
+ connect.connect(deleteButtonNode, "onClick", function (evt)
{
that.deleteKeyStore();
});
var editTrustStoreButton = query(".editStoreButton", contentPane.containerNode)[0];
- var node = registry.byNode(editTrustStoreButton);
- connect.connect(node, "onClick", function (evt)
+ var editButtonNode = registry.byNode(editTrustStoreButton);
+ connect.connect(editButtonNode, "onClick", function (evt)
{
that.management.load(that.modelObj,
{
@@ -85,12 +83,24 @@ define(["dojo/dom",
addStore.show(data[0], that.url);
}, util.xhrErrorHandler);
});
+
+ var gridNode = query(".managedCertificatesGrid", contentPane.containerNode)[0];
+ that.certificatesGrid = new CertificateGridWidget({
+ management: that.management,
+ modelObj: that.modelObj
+ }, gridNode);
+ that.certificatesGrid.startup();
+ that.certificatesGrid.on("certificatesUpdated", lang.hitch(this, function()
+ {
+ that.keyStoreUpdater.update();
+ }));
});
};
TrustStore.prototype.close = function ()
{
updater.remove(this.keyStoreUpdater);
+ this.certificatesGrid.destroy();
};
function KeyStoreUpdater(tabObject)
@@ -142,6 +152,7 @@ define(["dojo/dom",
{
that.trustStoreData = data[0];
that.updateHeader();
+ that.tabObject.certificatesGrid.update(that.trustStoreData.certificateDetails);
if (callback)
{
@@ -154,6 +165,11 @@ define(["dojo/dom",
}
else
{
+ var implementsManagedInterface = that.management.metadata.implementsManagedInterface("TrustStore",
+ that.trustStoreData.type,
+ "MutableCertificateTrustStore");
+ that.tabObject.certificatesGrid.enableCertificateControls(implementsManagedInterface);
+
require(["qpid/management/store/" + encodeURIComponent(that.trustStoreData.type.toLowerCase())
+ "/show"], function (DetailsUI)
{
@@ -184,13 +200,13 @@ define(["dojo/dom",
this.management.remove(this.modelObj)
.then(function (data)
{
- that.contentPane.onClose()
+ that.contentPane.onClose();
that.controller.tabContainer.removeChild(that.contentPane);
that.contentPane.destroyRecursive();
that.close();
}, util.xhrErrorHandler);
}
- }
+ };
return TrustStore;
});
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/CertificateGridWidget.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/CertificateGridWidget.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/CertificateGridWidget.js
new file mode 100644
index 0000000..5dcb1f1
--- /dev/null
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/CertificateGridWidget.js
@@ -0,0 +1,261 @@
+/*
+ *
+ * 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.
+ *
+ */
+define(["dojo/_base/declare",
+ "dojo/_base/lang",
+ "dojo/Evented",
+ "dojo/parser",
+ "dojo/query",
+ "dojo/dom-class",
+ "dijit/registry",
+ "qpid/common/util",
+ "qpid/common/UpdatableStore",
+ "dojox/grid/EnhancedGrid",
+ "dojo/text!store/CertificateGridWidget.html",
+ "dijit/_WidgetBase",
+ "dijit/_TemplatedMixin",
+ "dijit/_WidgetsInTemplateMixin",
+ "dojo/domReady!"],
+ function (declare,
+ lang,
+ Evented,
+ parser,
+ query,
+ domClass,
+ registry,
+ util,
+ UpdatableStore,
+ EnhancedGrid,
+ template)
+{
+ return declare("qpid.management.store.CertificateGridWidget",
+ [dijit._WidgetBase, dijit._TemplatedMixin, dijit._WidgetsInTemplateMixin, Evented],
+ {
+ //Strip out the apache comment header from the template html as comments unsupported.
+ templateString: template.replace(/<!--[\s\S]*?-->/g, ""),
+
+ // template fields
+ certificatesGridContainer: null,
+ removeCertificateButton: null,
+ certificateUploader: null,
+ certificateControls: null,
+
+ // constructor parameters
+ management: null,
+
+ // other
+ certificatesGrid: null,
+
+ postCreate : function ()
+ {
+ this.inherited(arguments);
+
+ var gridProperties = {
+ height: 400,
+ selectionMode: "extended",
+ plugins: {
+ indirectSelection: true,
+ pagination: {
+ pageSizes: [10, 25, 50, 100],
+ description: true,
+ sizeSwitch: true,
+ pageStepper: true,
+ gotoButton: true,
+ maxPageStep: 4,
+ position: "bottom"
+ }
+ }
+ };
+
+ this.certificatesGrid =
+ new UpdatableStore([], this.certificatesGridContainer, [{
+ name: "Subject Name",
+ field: "subjectName",
+ width: "25%"
+ }, {
+ name: "Issuer Name",
+ field: "issuerName",
+ width: "25%"
+ }, {
+ name: "Serial #",
+ field: "serialNumber",
+ width: "10%"
+ }, {
+ name: "Valid From",
+ field: "validFrom",
+ width: "20%",
+ formatter: lang.hitch(this, this._formatDate)
+ }, {
+ name: "Valid Until",
+ field: "validUntil",
+ width: "20%",
+ formatter: lang.hitch(this, this._formatDate)
+ }], null, gridProperties, EnhancedGrid);
+
+ if (window.FileReader)
+ {
+ this.certificateUploader.on("change", lang.hitch(this,this._onFileSelected));
+ }
+ else
+ {
+ this.certificateUploader.set("disabled", true);
+ this.certificateUploader.domNode.style.display = "none";
+ }
+ this.removeCertificateButton.on("click", lang.hitch(this, this._removeCertificates));
+ },
+ enableCertificateControls: function(enabled)
+ {
+ this.certificatesGrid.grid.layout.setColumnVisibility(0, enabled);
+ if (enabled)
+ {
+ domClass.remove(this.certificateControls, "dijitHidden");
+ }
+ else
+ {
+ domClass.add(this.certificateControls, "dijitHidden");
+ }
+ },
+ destroy: function ()
+ {
+ this.inherited(arguments);
+ this.certificatesGrid.destroy();
+ },
+ resize: function ()
+ {
+ this.inherited(arguments);
+ this.certificatesGrid.grid.resize();
+ },
+ update : function (certificates)
+ {
+ var certItems = this._addIdToCertificates(certificates);
+ this.certificatesGrid.grid.beginUpdate();
+ this.certificatesGrid.update(certItems);
+ this.certificatesGrid.grid.endUpdate();
+ },
+ _addIdToCertificates : function(certDetails)
+ {
+ var certItems = [];
+ for (var idx in certDetails)
+ {
+ var item = lang.mixin(certDetails[idx],
+ {id: certDetails[idx].serialNumber + '|' + certDetails[idx].issuerName});
+ certItems.push(item);
+ }
+ return certItems;
+ },
+ _onFileSelected: function ()
+ {
+ if (this.certificateUploader.domNode.children[0].files)
+ {
+ this.certificateUploader.set("disabled", true);
+ var file = this.certificateUploader.domNode.children[0].files[0];
+ var fileReader = new FileReader();
+ fileReader.onload = lang.hitch(this, function (evt)
+ {
+ var result = fileReader.result;
+ if (result.indexOf("-----BEGIN CERTIFICATE-----") != -1)
+ {
+ this._uploadCertificate(result);
+ }
+ else
+ {
+ fileReader.onload = lang.hitch(this, function (evt)
+ {
+ var binresult = fileReader.result;
+ binresult = binresult.substring(binresult.indexOf(",") + 1);
+ this._uploadCertificate(binresult);
+ });
+ fileReader.readAsDataURL(file);
+ }
+ });
+ fileReader.readAsText(file);
+ }
+ },
+ _uploadComplete: function ()
+ {
+ this.certificateUploader.set("disabled", false);
+ this.certificateUploader.reset();
+ },
+ _uploadError: function (error)
+ {
+ this.management.errorHandler(error);
+ this.certificateUploader.set("disabled", false);
+ this.certificateUploader.reset();
+ },
+ _uploadCertificate : function (cert)
+ {
+ var parentModelObj = this.modelObj;
+ var modelObj = {
+ type: parentModelObj.type,
+ name: "addCertificate",
+ parent: parentModelObj
+ };
+ var url = this.management.buildObjectURL(modelObj);
+
+ this.management.post({url: url}, {certificate: cert})
+ .then(lang.hitch(this, function ()
+ {
+ this._uploadComplete();
+ this.emit("certificatesUpdate");
+ }),
+ lang.hitch(this, this._uploadError));
+ },
+ _removeCertificates : function ()
+ {
+ var data = this.certificatesGrid.grid.selection.getSelected();
+
+ if (data.length)
+ {
+ this.removeCertificateButton.set("disabled", true);
+ var parentModelObj = this.modelObj;
+ var modelObj = {
+ type: parentModelObj.type,
+ name: "removeCertificates",
+ parent: parentModelObj
+ };
+ var items = [];
+ for (var i = 0; i < data.length; i++)
+ {
+ var parts = data[i].id.split("|");
+ items.push({
+ issuerName: parts[1],
+ serialNumber: parts[0]
+ });
+ }
+ var url = this.management.buildObjectURL(modelObj);
+ this.management.post({url: url}, {certificates: items})
+ .then(null, management.xhrErrorHandler)
+ .always(lang.hitch(this, function ()
+ {
+ this.removeCertificateButton.set("disabled", false);
+ this.emit("certificatesUpdated");
+ }));
+ }
+ },
+ _formatDate: function (val)
+ {
+ return this.management.userPreferences.formatDateTime(val, {
+ addOffset: true,
+ appendTimeZone: true
+ });
+ }
+ }
+ );
+});
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/show.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/show.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/show.js
index be6add0..0dd1a76 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/show.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/show.js
@@ -20,23 +20,8 @@
define(["dojo/query",
"dojo/_base/lang",
"qpid/common/util",
- "dojox/grid/EnhancedGrid",
- "qpid/common/UpdatableStore",
- "dijit/registry",
- "dojo/domReady!"], function (query, lang, util, EnhancedGrid, UpdatableStore, registry)
+ "dojo/domReady!"], function (query, lang, util)
{
- function addIdToCertificates(obj)
- {
- var certItems = [];
- var certDetails = obj.certificateDetails;
- for (var idx in certDetails)
- {
- var item = lang.mixin(certDetails[idx],
- {id: certDetails[idx].serialNumber + '|' + certDetails[idx].issuerName});
- certItems.push(item);
- }
- return certItems;
- }
function ManagedCertificateStore(data)
{
@@ -49,23 +34,6 @@ define(["dojo/query",
{
this.fields.push(name);
}
- var that = this;
- var gridProperties = {
- height: 400,
- selectionMode: "extended",
- plugins: {
- indirectSelection: true,
- pagination: {
- pageSizes: [10, 25, 50, 100],
- description: true,
- sizeSwitch: true,
- pageStepper: true,
- gotoButton: true,
- maxPageStep: 4,
- position: "bottom"
- }
- }
- };
util.buildUI(data.containerNode,
data.parent,
@@ -74,161 +42,12 @@ define(["dojo/query",
this,
function ()
{
- that.certificates = addIdToCertificates(that);
- that.certificatesGrid =
- new UpdatableStore(that.certificates, query(".managedCertificatesGrid", containerNode)[0], [{
- name: "Subject Name",
- field: "subjectName",
- width: "25%"
- }, {
- name: "Issuer Name",
- field: "issuerName",
- width: "25%"
- }, {
- name: "Serial #",
- field: "serialNumber",
- width: "10%"
- }, {
- name: "Valid From",
- field: "validFrom",
- width: "20%",
- formatter: function (val)
- {
- return that.management.userPreferences.formatDateTime(val, {
- addOffset: true,
- appendTimeZone: true
- });
- }
- }, {
- name: "Valid Until",
- field: "validUntil",
- width: "20%",
- formatter: function (val)
- {
- return that.management.userPreferences.formatDateTime(val, {
- addOffset: true,
- appendTimeZone: true
- });
- }
- }], null, gridProperties, EnhancedGrid);
});
-
- this.removeButton = registry.byNode(query(".removeCertificates", containerNode)[0]);
- this.removeButton.on("click", function (e)
- {
- that.removeCertificates()
- });
-
- this.addButton = registry.byNode(query(".addCertificate", containerNode)[0]);
- var addButton = this.addButton;
- var that = this;
-
- function uploadCertificate(cert)
- {
- var parentModelObj = that.modelObj;
- var modelObj = {
- type: parentModelObj.type,
- name: "addCertificate",
- parent: parentModelObj
- };
- var url = that.management.buildObjectURL(modelObj);
-
- that.management.post({url: url}, {certificate: cert})
- .then(uploadComplete, uploadError);
- }
-
- function uploadComplete()
- {
- addButton.set("disabled", false);
- addButton.reset();
- }
-
- function uploadError(error)
- {
- that.management.errorHandler(error);
- addButton.set("disabled", false);
- addButton.reset();
- }
-
- function onFileSelected()
- {
- if (addButton.domNode.children[0].files)
- {
- addButton.set("disabled", true);
- var file = addButton.domNode.children[0].files[0];
- var fileReader = new FileReader();
- fileReader.onload = function (evt)
- {
- var result = fileReader.result;
- if (result.indexOf("-----BEGIN CERTIFICATE-----") != -1)
- {
- uploadCertificate(result);
-
- }
- else
- {
- fileReader.onload = function (evt)
- {
- var binresult = fileReader.result;
- binresult = binresult.substring(binresult.indexOf(",") + 1);
- uploadCertificate(binresult);
- };
- fileReader.readAsDataURL(file);
- }
- };
- fileReader.readAsText(file);
- }
- }
-
- if (window.FileReader)
- {
- this.addButton.on("change", onFileSelected);
- }
- else
- {
- this.addButton.set("disabled", true);
- this.addButton.domNode.style.display = "none";
- }
-
}
- ManagedCertificateStore.prototype.removeCertificates = function ()
- {
- var data = this.certificatesGrid.grid.selection.getSelected();
-
- if (data.length)
- {
- this.removeButton.set("disabled", true);
- var parentModelObj = this.modelObj;
- var modelObj = {
- type: parentModelObj.type,
- name: "removeCertificates",
- parent: parentModelObj
- };
- var items = [];
- for (var i = 0; i < data.length; i++)
- {
- var parts = data[i].id.split("|");
- items.push({
- issuerName: parts[1],
- serialNumber: parts[0]
- });
- }
- var url = this.management.buildObjectURL(modelObj);
- this.management.post({url: url}, {certificates: items})
- .then(null, management.xhrErrorHandler)
- .always(lang.hitch(this, function ()
- {
- this.removeButton.set("disabled", false);
- }));
- }
- };
-
ManagedCertificateStore.prototype.update = function (data)
{
util.updateUI(data, this.fields, this);
- this.certificates = addIdToCertificates(data);
- this.certificatesGrid.update(this.certificates)
};
return ManagedCertificateStore;
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js
index 401343c..e670f57 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/nonjavatruststore/show.js
@@ -17,8 +17,8 @@
* under the License.
*/
-define(["dojo/query", "qpid/common/util", "dojox/grid/DataGrid", "qpid/common/UpdatableStore", "dojo/domReady!"],
- function (query, util, DataGrid, UpdatableStore)
+define(["dojo/query", "qpid/common/util", "dojo/domReady!"],
+ function (query, util)
{
function NonJavaTrustStore(data)
@@ -38,50 +38,13 @@ define(["dojo/query", "qpid/common/util", "dojox/grid/DataGrid", "qpid/common/Up
this,
function ()
{
- var gridNode = query(".details", data.containerNode)[0];
- var dateTimeFormatter = function (value)
- {
- return value ? that.management.userPreferences.formatDateTime(value, {
- addOffset: true,
- appendTimeZone: true
- }) : "";
- };
- that.detailsGrid = new UpdatableStore([], gridNode, [{
- name: 'Subject',
- field: 'SUBJECT_NAME',
- width: '25%'
- }, {
- name: 'Issuer',
- field: 'ISSUER_NAME',
- width: '25%'
- }, {
- name: 'Valid from',
- field: 'VALID_START',
- width: '25%',
- formatter: dateTimeFormatter
- }, {
- name: 'Valid to',
- field: 'VALID_END',
- width: '25%',
- formatter: dateTimeFormatter
- }]);
});
}
NonJavaTrustStore.prototype.update = function (data)
{
util.updateUI(data, this.fields, this);
- var details = data.certificateDetails;
- for (var i = 0; i < details.length; i++)
- {
- details[i].id =
- details[i].SUBJECT_NAME + "_" + details[i].ISSUER_NAME + "_" + details[i].VALID_START + "_"
- + details[i].VALID_END;
- }
- this.detailsGrid.grid.beginUpdate();
- this.detailsGrid.update(details);
- this.detailsGrid.grid.endUpdate();
- }
+ };
return NonJavaTrustStore;
});
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/showTrustStore.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/showTrustStore.html b/broker-plugins/management-http/src/main/java/resources/showTrustStore.html
index 5a60788..6ff04ce 100644
--- a/broker-plugins/management-http/src/main/java/resources/showTrustStore.html
+++ b/broker-plugins/management-http/src/main/java/resources/showTrustStore.html
@@ -39,6 +39,9 @@
<div class="typeFieldsContainer"></div>
</div>
<div class="clear">
+ <div class="managedCertificatesGrid"></div>
+ </div>
+ <div class="clear">
</div>
</div>
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/store/CertificateGridWidget.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/store/CertificateGridWidget.html b/broker-plugins/management-http/src/main/java/resources/store/CertificateGridWidget.html
new file mode 100644
index 0000000..11cbe1c
--- /dev/null
+++ b/broker-plugins/management-http/src/main/java/resources/store/CertificateGridWidget.html
@@ -0,0 +1,34 @@
+<!--
+ ~
+ ~ 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.
+ ~
+ -->
+<div>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Certificates'" class="clear">
+ <div data-dojo-attach-point="certificatesGridContainer"></div>
+ <div class="clear dijitHidden" data-dojo-attach-point="certificateControls">
+ <button data-dojo-attach-point="removeCertificateButton" data-dojo-type="dijit.form.Button"
+ class="removeCertificates">Remove Certificates
+ </button>
+ <input name="addCertificate" type="file" class="addCertificate"
+ data-dojo-attach-point="certificateUploader"
+ data-dojo-type="dojox/form/Uploader"
+ data-dojo-props="label: 'Add Certificate'"/>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/show.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/show.html b/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/show.html
index 5cb1321..8fc837e 100644
--- a/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/show.html
+++ b/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/show.html
@@ -19,18 +19,5 @@
<div>
<div class="clear"></div>
- <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Certificates'" class="clear managedCertificatesGridPanel">
- <div class="managedCertificatesGrid hidden"></div>
- <div class="clear">
- <button data-dojo-type="dijit.form.Button" class="removeCertificates">Remove Certificates</button>
- <span data-dojo-attach-point="blah"></span>
- <input name="addCertificate" type="file" id="uploader" class="addCertificate"
- data-dojo-attach-point="uploader"
- data-dojo-type="dojox/form/Uploader"
- data-dojo-props="label: 'Add Certificate'"/>
-
- </div>
- </div>
- <div class="clear"></div>
</div>
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/store/nonjavatruststore/show.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/store/nonjavatruststore/show.html b/broker-plugins/management-http/src/main/java/resources/store/nonjavatruststore/show.html
index b45f457..2b532d7 100644
--- a/broker-plugins/management-http/src/main/java/resources/store/nonjavatruststore/show.html
+++ b/broker-plugins/management-http/src/main/java/resources/store/nonjavatruststore/show.html
@@ -23,9 +23,5 @@
<div><span class="certificatesUrl" ></span></div>
</div>
<div class="clear"></div>
- <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Certificate details'" class="detailsGridPanel">
- <div class="details"></div>
- </div>
- <div></div>
</div>
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/391f0b81/broker-plugins/management-http/src/main/java/resources/store/sitespecifictruststore/show.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/store/sitespecifictruststore/show.html b/broker-plugins/management-http/src/main/java/resources/store/sitespecifictruststore/show.html
index 8466bcd..c1ad631 100644
--- a/broker-plugins/management-http/src/main/java/resources/store/sitespecifictruststore/show.html
+++ b/broker-plugins/management-http/src/main/java/resources/store/sitespecifictruststore/show.html
@@ -22,31 +22,6 @@
<div class="formLabel-labelCell">Site URL:</div>
<div ><span class="siteUrl" ></span></div>
</div>
- <div class="clear">
- <div class="formLabel-labelCell">Issuer:</div>
- <div><span class="certificateIssuer" ></span></div>
- </div>
- <div class="clear">
- <div class="formLabel-labelCell">Serial No.:</div>
- <div><span class="certificateSerialNumber" ></span></div>
- </div>
- <div class="clear">
- <div class="formLabel-labelCell">Subject:</div>
- <div><span class="certificateSubject" ></span></div>
- </div>
- <div class="clear">
- <div class="formLabel-labelCell">Valid From:</div>
- <div><span class="certificateValidFromDate datetime" ></span></div>
- </div>
- <div class="clear">
- <div class="formLabel-labelCell">Valid Until:</div>
- <div><span class="certificateValidUntilDate datetime" ></span></div>
- </div>
- <div class="clear">
- <div class="formLabel-labelCell">Signature:</div>
- <div><span class="certificateSignature" ></span></div>
- </div>
-
<div class="clear"></div>
<div class="dijitDialogPaneActionBar">
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/6] qpid-broker-j git commit: NO-JIRA: [Java Broker] [Operational
Message Code Gen] Stabilise order of methods within generated code.
Posted by kw...@apache.org.
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
index 6488b80..6655918 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class QueueMessages
{
@@ -64,21 +64,21 @@ public class QueueMessages
public static final String QUEUE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue";
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";
public static final String DROPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.dropped";
- public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.overfull";
public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.operation";
+ 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 DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "queue.deleted";
static
{
LoggerFactory.getLogger(QUEUE_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETED_LOG_HIERARCHY);
LoggerFactory.getLogger(DROPPED_LOG_HIERARCHY);
- LoggerFactory.getLogger(OVERFULL_LOG_HIERARCHY);
LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OVERFULL_LOG_HIERARCHY);
LoggerFactory.getLogger(UNDERFULL_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETED_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Queue_logmessages", _currentLocale);
}
@@ -208,16 +208,16 @@ public class QueueMessages
/**
* Log a Queue message of the Format:
- * <pre>QUE-1005 : Dropped : {0,number} messages, Depth : {1,number} bytes, {2,number} messages, Capacity : {3,number} bytes, {4,number} messages</pre>
+ * <pre>QUE-1002 : Deleted : ID: {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DROPPED(Number param1, Number param2, Number param3, Number param4, Number param5)
+ public static LogMessage DELETED(String param1)
{
- String rawMessage = _messages.getString("DROPPED");
+ String rawMessage = _messages.getString("DELETED");
- final Object[] messageArguments = {param1, param2, param3, param4, param5};
+ 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);
@@ -235,7 +235,7 @@ public class QueueMessages
@Override
public String getLogHierarchy()
{
- return DROPPED_LOG_HIERARCHY;
+ return DELETED_LOG_HIERARCHY;
}
@Override
@@ -268,16 +268,16 @@ public class QueueMessages
/**
* Log a Queue message of the Format:
- * <pre>QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,number}</pre>
+ * <pre>QUE-1005 : Dropped : {0,number} messages, Depth : {1,number} bytes, {2,number} messages, Capacity : {3,number} bytes, {4,number} messages</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OVERFULL(Number param1, Number param2, Number param3, Number param4)
+ public static LogMessage DROPPED(Number param1, Number param2, Number param3, Number param4, Number param5)
{
- String rawMessage = _messages.getString("OVERFULL");
+ String rawMessage = _messages.getString("DROPPED");
- final Object[] messageArguments = {param1, param2, param3, param4};
+ 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);
@@ -295,7 +295,7 @@ public class QueueMessages
@Override
public String getLogHierarchy()
{
- return OVERFULL_LOG_HIERARCHY;
+ return DROPPED_LOG_HIERARCHY;
}
@Override
@@ -388,14 +388,14 @@ public class QueueMessages
/**
* Log a Queue message of the Format:
- * <pre>QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,number}</pre>
+ * <pre>QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,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, Number param3, Number param4)
+ public static LogMessage OVERFULL(Number param1, Number param2, Number param3, Number param4)
{
- String rawMessage = _messages.getString("UNDERFULL");
+ String rawMessage = _messages.getString("OVERFULL");
final Object[] messageArguments = {param1, param2, param3, param4};
// Create a new MessageFormat to ensure thread safety.
@@ -415,7 +415,7 @@ public class QueueMessages
@Override
public String getLogHierarchy()
{
- return UNDERFULL_LOG_HIERARCHY;
+ return OVERFULL_LOG_HIERARCHY;
}
@Override
@@ -448,16 +448,16 @@ public class QueueMessages
/**
* Log a Queue message of the Format:
- * <pre>QUE-1002 : Deleted : ID: {0}</pre>
+ * <pre>QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}, Messages : {2,number}, Message Capacity : {3,number}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETED(String param1)
+ public static LogMessage UNDERFULL(Number param1, Number param2, Number param3, Number param4)
{
- String rawMessage = _messages.getString("DELETED");
+ String rawMessage = _messages.getString("UNDERFULL");
- final Object[] messageArguments = {param1};
+ 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);
@@ -475,7 +475,7 @@ public class QueueMessages
@Override
public String getLogHierarchy()
{
- return DELETED_LOG_HIERARCHY;
+ return UNDERFULL_LOG_HIERARCHY;
}
@Override
@@ -506,6 +506,7 @@ public class QueueMessages
};
}
+
private QueueMessages()
{
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
index d314d81..9a8980b 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/SubscriptionMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class SubscriptionMessages
{
@@ -63,39 +63,34 @@ public class SubscriptionMessages
}
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 CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.close";
public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.create";
public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.operation";
+ public static final String STATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "subscription.state";
static
{
LoggerFactory.getLogger(SUBSCRIPTION_LOG_HIERARCHY);
- LoggerFactory.getLogger(STATE_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STATE_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Subscription_logmessages", _currentLocale);
}
/**
* Log a Subscription message of the Format:
- * <pre>SUB-1003 : Suspended for {0,number} ms</pre>
+ * <pre>SUB-1002 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STATE(Number param1)
+ public static LogMessage CLOSE()
{
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -108,7 +103,7 @@ public class SubscriptionMessages
@Override
public String getLogHierarchy()
{
- return STATE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -141,16 +136,54 @@ public class SubscriptionMessages
/**
* Log a Subscription message of the Format:
- * <pre>SUB-1002 : Close</pre>
+ * <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 CLOSE()
+ public static LogMessage CREATE(String param1, boolean opt1, boolean opt2)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("CREATE");
+ StringBuffer msg = new StringBuffer();
- final String message = rawMessage;
+ // 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()
{
@@ -163,7 +196,7 @@ public class SubscriptionMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -196,47 +229,14 @@ public class SubscriptionMessages
/**
* Log a Subscription message of the Format:
- * <pre>SUB-1001 : Create[ : Durable][ : Arguments : {0}]</pre>
+ * <pre>SUB-1004 : Operation : {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)
+ public static LogMessage OPERATION(String param1)
{
- 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();
+ String rawMessage = _messages.getString("OPERATION");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -256,7 +256,7 @@ public class SubscriptionMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -289,14 +289,14 @@ public class SubscriptionMessages
/**
* Log a Subscription message of the Format:
- * <pre>SUB-1004 : Operation : {0}</pre>
+ * <pre>SUB-1003 : Suspended for {0,number} ms</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage STATE(Number param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("STATE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -316,7 +316,7 @@ public class SubscriptionMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return STATE_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
index f2ff590..40c211d 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TransactionLogMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class TransactionLogMessages
{
@@ -63,70 +63,42 @@ public class TransactionLogMessages
}
public static final String TRANSACTIONLOG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog";
- public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_start";
- public static final String XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.xa_incomplete_message";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.closed";
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 RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovered";
public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_complete";
- public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.closed";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.recovery_start";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "transactionlog.store_location";
+ 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";
static
{
LoggerFactory.getLogger(TRANSACTIONLOG_LOG_HIERARCHY);
- LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
- LoggerFactory.getLogger(XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
- LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(RECOVERED_LOG_HIERARCHY);
LoggerFactory.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY);
LoggerFactory.getLogger(XA_INCOMPLETE_QUEUE_LOG_HIERARCHY);
- LoggerFactory.getLogger(RECOVERED_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.TransactionLog_logmessages", _currentLocale);
}
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1004 : Recovery Start[ : {0}]</pre>
+ * <pre>TXN-1003 : Closed</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)
+ public static LogMessage CLOSED()
{
- 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);
+ String rawMessage = _messages.getString("CLOSED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -139,7 +111,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_START_LOG_HIERARCHY;
+ return CLOSED_LOG_HIERARCHY;
}
@Override
@@ -172,21 +144,16 @@ public class TransactionLogMessages
/**
* 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>
+ * <pre>TXN-1001 : Created</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)
+ public static LogMessage CREATED()
{
- 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);
+ String rawMessage = _messages.getString("CREATED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -199,7 +166,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY;
+ return CREATED_LOG_HIERARCHY;
}
@Override
@@ -232,16 +199,21 @@ public class TransactionLogMessages
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1001 : Created</pre>
+ * <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 CREATED()
+ public static LogMessage RECOVERED(Number param1, String param2)
{
- String rawMessage = _messages.getString("CREATED");
+ String rawMessage = _messages.getString("RECOVERED");
- final String message = rawMessage;
+ 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()
{
@@ -254,7 +226,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return CREATED_LOG_HIERARCHY;
+ return RECOVERED_LOG_HIERARCHY;
}
@Override
@@ -287,14 +259,37 @@ public class TransactionLogMessages
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1002 : Store location : {0}</pre>
+ * <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 STORE_LOCATION(String param1)
+ public static LogMessage RECOVERY_COMPLETE(String param1, boolean opt1)
{
- String rawMessage = _messages.getString("STORE_LOCATION");
+ 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.
@@ -314,7 +309,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return STORE_LOCATION_LOG_HIERARCHY;
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
}
@Override
@@ -347,14 +342,14 @@ public class TransactionLogMessages
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1006 : Recovery Complete[ : {0}]</pre>
+ * <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_COMPLETE(String param1, boolean opt1)
+ public static LogMessage RECOVERY_START(String param1, boolean opt1)
{
- String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+ String rawMessage = _messages.getString("RECOVERY_START");
StringBuffer msg = new StringBuffer();
// Split the formatted message up on the option values so we can
@@ -397,7 +392,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ return RECOVERY_START_LOG_HIERARCHY;
}
@Override
@@ -430,16 +425,21 @@ public class TransactionLogMessages
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1003 : Closed</pre>
+ * <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 CLOSED()
+ public static LogMessage STORE_LOCATION(String param1)
{
- String rawMessage = _messages.getString("CLOSED");
+ String rawMessage = _messages.getString("STORE_LOCATION");
- final String message = rawMessage;
+ 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()
{
@@ -452,7 +452,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return CLOSED_LOG_HIERARCHY;
+ return STORE_LOCATION_LOG_HIERARCHY;
}
@Override
@@ -485,14 +485,14 @@ public class TransactionLogMessages
/**
* 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>
+ * <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_QUEUE(String param1, String param2)
+ public static LogMessage XA_INCOMPLETE_MESSAGE(String param1, String param2)
{
- String rawMessage = _messages.getString("XA_INCOMPLETE_QUEUE");
+ String rawMessage = _messages.getString("XA_INCOMPLETE_MESSAGE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -512,7 +512,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return XA_INCOMPLETE_QUEUE_LOG_HIERARCHY;
+ return XA_INCOMPLETE_MESSAGE_LOG_HIERARCHY;
}
@Override
@@ -545,14 +545,14 @@ public class TransactionLogMessages
/**
* Log a TransactionLog message of the Format:
- * <pre>TXN-1005 : Recovered {0,number} messages for queue {1}</pre>
+ * <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 RECOVERED(Number param1, String param2)
+ public static LogMessage XA_INCOMPLETE_QUEUE(String param1, String param2)
{
- String rawMessage = _messages.getString("RECOVERED");
+ String rawMessage = _messages.getString("XA_INCOMPLETE_QUEUE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -572,7 +572,7 @@ public class TransactionLogMessages
@Override
public String getLogHierarchy()
{
- return RECOVERED_LOG_HIERARCHY;
+ return XA_INCOMPLETE_QUEUE_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
index 2c0600c..d3315dc 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of TrustStore_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class TrustStoreMessages
{
@@ -63,41 +63,36 @@ public class TrustStoreMessages
}
public static final String TRUSTSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore";
- public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.delete";
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.close";
public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.create";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.operation";
+ public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.delete";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.operation";
static
{
LoggerFactory.getLogger(TRUSTSTORE_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.TrustStore_logmessages", _currentLocale);
}
/**
* Log a TrustStore message of the Format:
- * <pre>TST-1004 : Delete "{0}"</pre>
+ * <pre>TST-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1)
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("DELETE");
-
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -110,7 +105,7 @@ public class TrustStoreMessages
@Override
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -143,16 +138,21 @@ public class TrustStoreMessages
/**
* Log a TrustStore message of the Format:
- * <pre>TST-1003 : Close</pre>
+ * <pre>TST-1001 : Create "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage CREATE(String param1)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("CREATE");
- final String message = rawMessage;
+ 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()
{
@@ -165,7 +165,7 @@ public class TrustStoreMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -198,14 +198,14 @@ public class TrustStoreMessages
/**
* Log a TrustStore message of the Format:
- * <pre>TST-1001 : Create "{0}"</pre>
+ * <pre>TST-1004 : Delete "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATE(String param1)
+ public static LogMessage DELETE(String param1)
{
- String rawMessage = _messages.getString("CREATE");
+ String rawMessage = _messages.getString("DELETE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -225,7 +225,7 @@ public class TrustStoreMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -258,21 +258,16 @@ public class TrustStoreMessages
/**
* Log a TrustStore message of the Format:
- * <pre>TST-1005 : Operation : {0}</pre>
+ * <pre>TST-1002 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage OPEN()
{
- String rawMessage = _messages.getString("OPERATION");
-
- 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);
+ String rawMessage = _messages.getString("OPEN");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -285,7 +280,7 @@ public class TrustStoreMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -318,16 +313,21 @@ public class TrustStoreMessages
/**
* Log a TrustStore message of the Format:
- * <pre>TST-1002 : Open</pre>
+ * <pre>TST-1005 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("OPERATION");
- final String message = rawMessage;
+ 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()
{
@@ -340,7 +340,7 @@ public class TrustStoreMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
index 39761d8..7350504 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/VirtualHostMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class VirtualHostMessages
{
@@ -63,25 +63,25 @@ public class VirtualHostMessages
}
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 CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.created";
- public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_data";
public static final String ERRORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.errored";
- public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.closed";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.operation";
public static final String FILESYSTEM_FULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.filesystem_full";
public static final String FILESYSTEM_NOTFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.filesystem_notfull";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.operation";
+ public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_data";
public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "virtualhost.stats_msgs";
static
{
LoggerFactory.getLogger(VIRTUALHOST_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
- LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
LoggerFactory.getLogger(ERRORED_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(FILESYSTEM_FULL_LOG_HIERARCHY);
LoggerFactory.getLogger(FILESYSTEM_NOTFULL_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.VirtualHost_logmessages", _currentLocale);
@@ -89,14 +89,14 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1001 : Created : {0}</pre>
+ * <pre>VHT-1002 : Closed : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATED(String param1)
+ public static LogMessage CLOSED(String param1)
{
- String rawMessage = _messages.getString("CREATED");
+ String rawMessage = _messages.getString("CLOSED");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -116,7 +116,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return CREATED_LOG_HIERARCHY;
+ return CLOSED_LOG_HIERARCHY;
}
@Override
@@ -149,16 +149,16 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1003 : {0} : {1,choice,0#delivered|1#received} : {2,number,#.###} kB/s peak : {3,number,#} bytes total</pre>
+ * <pre>VHT-1001 : Created : {0}</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)
+ public static LogMessage CREATED(String param1)
{
- String rawMessage = _messages.getString("STATS_DATA");
+ String rawMessage = _messages.getString("CREATED");
- final Object[] messageArguments = {param1, param2, param3, param4};
+ 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);
@@ -176,7 +176,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return STATS_DATA_LOG_HIERARCHY;
+ return CREATED_LOG_HIERARCHY;
}
@Override
@@ -269,14 +269,14 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1002 : Closed : {0}</pre>
+ * <pre>VHT-1006 : Filesystem is over {0,number} per cent full, enforcing flow control.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSED(String param1)
+ public static LogMessage FILESYSTEM_FULL(Number param1)
{
- String rawMessage = _messages.getString("CLOSED");
+ String rawMessage = _messages.getString("FILESYSTEM_FULL");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -296,7 +296,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return CLOSED_LOG_HIERARCHY;
+ return FILESYSTEM_FULL_LOG_HIERARCHY;
}
@Override
@@ -329,14 +329,14 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1008 : Operation : {0}</pre>
+ * <pre>VHT-1007 : Filesystem is no longer over {0,number} per cent full.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage FILESYSTEM_NOTFULL(Number param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("FILESYSTEM_NOTFULL");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -356,7 +356,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return FILESYSTEM_NOTFULL_LOG_HIERARCHY;
}
@Override
@@ -389,14 +389,14 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1006 : Filesystem is over {0,number} per cent full, enforcing flow control.</pre>
+ * <pre>VHT-1008 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FILESYSTEM_FULL(Number param1)
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("FILESYSTEM_FULL");
+ String rawMessage = _messages.getString("OPERATION");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -416,7 +416,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return FILESYSTEM_FULL_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -449,16 +449,16 @@ public class VirtualHostMessages
/**
* Log a VirtualHost message of the Format:
- * <pre>VHT-1007 : Filesystem is no longer over {0,number} per cent full.</pre>
+ * <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 FILESYSTEM_NOTFULL(Number param1)
+ public static LogMessage STATS_DATA(String param1, Number param2, Number param3, Number param4)
{
- String rawMessage = _messages.getString("FILESYSTEM_NOTFULL");
+ String rawMessage = _messages.getString("STATS_DATA");
- final Object[] messageArguments = {param1};
+ 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);
@@ -476,7 +476,7 @@ public class VirtualHostMessages
@Override
public String getLogHierarchy()
{
- return FILESYSTEM_NOTFULL_LOG_HIERARCHY;
+ return STATS_DATA_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java b/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
index a10d3b6..3df084c 100644
--- a/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
+++ b/broker-core/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
@@ -32,6 +32,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
+import java.util.TreeSet;
+import java.util.Set;
import java.util.ResourceBundle;
public class GenerateLogMessages
@@ -283,7 +285,7 @@ public class GenerateLogMessages
private HashMap<String, Object> prepareType(String messsageName, ResourceBundle messages) throws InvalidTypeException
{
// Load the LogMessages Resource Bundle
- Enumeration<String> messageKeys = messages.getKeys();
+ Set<String> messageKeys = new TreeSet<>(messages.keySet());
//Create the return map
HashMap<String, Object> messageTypeData = new HashMap<String, Object>();
@@ -295,13 +297,10 @@ public class GenerateLogMessages
messageTypeData.put("list", logMessageList);
//Process each of the properties
- while (messageKeys.hasMoreElements())
+ for(String message : messageKeys)
{
HashMap<String, Object> logEntryData = new HashMap<String, Object>();
- //Add MessageName to amp
- String message = messageKeys.nextElement();
-
// Process the log message if it matches the specified key e.g.'BRK_'
if (!message.equals("package"))
{
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
----------------------------------------------------------------------
diff --git a/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm b/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
index fac00a9..ecc06f8 100644
--- a/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
+++ b/broker-core/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
@@ -22,21 +22,21 @@ package ${package};
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of ${type.name}_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ${type.name}Messages
{
@@ -184,11 +184,13 @@ public class ${type.name}Messages
return new LogMessage()
{
+ @Override
public String toString()
{
return message;
}
+ @Override
public String getLogHierarchy()
{
return ${message.methodName.toUpperCase()}_LOG_HIERARCHY;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[5/6] qpid-broker-j git commit: NO-JIRA: Switch JSON split store
profiles to test BDB rather than Derby
Posted by kw...@apache.org.
NO-JIRA: Switch JSON split store profiles to test BDB rather than Derby
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/90e22516
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/90e22516
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/90e22516
Branch: refs/heads/master
Commit: 90e225163ff3d60019c972e8763bf9433d4d698b
Parents: 47ac14c
Author: Keith Wall <kw...@apache.org>
Authored: Fri Jul 28 14:35:27 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Sun Jul 30 18:07:22 2017 +0100
----------------------------------------------------------------------
pom.xml | 16 ++++++++--------
.../qpid/client/TemporaryQueuePrefixTest.java | 8 --------
2 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/90e22516/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 13b1f48..ef7279f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1198,6 +1198,11 @@
</properties>
</profile>
+ <!--
+ Split store profiles.
+ Virtual host configuration can be overridden by setting blueprint property like below
+ -Dprofile.virtualhostnode.context.blueprint='{"type":"BDB","storePath":"${qpid.work_dir}/${this:name}/bdb"}'
+ -->
<profile>
<id>java-json.1-0</id>
<activation>
@@ -1213,16 +1218,11 @@
<profile.test.amqp_port_protocols>["AMQP_1_0"]</profile.test.amqp_port_protocols>
<profile.broker.persistent>true</profile.broker.persistent>
<profile.virtualhostnode.type>JSON</profile.virtualhostnode.type>
- <profile.virtualhostnode.context.blueprint>{"type":"DERBY","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
+ <profile.virtualhostnode.context.blueprint>{"type":"BDB","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
<profile.java.naming.factory.initial>org.apache.qpid.jms.jndi.JmsInitialContextFactory</profile.java.naming.factory.initial>
<profile.java.naming.provider.url>test-profiles${file.separator}test-provider-1-0.properties</profile.java.naming.provider.url>
</properties>
</profile>
- <!--
- Split store profiles.
- Virtual host configuration can be overridden by setting blueprint property like below
- -Dprofile.virtualhostnode.context.blueprint='{"type":"BDB","storePath":"${qpid.work_dir}/${this:name}/bdb"}'
- -->
<profile>
<id>java-json.0-9-1</id>
<activation>
@@ -1238,7 +1238,7 @@
<profile.test.amqp_port_protocols>["AMQP_0_8","AMQP_0_9","AMQP_0_9_1"]</profile.test.amqp_port_protocols>
<profile.broker.persistent>true</profile.broker.persistent>
<profile.virtualhostnode.type>JSON</profile.virtualhostnode.type>
- <profile.virtualhostnode.context.blueprint>{"type":"DERBY","storePath":"${dollar.sign}{json:qpid.work_dir}${dollar.sign}{json:file.separator}${dollar.sign}{this:name}${dollar.sign}{json:file.separator}derby","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
+ <profile.virtualhostnode.context.blueprint>{"type":"BDB","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
</properties>
</profile>
@@ -1257,7 +1257,7 @@
<profile.test.amqp_port_protocols>["AMQP_0_8","AMQP_0_9","AMQP_0_9_1","AMQP_0_10"]</profile.test.amqp_port_protocols>
<profile.broker.persistent>true</profile.broker.persistent>
<profile.virtualhostnode.type>JSON</profile.virtualhostnode.type>
- <profile.virtualhostnode.context.blueprint>{"type":"DERBY","storePath":"${dollar.sign}{json:qpid.work_dir}${dollar.sign}{json:file.separator}${dollar.sign}{this:name}${dollar.sign}{json:file.separator}derby","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
+ <profile.virtualhostnode.context.blueprint>{"type":"BDB","globalAddressDomains":"${dollar.sign}{qpid.globalAddressDomains}"}</profile.virtualhostnode.context.blueprint>
</properties>
</profile>
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/90e22516/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
----------------------------------------------------------------------
diff --git a/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java b/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
index ec57351..f71f45d 100644
--- a/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
+++ b/systests/src/test/java/org/apache/qpid/client/TemporaryQueuePrefixTest.java
@@ -29,14 +29,6 @@ import javax.jms.TemporaryQueue;
public class TemporaryQueuePrefixTest extends QpidBrokerTestCase
{
@Override
- protected void setUp() throws Exception
- {
- super.setUp();
- // FIXME: This seems to be necessary to run this test from IntelliJ. Otherwise the context var ${qpid.globalAddressDomains} in the blueprint will be expanded. Not sure why.
- setTestSystemProperty("virtualhostnode.context.blueprint", "{\"type\":\"ProvidedStore\",\"globalAddressDomains\":\"${qpid.globalAddressDomains}\"}");
- }
-
- @Override
public void startDefaultBroker() throws Exception
{
// deliberately don't start broker
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[3/6] qpid-broker-j git commit: NO-JIRA: [Java Broker] [Operational
Message Code Gen] Stabilise order of methods within generated code.
Posted by kw...@apache.org.
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
index 337a388..7708ce7 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConnectionMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ConnectionMessages
{
@@ -63,94 +63,34 @@ public class ConnectionMessages
}
public static final String CONNECTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.operation";
public static final String CLIENT_VERSION_LOG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.client_version_log";
public static final String CLIENT_VERSION_REJECT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.client_version_reject";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.close";
public static final String DROPPED_CONNECTION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.dropped_connection";
- public static final String MODEL_DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.model_delete";
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";
public static final String LARGE_TRANSACTION_WARN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.large_transaction_warn";
+ public static final String MODEL_DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.model_delete";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "connection.operation";
static
{
LoggerFactory.getLogger(CONNECTION_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(CLIENT_VERSION_LOG_LOG_HIERARCHY);
LoggerFactory.getLogger(CLIENT_VERSION_REJECT_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(DROPPED_CONNECTION_LOG_HIERARCHY);
- LoggerFactory.getLogger(MODEL_DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(IDLE_CLOSE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(LARGE_TRANSACTION_WARN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(MODEL_DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Connection_logmessages", _currentLocale);
}
/**
* Log a Connection message of the Format:
- * <pre>CON-1008 : Operation : {0}</pre>
- * Optional values are contained in [square brackets] and are numbered
- * sequentially in the method call.
- *
- */
- public static LogMessage OPERATION(String param1)
- {
- String rawMessage = _messages.getString("OPERATION");
-
- 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()
- {
- @Override
- public String toString()
- {
- return message;
- }
-
- @Override
- public String getLogHierarchy()
- {
- return OPERATION_LOG_HIERARCHY;
- }
-
- @Override
- public boolean equals(final Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- final LogMessage that = (LogMessage) o;
-
- return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
-
- }
-
- @Override
- public int hashCode()
- {
- int result = toString().hashCode();
- result = 31 * result + getLogHierarchy().hashCode();
- return result;
- }
- };
- }
-
- /**
- * Log a Connection message of the Format:
* <pre>CON-1005 : Client version "{0}" logged by validation</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
@@ -271,14 +211,14 @@ public class ConnectionMessages
/**
* Log a Connection message of the Format:
- * <pre>CON-1004 : Connection dropped</pre>
+ * <pre>CON-1002 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DROPPED_CONNECTION()
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("DROPPED_CONNECTION");
+ String rawMessage = _messages.getString("CLOSE");
final String message = rawMessage;
@@ -293,7 +233,7 @@ public class ConnectionMessages
@Override
public String getLogHierarchy()
{
- return DROPPED_CONNECTION_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -326,14 +266,14 @@ public class ConnectionMessages
/**
* Log a Connection message of the Format:
- * <pre>CON-1007 : Connection close initiated by operator</pre>
+ * <pre>CON-1004 : Connection dropped</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage MODEL_DELETE()
+ public static LogMessage DROPPED_CONNECTION()
{
- String rawMessage = _messages.getString("MODEL_DELETE");
+ String rawMessage = _messages.getString("DROPPED_CONNECTION");
final String message = rawMessage;
@@ -348,7 +288,7 @@ public class ConnectionMessages
@Override
public String getLogHierarchy()
{
- return MODEL_DELETE_LOG_HIERARCHY;
+ return DROPPED_CONNECTION_LOG_HIERARCHY;
}
@Override
@@ -464,16 +404,21 @@ public class ConnectionMessages
/**
* Log a Connection message of the Format:
- * <pre>CON-1002 : Close</pre>
+ * <pre>CON-1009 : Uncommitted transaction(s) contains {0,number} bytes of incoming message data exceeding {1,number} bytes limit. Messages will be flowed to disk.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage LARGE_TRANSACTION_WARN(Number param1, Number param2)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("LARGE_TRANSACTION_WARN");
- final String message = rawMessage;
+ 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()
{
@@ -486,7 +431,7 @@ public class ConnectionMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return LARGE_TRANSACTION_WARN_LOG_HIERARCHY;
}
@Override
@@ -519,21 +464,16 @@ public class ConnectionMessages
/**
* Log a Connection message of the Format:
- * <pre>CON-1009 : Uncommitted transaction(s) contains {0,number} bytes of incoming message data exceeding {1,number} bytes limit. Messages will be flowed to disk.</pre>
+ * <pre>CON-1007 : Connection close initiated by operator</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage LARGE_TRANSACTION_WARN(Number param1, Number param2)
+ public static LogMessage MODEL_DELETE()
{
- String rawMessage = _messages.getString("LARGE_TRANSACTION_WARN");
-
- 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);
+ String rawMessage = _messages.getString("MODEL_DELETE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -546,7 +486,7 @@ public class ConnectionMessages
@Override
public String getLogHierarchy()
{
- return LARGE_TRANSACTION_WARN_LOG_HIERARCHY;
+ return MODEL_DELETE_LOG_HIERARCHY;
}
@Override
@@ -690,6 +630,66 @@ public class ConnectionMessages
};
}
+ /**
+ * Log a Connection message of the Format:
+ * <pre>CON-1008 : Operation : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OPERATION(String param1)
+ {
+ String rawMessage = _messages.getString("OPERATION");
+
+ 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()
+ {
+ @Override
+ public String toString()
+ {
+ return message;
+ }
+
+ @Override
+ public String getLogHierarchy()
+ {
+ return OPERATION_LOG_HIERARCHY;
+ }
+
+ @Override
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final LogMessage that = (LogMessage) o;
+
+ return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
+
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = toString().hashCode();
+ result = 31 * result + getLogHierarchy().hashCode();
+ return result;
+ }
+ };
+ }
+
private ConnectionMessages()
{
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
index 4cd7627..aa1cb38 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ExchangeMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ExchangeMessages
{
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/HighAvailabilityMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/HighAvailabilityMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/HighAvailabilityMessages.java
index 4674797..7c4c2e5 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/HighAvailabilityMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/HighAvailabilityMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of HighAvailability_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class HighAvailabilityMessages
{
@@ -63,52 +63,52 @@ public class HighAvailabilityMessages
}
public static final String HIGHAVAILABILITY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability";
- public static final String LEFT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.left";
- public static final String PRIORITY_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.priority_changed";
- public static final String ROLE_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.role_changed";
- public static final String JOINED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.joined";
- public static final String NODE_ROLLEDBACK_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.node_rolledback";
+ public static final String ADDED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.added";
+ public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.created";
public static final String DELETED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.deleted";
- public static final String INTRUDER_DETECTED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.intruder_detected";
public static final String DESIGNATED_PRIMARY_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.designated_primary_changed";
- public static final String QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.quorum_override_changed";
- public static final String CREATED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.created";
- public static final String ADDED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.added";
+ public static final String INTRUDER_DETECTED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.intruder_detected";
+ public static final String JOINED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.joined";
+ public static final String LEFT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.left";
+ public static final String NODE_ROLLEDBACK_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.node_rolledback";
+ public static final String PRIORITY_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.priority_changed";
public static final String QUORUM_LOST_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.quorum_lost";
- public static final String TRANSFER_MASTER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.transfer_master";
+ public static final String QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.quorum_override_changed";
public static final String REMOVED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.removed";
+ public static final String ROLE_CHANGED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.role_changed";
+ public static final String TRANSFER_MASTER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "highavailability.transfer_master";
static
{
LoggerFactory.getLogger(HIGHAVAILABILITY_LOG_HIERARCHY);
- LoggerFactory.getLogger(LEFT_LOG_HIERARCHY);
- LoggerFactory.getLogger(PRIORITY_CHANGED_LOG_HIERARCHY);
- LoggerFactory.getLogger(ROLE_CHANGED_LOG_HIERARCHY);
- LoggerFactory.getLogger(JOINED_LOG_HIERARCHY);
- LoggerFactory.getLogger(NODE_ROLLEDBACK_LOG_HIERARCHY);
+ LoggerFactory.getLogger(ADDED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
LoggerFactory.getLogger(DELETED_LOG_HIERARCHY);
- LoggerFactory.getLogger(INTRUDER_DETECTED_LOG_HIERARCHY);
LoggerFactory.getLogger(DESIGNATED_PRIMARY_CHANGED_LOG_HIERARCHY);
- LoggerFactory.getLogger(QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
- LoggerFactory.getLogger(ADDED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(INTRUDER_DETECTED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(JOINED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(LEFT_LOG_HIERARCHY);
+ LoggerFactory.getLogger(NODE_ROLLEDBACK_LOG_HIERARCHY);
+ LoggerFactory.getLogger(PRIORITY_CHANGED_LOG_HIERARCHY);
LoggerFactory.getLogger(QUORUM_LOST_LOG_HIERARCHY);
- LoggerFactory.getLogger(TRANSFER_MASTER_LOG_HIERARCHY);
+ LoggerFactory.getLogger(QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY);
LoggerFactory.getLogger(REMOVED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(ROLE_CHANGED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(TRANSFER_MASTER_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.HighAvailability_logmessages", _currentLocale);
}
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1006 : Left : Node : ''{0}'' ({1})</pre>
+ * <pre>HA-1003 : Added : Node : ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage LEFT(String param1, String param2)
+ public static LogMessage ADDED(String param1, String param2)
{
- String rawMessage = _messages.getString("LEFT");
+ String rawMessage = _messages.getString("ADDED");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -128,7 +128,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return LEFT_LOG_HIERARCHY;
+ return ADDED_LOG_HIERARCHY;
}
@Override
@@ -161,21 +161,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1012 : Priority : {0}</pre>
+ * <pre>HA-1001 : Created</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage PRIORITY_CHANGED(String param1)
+ public static LogMessage CREATED()
{
- String rawMessage = _messages.getString("PRIORITY_CHANGED");
-
- 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);
+ String rawMessage = _messages.getString("CREATED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -188,7 +183,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return PRIORITY_CHANGED_LOG_HIERARCHY;
+ return CREATED_LOG_HIERARCHY;
}
@Override
@@ -221,21 +216,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1010 : Role change reported: Node : ''{0}'' ({1}) : from ''{2}'' to ''{3}''</pre>
+ * <pre>HA-1002 : Deleted</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage ROLE_CHANGED(String param1, String param2, String param3, String param4)
+ public static LogMessage DELETED()
{
- String rawMessage = _messages.getString("ROLE_CHANGED");
-
- 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);
+ String rawMessage = _messages.getString("DELETED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -248,7 +238,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return ROLE_CHANGED_LOG_HIERARCHY;
+ return DELETED_LOG_HIERARCHY;
}
@Override
@@ -281,16 +271,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1005 : Joined : Node : ''{0}'' ({1})</pre>
+ * <pre>HA-1013 : Designated primary : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage JOINED(String param1, String param2)
+ public static LogMessage DESIGNATED_PRIMARY_CHANGED(String param1)
{
- String rawMessage = _messages.getString("JOINED");
+ String rawMessage = _messages.getString("DESIGNATED_PRIMARY_CHANGED");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -308,7 +298,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return JOINED_LOG_HIERARCHY;
+ return DESIGNATED_PRIMARY_CHANGED_LOG_HIERARCHY;
}
@Override
@@ -341,16 +331,21 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1014 : Diverged transactions discarded</pre>
+ * <pre>HA-1008 : Intruder detected : Node ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage NODE_ROLLEDBACK()
+ public static LogMessage INTRUDER_DETECTED(String param1, String param2)
{
- String rawMessage = _messages.getString("NODE_ROLLEDBACK");
+ String rawMessage = _messages.getString("INTRUDER_DETECTED");
- final String message = rawMessage;
+ 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()
{
@@ -363,7 +358,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return NODE_ROLLEDBACK_LOG_HIERARCHY;
+ return INTRUDER_DETECTED_LOG_HIERARCHY;
}
@Override
@@ -396,16 +391,21 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1002 : Deleted</pre>
+ * <pre>HA-1005 : Joined : Node : ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETED()
+ public static LogMessage JOINED(String param1, String param2)
{
- String rawMessage = _messages.getString("DELETED");
+ String rawMessage = _messages.getString("JOINED");
- final String message = rawMessage;
+ 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()
{
@@ -418,7 +418,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return DELETED_LOG_HIERARCHY;
+ return JOINED_LOG_HIERARCHY;
}
@Override
@@ -451,14 +451,14 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1008 : Intruder detected : Node ''{0}'' ({1})</pre>
+ * <pre>HA-1006 : Left : Node : ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage INTRUDER_DETECTED(String param1, String param2)
+ public static LogMessage LEFT(String param1, String param2)
{
- String rawMessage = _messages.getString("INTRUDER_DETECTED");
+ String rawMessage = _messages.getString("LEFT");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -478,7 +478,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return INTRUDER_DETECTED_LOG_HIERARCHY;
+ return LEFT_LOG_HIERARCHY;
}
@Override
@@ -511,21 +511,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1013 : Designated primary : {0}</pre>
+ * <pre>HA-1014 : Diverged transactions discarded</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DESIGNATED_PRIMARY_CHANGED(String param1)
+ public static LogMessage NODE_ROLLEDBACK()
{
- String rawMessage = _messages.getString("DESIGNATED_PRIMARY_CHANGED");
-
- 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);
+ String rawMessage = _messages.getString("NODE_ROLLEDBACK");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -538,7 +533,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return DESIGNATED_PRIMARY_CHANGED_LOG_HIERARCHY;
+ return NODE_ROLLEDBACK_LOG_HIERARCHY;
}
@Override
@@ -571,14 +566,14 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1011 : Minimum group size : {0}</pre>
+ * <pre>HA-1012 : Priority : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage QUORUM_OVERRIDE_CHANGED(String param1)
+ public static LogMessage PRIORITY_CHANGED(String param1)
{
- String rawMessage = _messages.getString("QUORUM_OVERRIDE_CHANGED");
+ String rawMessage = _messages.getString("PRIORITY_CHANGED");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -598,7 +593,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY;
+ return PRIORITY_CHANGED_LOG_HIERARCHY;
}
@Override
@@ -631,14 +626,14 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1001 : Created</pre>
+ * <pre>HA-1009 : Insufficient replicas contactable</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATED()
+ public static LogMessage QUORUM_LOST()
{
- String rawMessage = _messages.getString("CREATED");
+ String rawMessage = _messages.getString("QUORUM_LOST");
final String message = rawMessage;
@@ -653,7 +648,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return CREATED_LOG_HIERARCHY;
+ return QUORUM_LOST_LOG_HIERARCHY;
}
@Override
@@ -686,16 +681,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1003 : Added : Node : ''{0}'' ({1})</pre>
+ * <pre>HA-1011 : Minimum group size : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage ADDED(String param1, String param2)
+ public static LogMessage QUORUM_OVERRIDE_CHANGED(String param1)
{
- String rawMessage = _messages.getString("ADDED");
+ String rawMessage = _messages.getString("QUORUM_OVERRIDE_CHANGED");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -713,7 +708,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return ADDED_LOG_HIERARCHY;
+ return QUORUM_OVERRIDE_CHANGED_LOG_HIERARCHY;
}
@Override
@@ -746,16 +741,21 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1009 : Insufficient replicas contactable</pre>
+ * <pre>HA-1004 : Removed : Node : ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage QUORUM_LOST()
+ public static LogMessage REMOVED(String param1, String param2)
{
- String rawMessage = _messages.getString("QUORUM_LOST");
+ String rawMessage = _messages.getString("REMOVED");
- final String message = rawMessage;
+ 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()
{
@@ -768,7 +768,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return QUORUM_LOST_LOG_HIERARCHY;
+ return REMOVED_LOG_HIERARCHY;
}
@Override
@@ -801,16 +801,16 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1007 : Master transfer requested : to ''{0}'' ({1})</pre>
+ * <pre>HA-1010 : Role change reported: Node : ''{0}'' ({1}) : from ''{2}'' to ''{3}''</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage TRANSFER_MASTER(String param1, String param2)
+ public static LogMessage ROLE_CHANGED(String param1, String param2, String param3, String param4)
{
- String rawMessage = _messages.getString("TRANSFER_MASTER");
+ String rawMessage = _messages.getString("ROLE_CHANGED");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -828,7 +828,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return TRANSFER_MASTER_LOG_HIERARCHY;
+ return ROLE_CHANGED_LOG_HIERARCHY;
}
@Override
@@ -861,14 +861,14 @@ public class HighAvailabilityMessages
/**
* Log a HighAvailability message of the Format:
- * <pre>HA-1004 : Removed : Node : ''{0}'' ({1})</pre>
+ * <pre>HA-1007 : Master transfer requested : to ''{0}'' ({1})</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage REMOVED(String param1, String param2)
+ public static LogMessage TRANSFER_MASTER(String param1, String param2)
{
- String rawMessage = _messages.getString("REMOVED");
+ String rawMessage = _messages.getString("TRANSFER_MASTER");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -888,7 +888,7 @@ public class HighAvailabilityMessages
@Override
public String getLogHierarchy()
{
- return REMOVED_LOG_HIERARCHY;
+ return TRANSFER_MASTER_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/KeyStoreMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/KeyStoreMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/KeyStoreMessages.java
index b73c53f..84f9de4 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/KeyStoreMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/KeyStoreMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of KeyStore_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class KeyStoreMessages
{
@@ -63,43 +63,38 @@ public class KeyStoreMessages
}
public static final String KEYSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore";
- public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.delete";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.close";
public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.create";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.operation";
+ public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.delete";
public static final String EXPIRING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.expiring";
- public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.close";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "keystore.operation";
static
{
LoggerFactory.getLogger(KEYSTORE_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(EXPIRING_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.KeyStore_logmessages", _currentLocale);
}
/**
* Log a KeyStore message of the Format:
- * <pre>KST-1004 : Delete "{0}"</pre>
+ * <pre>KST-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1)
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("DELETE");
-
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -112,7 +107,7 @@ public class KeyStoreMessages
@Override
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -205,14 +200,14 @@ public class KeyStoreMessages
/**
* Log a KeyStore message of the Format:
- * <pre>KST-1006 : Operation : {0}</pre>
+ * <pre>KST-1004 : Delete "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage DELETE(String param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("DELETE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -232,7 +227,7 @@ public class KeyStoreMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -325,14 +320,14 @@ public class KeyStoreMessages
/**
* Log a KeyStore message of the Format:
- * <pre>KST-1003 : Close</pre>
+ * <pre>KST-1002 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage OPEN()
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("OPEN");
final String message = rawMessage;
@@ -347,7 +342,7 @@ public class KeyStoreMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -380,16 +375,21 @@ public class KeyStoreMessages
/**
* Log a KeyStore message of the Format:
- * <pre>KST-1002 : Open</pre>
+ * <pre>KST-1006 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("OPERATION");
- final String message = rawMessage;
+ 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()
{
@@ -402,7 +402,7 @@ public class KeyStoreMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
index e02c74d..c3573c3 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ManagementConsoleMessages
{
@@ -63,38 +63,38 @@ public class ManagementConsoleMessages
}
public static final String MANAGEMENTCONSOLE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.close";
+ public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.listening";
+ public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.open";
public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.ready";
public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.shutting_down";
- public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.stopped";
- public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.listening";
public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.startup";
- public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.close";
- public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.open";
+ public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "managementconsole.stopped";
static
{
LoggerFactory.getLogger(MANAGEMENTCONSOLE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(LISTENING_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
LoggerFactory.getLogger(READY_LOG_HIERARCHY);
LoggerFactory.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
- LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
- LoggerFactory.getLogger(LISTENING_LOG_HIERARCHY);
LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ManagementConsole_logmessages", _currentLocale);
}
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1004 : {0} Management Ready</pre>
+ * <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 READY(String param1)
+ public static LogMessage CLOSE(String param1)
{
- String rawMessage = _messages.getString("READY");
+ String rawMessage = _messages.getString("CLOSE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -114,7 +114,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return READY_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -147,16 +147,16 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1003 : Shutting down : {0} : port {1,number,#}</pre>
+ * <pre>MNG-1002 : Starting : {0} : Listening on {1} port {2,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)
+ public static LogMessage LISTENING(String param1, String param2, Number param3)
{
- String rawMessage = _messages.getString("SHUTTING_DOWN");
+ String rawMessage = _messages.getString("LISTENING");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -174,7 +174,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return SHUTTING_DOWN_LOG_HIERARCHY;
+ return LISTENING_LOG_HIERARCHY;
}
@Override
@@ -207,14 +207,14 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1005 : {0} Management Stopped</pre>
+ * <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 STOPPED(String param1)
+ public static LogMessage OPEN(String param1)
{
- String rawMessage = _messages.getString("STOPPED");
+ String rawMessage = _messages.getString("OPEN");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -234,7 +234,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return STOPPED_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -267,16 +267,16 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1002 : Starting : {0} : Listening on {1} port {2,number,#}</pre>
+ * <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 LISTENING(String param1, String param2, Number param3)
+ public static LogMessage READY(String param1)
{
- String rawMessage = _messages.getString("LISTENING");
+ String rawMessage = _messages.getString("READY");
- final Object[] messageArguments = {param1, param2, param3};
+ 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);
@@ -294,7 +294,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return LISTENING_LOG_HIERARCHY;
+ return READY_LOG_HIERARCHY;
}
@Override
@@ -327,16 +327,16 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1001 : {0} Management Startup</pre>
+ * <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 STARTUP(String param1)
+ public static LogMessage SHUTTING_DOWN(String param1, Number param2)
{
- String rawMessage = _messages.getString("STARTUP");
+ String rawMessage = _messages.getString("SHUTTING_DOWN");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -354,7 +354,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return STARTUP_LOG_HIERARCHY;
+ return SHUTTING_DOWN_LOG_HIERARCHY;
}
@Override
@@ -387,14 +387,14 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1008 : Close : User {0}</pre>
+ * <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 CLOSE(String param1)
+ public static LogMessage STARTUP(String param1)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("STARTUP");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -414,7 +414,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return STARTUP_LOG_HIERARCHY;
}
@Override
@@ -447,14 +447,14 @@ public class ManagementConsoleMessages
/**
* Log a ManagementConsole message of the Format:
- * <pre>MNG-1007 : Open : User {0}</pre>
+ * <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 OPEN(String param1)
+ public static LogMessage STOPPED(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("STOPPED");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -474,7 +474,7 @@ public class ManagementConsoleMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return STOPPED_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
index e6a9483..c9f284e 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/MessageStoreMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class MessageStoreMessages
{
@@ -63,40 +63,40 @@ public class MessageStoreMessages
}
public static final String MESSAGESTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore";
- public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_start";
+ public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.closed";
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_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_complete";
public static final String OVERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.overfull";
- public static final String CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.closed";
- public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.underfull";
public static final String RECOVERED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovered";
+ public static final String RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_complete";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.recovery_start";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.store_location";
+ public static final String UNDERFULL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "messagestore.underfull";
static
{
LoggerFactory.getLogger(MESSAGESTORE_LOG_HIERARCHY);
- LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
- LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
- LoggerFactory.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
LoggerFactory.getLogger(OVERFULL_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSED_LOG_HIERARCHY);
- LoggerFactory.getLogger(UNDERFULL_LOG_HIERARCHY);
LoggerFactory.getLogger(RECOVERED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(UNDERFULL_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.MessageStore_logmessages", _currentLocale);
}
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1004 : Recovery Start</pre>
+ * <pre>MST-1003 : Closed</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage RECOVERY_START()
+ public static LogMessage CLOSED()
{
- String rawMessage = _messages.getString("RECOVERY_START");
+ String rawMessage = _messages.getString("CLOSED");
final String message = rawMessage;
@@ -111,7 +111,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_START_LOG_HIERARCHY;
+ return CLOSED_LOG_HIERARCHY;
}
@Override
@@ -199,21 +199,16 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1002 : Store location : {0}</pre>
+ * <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 STORE_LOCATION(String param1)
+ public static LogMessage OVERFULL()
{
- 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);
+ String rawMessage = _messages.getString("OVERFULL");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -226,7 +221,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return STORE_LOCATION_LOG_HIERARCHY;
+ return OVERFULL_LOG_HIERARCHY;
}
@Override
@@ -259,16 +254,21 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1006 : Recovery Complete</pre>
+ * <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 RECOVERY_COMPLETE()
+ public static LogMessage RECOVERED(Number param1)
{
- String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+ String rawMessage = _messages.getString("RECOVERED");
- final String message = rawMessage;
+ 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()
{
@@ -281,7 +281,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ return RECOVERED_LOG_HIERARCHY;
}
@Override
@@ -314,14 +314,14 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1008 : Store overfull, flow control will be enforced</pre>
+ * <pre>MST-1006 : Recovery Complete</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OVERFULL()
+ public static LogMessage RECOVERY_COMPLETE()
{
- String rawMessage = _messages.getString("OVERFULL");
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
final String message = rawMessage;
@@ -336,7 +336,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return OVERFULL_LOG_HIERARCHY;
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
}
@Override
@@ -369,14 +369,14 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1003 : Closed</pre>
+ * <pre>MST-1004 : Recovery Start</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSED()
+ public static LogMessage RECOVERY_START()
{
- String rawMessage = _messages.getString("CLOSED");
+ String rawMessage = _messages.getString("RECOVERY_START");
final String message = rawMessage;
@@ -391,7 +391,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return CLOSED_LOG_HIERARCHY;
+ return RECOVERY_START_LOG_HIERARCHY;
}
@Override
@@ -424,16 +424,21 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1009 : Store overfull condition cleared</pre>
+ * <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 UNDERFULL()
+ public static LogMessage STORE_LOCATION(String param1)
{
- String rawMessage = _messages.getString("UNDERFULL");
+ String rawMessage = _messages.getString("STORE_LOCATION");
- final String message = rawMessage;
+ 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()
{
@@ -446,7 +451,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return UNDERFULL_LOG_HIERARCHY;
+ return STORE_LOCATION_LOG_HIERARCHY;
}
@Override
@@ -479,21 +484,16 @@ public class MessageStoreMessages
/**
* Log a MessageStore message of the Format:
- * <pre>MST-1005 : Recovered {0,number} messages</pre>
+ * <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 RECOVERED(Number param1)
+ public static LogMessage UNDERFULL()
{
- 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);
+ String rawMessage = _messages.getString("UNDERFULL");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -506,7 +506,7 @@ public class MessageStoreMessages
@Override
public String getLogHierarchy()
{
- return RECOVERED_LOG_HIERARCHY;
+ return UNDERFULL_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
index e31f251..c331c8f 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of Port_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class PortMessages
{
@@ -63,44 +63,44 @@ public class PortMessages
}
public static final String PORT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port";
- public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.delete";
- public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.create";
- public static final String UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.unsupported_protocol_header";
- public static final String CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_closed";
- public static final String CONNECTION_COUNT_WARN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_count_warn";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.operation";
public static final String BIND_FAILED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.bind_failed";
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.close";
+ public static final String CONNECTION_COUNT_WARN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_count_warn";
+ public static final String CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_closed";
public static final String CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_too_many";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.create";
+ public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.delete";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.operation";
+ public static final String UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.unsupported_protocol_header";
static
{
LoggerFactory.getLogger(PORT_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY);
- LoggerFactory.getLogger(CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY);
- LoggerFactory.getLogger(CONNECTION_COUNT_WARN_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(BIND_FAILED_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CONNECTION_COUNT_WARN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY);
LoggerFactory.getLogger(CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Port_logmessages", _currentLocale);
}
/**
* Log a Port message of the Format:
- * <pre>PRT-1006 : Delete {0} Port "{1}"</pre>
+ * <pre>PRT-1009 : FAILED to bind {0} service to {1,number,#} - port in use</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1, String param2)
+ public static LogMessage BIND_FAILED(String param1, Number param2)
{
- String rawMessage = _messages.getString("DELETE");
+ String rawMessage = _messages.getString("BIND_FAILED");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -120,7 +120,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return BIND_FAILED_LOG_HIERARCHY;
}
@Override
@@ -153,21 +153,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1001 : Create "{0}"</pre>
+ * <pre>PRT-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATE(String param1)
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("CREATE");
-
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -180,7 +175,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -213,16 +208,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1007 : Unsupported protocol header received, replying with {0}</pre>
+ * <pre>PRT-1004 : Connection count {0,number} within {1, number} % of maximum {2,number}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1)
+ public static LogMessage CONNECTION_COUNT_WARN(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("UNSUPPORTED_PROTOCOL_HEADER");
+ String rawMessage = _messages.getString("CONNECTION_COUNT_WARN");
- final Object[] messageArguments = {param1};
+ 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);
@@ -240,7 +235,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY;
+ return CONNECTION_COUNT_WARN_LOG_HIERARCHY;
}
@Override
@@ -333,16 +328,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1004 : Connection count {0,number} within {1, number} % of maximum {2,number}</pre>
+ * <pre>PRT-1005 : Connection from {0} rejected. Maximum connection count ({1, number}) for this port already reached.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONNECTION_COUNT_WARN(Number param1, Number param2, Number param3)
+ public static LogMessage CONNECTION_REJECTED_TOO_MANY(String param1, Number param2)
{
- String rawMessage = _messages.getString("CONNECTION_COUNT_WARN");
+ String rawMessage = _messages.getString("CONNECTION_REJECTED_TOO_MANY");
- final Object[] messageArguments = {param1, param2, param3};
+ 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);
@@ -360,7 +355,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return CONNECTION_COUNT_WARN_LOG_HIERARCHY;
+ return CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY;
}
@Override
@@ -393,14 +388,14 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1010 : Operation : {0}</pre>
+ * <pre>PRT-1001 : Create "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage CREATE(String param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("CREATE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -420,7 +415,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -453,14 +448,14 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1009 : FAILED to bind {0} service to {1,number,#} - port in use</pre>
+ * <pre>PRT-1006 : Delete {0} Port "{1}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage BIND_FAILED(String param1, Number param2)
+ public static LogMessage DELETE(String param1, String param2)
{
- String rawMessage = _messages.getString("BIND_FAILED");
+ String rawMessage = _messages.getString("DELETE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -480,7 +475,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return BIND_FAILED_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -513,14 +508,14 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1003 : Close</pre>
+ * <pre>PRT-1002 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage OPEN()
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("OPEN");
final String message = rawMessage;
@@ -535,7 +530,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -568,16 +563,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1005 : Connection from {0} rejected. Maximum connection count ({1, number}) for this port already reached.</pre>
+ * <pre>PRT-1010 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONNECTION_REJECTED_TOO_MANY(String param1, Number param2)
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("CONNECTION_REJECTED_TOO_MANY");
+ String rawMessage = _messages.getString("OPERATION");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -595,7 +590,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -628,16 +623,21 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1002 : Open</pre>
+ * <pre>PRT-1007 : Unsupported protocol header received, replying with {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("UNSUPPORTED_PROTOCOL_HEADER");
- final String message = rawMessage;
+ 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()
{
@@ -650,7 +650,7 @@ public class PortMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY;
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[6/6] qpid-broker-j git commit: QPID-7869: [Java Broker] [Truststore]
Make certificates within truststore warn about their impending expiry as
keystores already do
Posted by kw...@apache.org.
QPID-7869: [Java Broker] [Truststore] Make certificates within truststore warn about their impending expiry as keystores already do
Pulled up common implementation into an abstract base-class
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/f218a1dd
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/f218a1dd
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/f218a1dd
Branch: refs/heads/master
Commit: f218a1dd811fec4cff3852bfa559b42791d97bbf
Parents: 391f0b8
Author: Keith Wall <kw...@apache.org>
Authored: Sun Jul 30 17:37:29 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Sun Jul 30 19:32:46 2017 +0100
----------------------------------------------------------------------
.../logging/messages/TrustStoreMessages.java | 62 +++++
.../messages/TrustStore_logmessages.properties | 2 +
.../org/apache/qpid/server/model/KeyStore.java | 5 +
.../apache/qpid/server/model/TrustStore.java | 20 ++
.../qpid/server/security/AbstractKeyStore.java | 44 ++--
.../server/security/AbstractTrustStore.java | 251 +++++++++++++++++++
.../AutoGeneratedSelfSignedKeyStoreImpl.java | 27 +-
.../server/security/FileTrustStoreImpl.java | 121 +++------
.../ManagedPeerCertificateTrustStoreImpl.java | 124 ++-------
.../server/security/NonJavaTrustStoreImpl.java | 115 ++-------
.../security/SiteSpecificTrustStoreImpl.java | 103 ++------
11 files changed, 469 insertions(+), 405 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
index d3315dc..8fd1e9d 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStoreMessages.java
@@ -66,6 +66,7 @@ public class TrustStoreMessages
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.close";
public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.create";
public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.delete";
+ public static final String EXPIRING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.expiring";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.open";
public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "truststore.operation";
@@ -75,6 +76,7 @@ public class TrustStoreMessages
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(EXPIRING_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
@@ -258,6 +260,66 @@ public class TrustStoreMessages
/**
* Log a TrustStore message of the Format:
+ * <pre>TST-1005 : TrustStore {0} Certificate expires in {1} days : {2}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage EXPIRING(String param1, String param2, String param3)
+ {
+ String rawMessage = _messages.getString("EXPIRING");
+
+ final Object[] messageArguments = {param1, param2, param3};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
+
+ return new LogMessage()
+ {
+ @Override
+ public String toString()
+ {
+ return message;
+ }
+
+ @Override
+ public String getLogHierarchy()
+ {
+ return EXPIRING_LOG_HIERARCHY;
+ }
+
+ @Override
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final LogMessage that = (LogMessage) o;
+
+ return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
+
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = toString().hashCode();
+ result = 31 * result + getLogHierarchy().hashCode();
+ return result;
+ }
+ };
+ }
+
+ /**
+ * Log a TrustStore message of the Format:
* <pre>TST-1002 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStore_logmessages.properties
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStore_logmessages.properties b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStore_logmessages.properties
index feccef2..494f832 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStore_logmessages.properties
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/TrustStore_logmessages.properties
@@ -24,4 +24,6 @@ CLOSE = TST-1003 : Close
DELETE = TST-1004 : Delete "{0}"
# 0 - operation name
OPERATION = TST-1005 : Operation : {0}
+EXPIRING = TST-1005 : TrustStore {0} Certificate expires in {1} days : {2}
+
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java b/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
index 953709f..efbe6d5 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
@@ -36,6 +36,11 @@ public interface KeyStore<X extends KeyStore<X>> extends ConfiguredObject<X>
@ManagedContextDefault(name = CERTIFICATE_EXPIRY_CHECK_FREQUENCY)
int DEFAULT_CERTIFICATE_EXPIRY_CHECK_FREQUENCY = 1;
+ @DerivedAttribute
+ int getCertificateExpiryWarnPeriod();
+
+ @DerivedAttribute
+ int getCertificateExpiryCheckFrequency();
KeyManager[] getKeyManagers() throws GeneralSecurityException;
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
index 10a59d6..53bb1f0 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/TrustStore.java
@@ -31,6 +31,20 @@ import org.apache.qpid.server.security.CertificateDetails;
@ManagedObject( defaultType = "FileTrustStore" )
public interface TrustStore<X extends TrustStore<X>> extends ConfiguredObject<X>
{
+ String CERTIFICATE_EXPIRY_WARN_PERIOD = "qpid.truststore.certificateExpiryWarnPeriod";
+
+ @ManagedContextDefault(name = CERTIFICATE_EXPIRY_WARN_PERIOD)
+ int DEFAULT_CERTIFICATE_EXPIRY_WARN_PERIOD = 30;
+
+ String CERTIFICATE_EXPIRY_CHECK_FREQUENCY = "qpid.truststore.certificateExpiryCheckFrequency";
+
+ @ManagedContextDefault(name = CERTIFICATE_EXPIRY_CHECK_FREQUENCY)
+ int DEFAULT_CERTIFICATE_EXPIRY_CHECK_FREQUENCY = 1;
+
+ @Override
+ @ManagedAttribute(immutable = true)
+ String getName();
+
@ManagedAttribute( defaultValue = "false", description = "If true the Trust Store will expose its certificates as a special artificial message source.")
boolean isExposedAsMessageSource();
@@ -43,6 +57,12 @@ public interface TrustStore<X extends TrustStore<X>> extends ConfiguredObject<X>
@DerivedAttribute(description = "List of details about the certificates like validity dates, SANs, issuer and subject names, etc.")
List<CertificateDetails> getCertificateDetails();
+ @DerivedAttribute
+ int getCertificateExpiryWarnPeriod();
+
+ @DerivedAttribute
+ int getCertificateExpiryCheckFrequency();
+
TrustManager[] getTrustManagers() throws GeneralSecurityException;
Certificate[] getCertificates() throws GeneralSecurityException;
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/AbstractKeyStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/AbstractKeyStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/AbstractKeyStore.java
index f931d2f..21a9564 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/AbstractKeyStore.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/AbstractKeyStore.java
@@ -51,7 +51,7 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
{
private static Logger LOGGER = LoggerFactory.getLogger(AbstractKeyStore.class);
- protected static final long ONE_DAY = 24l * 60l * 60l * 1000l;
+ protected static final long ONE_DAY = 24L * 60L * 60L * 1000L;
private final Broker<?> _broker;
private final EventLogger _eventLogger;
@@ -97,16 +97,7 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
protected void initializeExpiryChecking()
{
- int checkFrequency;
- try
- {
- checkFrequency = getContextValue(Integer.class, CERTIFICATE_EXPIRY_CHECK_FREQUENCY);
- }
- catch (IllegalArgumentException | NullPointerException e)
- {
- LOGGER.warn("Cannot parse the context variable {} ", CERTIFICATE_EXPIRY_CHECK_FREQUENCY, e);
- checkFrequency = DEFAULT_CERTIFICATE_EXPIRY_CHECK_FREQUENCY;
- }
+ int checkFrequency = getCertificateExpiryCheckFrequency();
if(getBroker().getState() == State.ACTIVE)
{
_checkExpiryTaskFuture = getBroker().scheduleHouseKeepingTask(checkFrequency, TimeUnit.DAYS, new Runnable()
@@ -129,14 +120,8 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
if (newState == State.ACTIVE)
{
_checkExpiryTaskFuture =
- getBroker().scheduleHouseKeepingTask(frequency, TimeUnit.DAYS, new Runnable()
- {
- @Override
- public void run()
- {
- checkCertificateExpiry();
- }
- });
+ getBroker().scheduleHouseKeepingTask(frequency, TimeUnit.DAYS,
+ () -> checkCertificateExpiry());
getBroker().removeChangeListener(this);
}
}
@@ -149,7 +134,7 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
// verify that it is not in use
String storeName = getName();
- Collection<Port> ports = new ArrayList<Port>(getBroker().getPorts());
+ Collection<Port> ports = new ArrayList<>(getBroker().getPorts());
for (Port port : ports)
{
if (port.getKeyStore() == this)
@@ -192,7 +177,8 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
}
}
- protected final int getCertificateExpiryWarnPeriod()
+ @Override
+ public final int getCertificateExpiryWarnPeriod()
{
try
{
@@ -204,4 +190,20 @@ public abstract class AbstractKeyStore<X extends AbstractKeyStore<X>>
return DEFAULT_CERTIFICATE_EXPIRY_WARN_PERIOD;
}
}
+
+ @Override
+ public int getCertificateExpiryCheckFrequency()
+ {
+ int checkFrequency;
+ try
+ {
+ checkFrequency = getContextValue(Integer.class, CERTIFICATE_EXPIRY_CHECK_FREQUENCY);
+ }
+ catch (IllegalArgumentException | NullPointerException e)
+ {
+ LOGGER.warn("Cannot parse the context variable {} ", CERTIFICATE_EXPIRY_CHECK_FREQUENCY, e);
+ checkFrequency = DEFAULT_CERTIFICATE_EXPIRY_CHECK_FREQUENCY;
+ }
+ return checkFrequency;
+ }
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/AbstractTrustStore.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/AbstractTrustStore.java b/broker-core/src/main/java/org/apache/qpid/server/security/AbstractTrustStore.java
new file mode 100644
index 0000000..db42d3b
--- /dev/null
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/AbstractTrustStore.java
@@ -0,0 +1,251 @@
+/*
+ * 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.security;
+
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.messages.TrustStoreMessages;
+import org.apache.qpid.server.model.AbstractConfigurationChangeListener;
+import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.IntegrityViolationException;
+import org.apache.qpid.server.model.ManagedAttributeField;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.TrustStore;
+import org.apache.qpid.server.model.VirtualHostNode;
+import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
+
+public abstract class AbstractTrustStore<X extends AbstractTrustStore<X>>
+ extends AbstractConfiguredObject<X> implements TrustStore<X>
+{
+ private static Logger LOGGER = LoggerFactory.getLogger(AbstractTrustStore.class);
+
+ protected static final long ONE_DAY = 24L * 60L * 60L * 1000L;
+
+ private final Broker<?> _broker;
+ private final EventLogger _eventLogger;
+
+ @ManagedAttributeField
+ private boolean _exposedAsMessageSource;
+ @ManagedAttributeField
+ private List<VirtualHostNode<?>> _includedVirtualHostNodeMessageSources;
+ @ManagedAttributeField
+ private List<VirtualHostNode<?>> _excludedVirtualHostNodeMessageSources;
+
+ private ScheduledFuture<?> _checkExpiryTaskFuture;
+
+ public AbstractTrustStore(Map<String, Object> attributes, Broker<?> broker)
+ {
+ super(broker, attributes);
+
+ _broker = broker;
+ _eventLogger = broker.getEventLogger();
+ _eventLogger.message(TrustStoreMessages.CREATE(getName()));
+ }
+
+ public final Broker<?> getBroker()
+ {
+ return _broker;
+ }
+
+ final EventLogger getEventLogger()
+ {
+ return _eventLogger;
+ }
+
+ @Override
+ protected ListenableFuture<Void> onClose()
+ {
+ if(_checkExpiryTaskFuture != null)
+ {
+ _checkExpiryTaskFuture.cancel(false);
+ _checkExpiryTaskFuture = null;
+ }
+ return Futures.immediateFuture(null);
+ }
+
+ @Override
+ protected void logOperation(final String operation)
+ {
+ _broker.getEventLogger().message(TrustStoreMessages.OPERATION(operation));
+ }
+
+ protected void initializeExpiryChecking()
+ {
+ int checkFrequency = getCertificateExpiryCheckFrequency();
+ if(getBroker().getState() == State.ACTIVE)
+ {
+ _checkExpiryTaskFuture = getBroker().scheduleHouseKeepingTask(checkFrequency, TimeUnit.DAYS,
+ this::checkCertificateExpiry);
+ }
+ else
+ {
+ final int frequency = checkFrequency;
+ getBroker().addChangeListener(new AbstractConfigurationChangeListener()
+ {
+ @Override
+ public void stateChanged(final ConfiguredObject<?> object, final State oldState, final State newState)
+ {
+ if (newState == State.ACTIVE)
+ {
+ _checkExpiryTaskFuture =
+ getBroker().scheduleHouseKeepingTask(frequency, TimeUnit.DAYS,
+ () -> checkCertificateExpiry());
+ getBroker().removeChangeListener(this);
+ }
+ }
+ });
+ }
+ }
+
+ protected final ListenableFuture<Void> deleteIfNotInUse()
+ {
+ // verify that it is not in use
+ String storeName = getName();
+
+ Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
+ for (Port port : ports)
+ {
+ Collection<TrustStore> trustStores = port.getTrustStores();
+ if(trustStores != null)
+ {
+ for (TrustStore store : trustStores)
+ {
+ if(storeName.equals(store.getAttribute(TrustStore.NAME)))
+ {
+ throw new IntegrityViolationException("Trust store '"
+ + storeName
+ + "' can't be deleted as it is in use by a port: "
+ + port.getName());
+ }
+ }
+ }
+ }
+
+ Collection<AuthenticationProvider> authenticationProviders = new ArrayList<>(_broker.getAuthenticationProviders());
+ for (AuthenticationProvider authProvider : authenticationProviders)
+ {
+ if (authProvider instanceof SimpleLDAPAuthenticationManager)
+ {
+ SimpleLDAPAuthenticationManager simpleLdap = (SimpleLDAPAuthenticationManager) authProvider;
+ if (simpleLdap.getTrustStore() == this)
+ {
+ throw new IntegrityViolationException("Trust store '"
+ + storeName
+ + "' can't be deleted as it is in use by an authentication manager: "
+ + authProvider.getName());
+ }
+ }
+ }
+ deleted();
+ setState(State.DELETED);
+ _eventLogger.message(TrustStoreMessages.DELETE(getName()));
+ return Futures.immediateFuture(null);
+ }
+
+ protected abstract void checkCertificateExpiry();
+
+ protected void checkCertificateExpiry(final long currentTime,
+ final Date expiryTestDate,
+ final X509Certificate cert)
+ {
+ try
+ {
+ cert.checkValidity(expiryTestDate);
+ }
+ catch(CertificateExpiredException e)
+ {
+ long timeToExpiry = cert.getNotAfter().getTime() - currentTime;
+ int days = Math.max(0,(int)(timeToExpiry / (ONE_DAY)));
+
+ getEventLogger().message(TrustStoreMessages.EXPIRING(getName(), String.valueOf(days), cert.getSubjectDN().toString()));
+ }
+ catch(CertificateNotYetValidException e)
+ {
+ // ignore
+ }
+ }
+
+ @Override
+ public final int getCertificateExpiryWarnPeriod()
+ {
+ try
+ {
+ return getContextValue(Integer.class, CERTIFICATE_EXPIRY_WARN_PERIOD);
+ }
+ catch (NullPointerException | IllegalArgumentException e)
+ {
+ LOGGER.warn("The value of the context variable '{}' for truststore {} cannot be converted to an integer. The value {} will be used as a default", CERTIFICATE_EXPIRY_WARN_PERIOD, getName(), DEFAULT_CERTIFICATE_EXPIRY_WARN_PERIOD);
+ return DEFAULT_CERTIFICATE_EXPIRY_WARN_PERIOD;
+ }
+ }
+
+ @Override
+ public int getCertificateExpiryCheckFrequency()
+ {
+ int checkFrequency;
+ try
+ {
+ checkFrequency = getContextValue(Integer.class, CERTIFICATE_EXPIRY_CHECK_FREQUENCY);
+ }
+ catch (IllegalArgumentException | NullPointerException e)
+ {
+ LOGGER.warn("Cannot parse the context variable {} ", CERTIFICATE_EXPIRY_CHECK_FREQUENCY, e);
+ checkFrequency = DEFAULT_CERTIFICATE_EXPIRY_CHECK_FREQUENCY;
+ }
+ return checkFrequency;
+ }
+
+ @Override
+ public boolean isExposedAsMessageSource()
+ {
+ return _exposedAsMessageSource;
+ }
+
+ @Override
+ public List<VirtualHostNode<?>> getIncludedVirtualHostNodeMessageSources()
+ {
+ return _includedVirtualHostNodeMessageSources;
+ }
+
+ @Override
+ public List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources()
+ {
+ return _excludedVirtualHostNodeMessageSources;
+ }
+}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStoreImpl.java
index eb0f3a3..d9cd0ee 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStoreImpl.java
@@ -63,7 +63,6 @@ import com.google.common.util.concurrent.ListenableFuture;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
import org.apache.qpid.server.logging.EventLogger;
import org.apache.qpid.server.logging.messages.KeyStoreMessages;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.Content;
import org.apache.qpid.server.model.CustomRestHeaders;
@@ -78,7 +77,7 @@ import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
import org.apache.qpid.server.util.Strings;
public class AutoGeneratedSelfSignedKeyStoreImpl
- extends AbstractConfiguredObject<AutoGeneratedSelfSignedKeyStoreImpl>
+ extends AbstractKeyStore<AutoGeneratedSelfSignedKeyStoreImpl>
implements AutoGeneratedSelfSignedKeyStore<AutoGeneratedSelfSignedKeyStoreImpl>
{
@@ -124,7 +123,7 @@ public class AutoGeneratedSelfSignedKeyStoreImpl
@ManagedObjectFactoryConstructor(conditionallyAvailable = true)
public AutoGeneratedSelfSignedKeyStoreImpl(final Map<String, Object> attributes, Broker<?> broker)
{
- super(broker, attributes);
+ super(attributes, broker);
_broker = broker;
_eventLogger = _broker.getEventLogger();
_eventLogger.message(KeyStoreMessages.CREATE(getName()));
@@ -229,6 +228,13 @@ public class AutoGeneratedSelfSignedKeyStoreImpl
_created = true;
}
+ @Override
+ protected void onOpen()
+ {
+ super.onOpen();
+ initializeExpiryChecking();
+ }
+
@StateTransition(currentState = { State.UNINITIALIZED, State.STOPPED, State.ERRORED}, desiredState = State.ACTIVE)
protected ListenableFuture<Void> activate()
{
@@ -349,6 +355,21 @@ public class AutoGeneratedSelfSignedKeyStoreImpl
}
}
+ @Override
+ protected void checkCertificateExpiry()
+ {
+ int expiryWarning = getCertificateExpiryWarnPeriod();
+ if(expiryWarning > 0)
+ {
+ long currentTime = System.currentTimeMillis();
+ Date expiryTestDate = new Date(currentTime + (ONE_DAY * (long) expiryWarning));
+
+ checkCertificatesExpiry(currentTime, expiryTestDate,
+ new X509Certificate[]{_certificate});
+ }
+ }
+
+
private void generateKeyManagers()
{
try
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
index ae7e781..c1cd588 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
@@ -33,6 +33,7 @@ import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
@@ -47,30 +48,20 @@ import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.messages.TrustStoreMessages;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.IntegrityViolationException;
import org.apache.qpid.server.model.ManagedAttributeField;
import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
-import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.StateTransition;
import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.VirtualHostNode;
-import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
-import org.apache.qpid.server.util.urlstreamhandler.data.Handler;
import org.apache.qpid.server.transport.network.security.ssl.QpidMultipleTrustManager;
import org.apache.qpid.server.transport.network.security.ssl.QpidPeersOnlyTrustManager;
import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
+import org.apache.qpid.server.util.urlstreamhandler.data.Handler;
-public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreImpl> implements FileTrustStore<FileTrustStoreImpl>
+public class FileTrustStoreImpl extends AbstractTrustStore<FileTrustStoreImpl> implements FileTrustStore<FileTrustStoreImpl>
{
- private final Broker<?> _broker;
- private final EventLogger _eventLogger;
@ManagedAttributeField
private String _trustStoreType;
@@ -84,13 +75,6 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
@ManagedAttributeField
private String _password;
- @ManagedAttributeField
- private boolean _exposedAsMessageSource;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _includedVirtualHostNodeMessageSources;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _excludedVirtualHostNodeMessageSources;
-
static
{
Handler.register();
@@ -99,10 +83,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
@ManagedObjectFactoryConstructor
public FileTrustStoreImpl(Map<String, Object> attributes, Broker<?> broker)
{
- super(broker, attributes);
- _broker = broker;
- _eventLogger = _broker.getEventLogger();
- _eventLogger.message(TrustStoreMessages.CREATE(getName()));
+ super(attributes, broker);
}
@Override
@@ -119,52 +100,13 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
@StateTransition(currentState = {State.ACTIVE, State.ERRORED}, desiredState = State.DELETED)
protected ListenableFuture<Void> doDelete()
{
- // verify that it is not in use
- String storeName = getName();
-
- Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
- for (Port port : ports)
- {
- Collection<TrustStore> trustStores = port.getTrustStores();
- if(trustStores != null)
- {
- for (TrustStore store : trustStores)
- {
- if(storeName.equals(store.getAttribute(TrustStore.NAME)))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by a port: "
- + port.getName());
- }
- }
- }
- }
-
- Collection<AuthenticationProvider> authenticationProviders = new ArrayList<>(_broker.getAuthenticationProviders());
- for (AuthenticationProvider authProvider : authenticationProviders)
- {
- if (authProvider instanceof SimpleLDAPAuthenticationManager)
- {
- SimpleLDAPAuthenticationManager simpleLdap = (SimpleLDAPAuthenticationManager) authProvider;
- if (simpleLdap.getTrustStore() == this)
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by an authentication manager: "
- + authProvider.getName());
- }
- }
- }
- deleted();
- setState(State.DELETED);
- _eventLogger.message(TrustStoreMessages.DELETE(getName()));
- return Futures.immediateFuture(null);
+ return deleteIfNotInUse();
}
@StateTransition(currentState = {State.UNINITIALIZED, State.ERRORED}, desiredState = State.ACTIVE)
protected ListenableFuture<Void> doActivate()
{
+ initializeExpiryChecking();
setState(State.ACTIVE);
return Futures.immediateFuture(null);
}
@@ -179,10 +121,6 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
{
return;
}
- if(changedAttributes.contains(TrustStore.NAME) && !getName().equals(updated.getName()))
- {
- throw new IllegalConfigurationException("Changing the trust store name is not allowed");
- }
validateTrustStore(updated);
}
@@ -347,7 +285,6 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
}
}
-
@Override
public List<CertificateDetails> getCertificateDetails()
{
@@ -364,6 +301,28 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
}
}
+ @Override
+ protected void checkCertificateExpiry()
+ {
+ int expiryWarning = getCertificateExpiryWarnPeriod();
+ if(expiryWarning > 0)
+ {
+ long currentTime = System.currentTimeMillis();
+ Date expiryTestDate = new Date(currentTime + (ONE_DAY * (long) expiryWarning));
+
+ try
+ {
+ Arrays.stream(getCertificates())
+ .filter(cert -> cert instanceof X509Certificate)
+ .forEach(x509cert -> checkCertificateExpiry(currentTime, expiryTestDate,
+ (X509Certificate) x509cert));
+ }
+ catch (GeneralSecurityException e)
+ {
+ }
+ }
+ }
+
private static URL getUrlFromString(String urlString) throws MalformedURLException
{
URL url;
@@ -392,28 +351,4 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI
_path = null;
}
}
-
- @Override
- public boolean isExposedAsMessageSource()
- {
- return _exposedAsMessageSource;
- }
-
- @Override
- public List<VirtualHostNode<?>> getIncludedVirtualHostNodeMessageSources()
- {
- return _includedVirtualHostNodeMessageSources;
- }
-
- @Override
- public List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources()
- {
- return _excludedVirtualHostNodeMessageSources;
- }
-
- @Override
- protected void logOperation(final String operation)
- {
- _broker.getEventLogger().message(TrustStoreMessages.OPERATION(operation));
- }
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
index 6133192..5042915 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
@@ -28,6 +28,7 @@ import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -46,41 +47,21 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.messages.TrustStoreMessages;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.IntegrityViolationException;
import org.apache.qpid.server.model.ManagedAttributeField;
import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
-import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.StateTransition;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.VirtualHostNode;
-import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
import org.apache.qpid.server.transport.network.security.ssl.QpidMultipleTrustManager;
import org.apache.qpid.server.transport.network.security.ssl.QpidPeersOnlyTrustManager;
@ManagedObject( category = false )
public class ManagedPeerCertificateTrustStoreImpl
- extends AbstractConfiguredObject<ManagedPeerCertificateTrustStoreImpl> implements ManagedPeerCertificateTrustStore<ManagedPeerCertificateTrustStoreImpl>
+ extends AbstractTrustStore<ManagedPeerCertificateTrustStoreImpl> implements ManagedPeerCertificateTrustStore<ManagedPeerCertificateTrustStoreImpl>
{
private static final Logger LOGGER = LoggerFactory.getLogger(ManagedPeerCertificateTrustStoreImpl.class);
- private final Broker<?> _broker;
- private final EventLogger _eventLogger;
-
- @ManagedAttributeField
- private boolean _exposedAsMessageSource;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _includedVirtualHostNodeMessageSources;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _excludedVirtualHostNodeMessageSources;
-
private volatile TrustManager[] _trustManagers = new TrustManager[0];
@ManagedAttributeField( afterSet = "updateTrustManagers")
@@ -89,10 +70,7 @@ public class ManagedPeerCertificateTrustStoreImpl
@ManagedObjectFactoryConstructor
public ManagedPeerCertificateTrustStoreImpl(final Map<String, Object> attributes, Broker<?> broker)
{
- super(broker, attributes);
- _broker = broker;
- _eventLogger = _broker.getEventLogger();
- _eventLogger.message(TrustStoreMessages.CREATE(getName()));
+ super(attributes, broker);
}
@Override
@@ -114,71 +92,17 @@ public class ManagedPeerCertificateTrustStoreImpl
@StateTransition(currentState = {State.ACTIVE, State.ERRORED}, desiredState = State.DELETED)
protected ListenableFuture<Void> doDelete()
{
- // verify that it is not in use
- String storeName = getName();
-
- Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
- for (Port port : ports)
- {
- Collection<TrustStore> trustStores = port.getTrustStores();
- if(trustStores != null)
- {
- for (TrustStore store : trustStores)
- {
- if(storeName.equals(store.getAttribute(TrustStore.NAME)))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by a port: "
- + port.getName());
- }
- }
- }
- }
-
- Collection<AuthenticationProvider> authenticationProviders = new ArrayList<AuthenticationProvider>(_broker.getAuthenticationProviders());
- for (AuthenticationProvider authProvider : authenticationProviders)
- {
- if(authProvider.getAttributeNames().contains(SimpleLDAPAuthenticationManager.TRUST_STORE))
- {
- Object attributeType = authProvider.getAttribute(AuthenticationProvider.TYPE);
- Object attributeValue = authProvider.getAttribute(SimpleLDAPAuthenticationManager.TRUST_STORE);
- if (SimpleLDAPAuthenticationManager.PROVIDER_TYPE.equals(attributeType)
- && storeName.equals(attributeValue))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by an authentication manager: "
- + authProvider.getName());
- }
- }
- }
- deleted();
- setState(State.DELETED);
- _eventLogger.message(TrustStoreMessages.DELETE(getName()));
- return Futures.immediateFuture(null);
+ return deleteIfNotInUse();
}
@StateTransition(currentState = {State.UNINITIALIZED, State.ERRORED}, desiredState = State.ACTIVE)
protected ListenableFuture<Void> doActivate()
{
+ initializeExpiryChecking();
setState(State.ACTIVE);
return Futures.immediateFuture(null);
}
-
- @Override
- protected void validateChange(final ConfiguredObject<?> proxyForValidation, final Set<String> changedAttributes)
- {
- super.validateChange(proxyForValidation, changedAttributes);
- ManagedPeerCertificateTrustStore<?> changedStore = (ManagedPeerCertificateTrustStore) proxyForValidation;
- if (changedAttributes.contains(NAME) && !getName().equals(changedStore.getName()))
- {
- throw new IllegalConfigurationException("Changing the key store name is not allowed");
- }
- }
-
-
@SuppressWarnings("unused")
private void updateTrustManagers()
{
@@ -235,25 +159,6 @@ public class ManagedPeerCertificateTrustStoreImpl
}
}
-
- @Override
- public boolean isExposedAsMessageSource()
- {
- return _exposedAsMessageSource;
- }
-
- @Override
- public List<VirtualHostNode<?>> getIncludedVirtualHostNodeMessageSources()
- {
- return _includedVirtualHostNodeMessageSources;
- }
-
- @Override
- public List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources()
- {
- return _excludedVirtualHostNodeMessageSources;
- }
-
@Override
public List<Certificate> getStoredCertificates()
{
@@ -266,7 +171,7 @@ public class ManagedPeerCertificateTrustStoreImpl
final Set<Certificate> certificates = new LinkedHashSet<>(_storedCertificates);
if (certificates.add(cert))
{
- setAttributes(Collections.<String, Object>singletonMap("storedCertificates", certificates));
+ setAttributes(Collections.singletonMap("storedCertificates", certificates));
}
}
@@ -318,14 +223,23 @@ public class ManagedPeerCertificateTrustStoreImpl
if (updated)
{
- setAttributes(Collections.<String, Object>singletonMap("storedCertificates", currentCerts));
+ setAttributes(Collections.singletonMap("storedCertificates", currentCerts));
}
}
-
@Override
- protected void logOperation(final String operation)
+ protected void checkCertificateExpiry()
{
- _broker.getEventLogger().message(TrustStoreMessages.OPERATION(operation));
+ int expiryWarning = getCertificateExpiryWarnPeriod();
+ if(expiryWarning > 0)
+ {
+ long currentTime = System.currentTimeMillis();
+ Date expiryTestDate = new Date(currentTime + (ONE_DAY * (long) expiryWarning));
+
+ _storedCertificates.stream()
+ .filter(cert -> cert instanceof X509Certificate)
+ .forEach(x509cert -> checkCertificateExpiry(currentTime, expiryTestDate,
+ (X509Certificate) x509cert));
+ }
}
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
index 385ea02..d98c821 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/NonJavaTrustStoreImpl.java
@@ -27,10 +27,9 @@ import java.net.URL;
import java.security.GeneralSecurityException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -45,42 +44,25 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.messages.TrustStoreMessages;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.IntegrityViolationException;
import org.apache.qpid.server.model.ManagedAttributeField;
import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
-import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.StateTransition;
-import org.apache.qpid.server.model.TrustStore;
import org.apache.qpid.server.model.VirtualHostNode;
-import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
import org.apache.qpid.server.util.urlstreamhandler.data.Handler;
@ManagedObject( category = false )
public class NonJavaTrustStoreImpl
- extends AbstractConfiguredObject<NonJavaTrustStoreImpl> implements NonJavaTrustStore<NonJavaTrustStoreImpl>
+ extends AbstractTrustStore<NonJavaTrustStoreImpl> implements NonJavaTrustStore<NonJavaTrustStoreImpl>
{
private static final Logger LOGGER = LoggerFactory.getLogger(NonJavaTrustStoreImpl.class);
- private final Broker<?> _broker;
- private final EventLogger _eventLogger;
-
@ManagedAttributeField( afterSet = "updateTrustManagers" )
private String _certificatesUrl;
- @ManagedAttributeField
- private boolean _exposedAsMessageSource;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _includedVirtualHostNodeMessageSources;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _excludedVirtualHostNodeMessageSources;
private volatile TrustManager[] _trustManagers = new TrustManager[0];
@@ -96,10 +78,7 @@ public class NonJavaTrustStoreImpl
@ManagedObjectFactoryConstructor
public NonJavaTrustStoreImpl(final Map<String, Object> attributes, Broker<?> broker)
{
- super(broker, attributes);
- _broker = broker;
- _eventLogger = _broker.getEventLogger();
- _eventLogger.message(TrustStoreMessages.CREATE(getName()));
+ super(attributes, broker);
}
@Override
@@ -152,54 +131,13 @@ public class NonJavaTrustStoreImpl
@StateTransition(currentState = {State.ACTIVE, State.ERRORED}, desiredState = State.DELETED)
protected ListenableFuture<Void> doDelete()
{
- // verify that it is not in use
- String storeName = getName();
-
- Collection<Port<?>> ports = new ArrayList<Port<?>>(_broker.getPorts());
- for (Port port : ports)
- {
- Collection<TrustStore> trustStores = port.getTrustStores();
- if(trustStores != null)
- {
- for (TrustStore store : trustStores)
- {
- if(storeName.equals(store.getAttribute(TrustStore.NAME)))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by a port: "
- + port.getName());
- }
- }
- }
- }
-
- Collection<AuthenticationProvider> authenticationProviders = new ArrayList<AuthenticationProvider>(_broker.getAuthenticationProviders());
- for (AuthenticationProvider authProvider : authenticationProviders)
- {
- if(authProvider.getAttributeNames().contains(SimpleLDAPAuthenticationManager.TRUST_STORE))
- {
- Object attributeType = authProvider.getAttribute(AuthenticationProvider.TYPE);
- Object attributeValue = authProvider.getAttribute(SimpleLDAPAuthenticationManager.TRUST_STORE);
- if (SimpleLDAPAuthenticationManager.PROVIDER_TYPE.equals(attributeType)
- && storeName.equals(attributeValue))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by an authentication manager: "
- + authProvider.getName());
- }
- }
- }
- deleted();
- setState(State.DELETED);
- _eventLogger.message(TrustStoreMessages.DELETE(getName()));
- return Futures.immediateFuture(null);
+ return deleteIfNotInUse();
}
@StateTransition(currentState = {State.UNINITIALIZED, State.ERRORED}, desiredState = State.ACTIVE)
protected ListenableFuture<Void> doActivate()
{
+ initializeExpiryChecking();
setState(State.ACTIVE);
return Futures.immediateFuture(null);
}
@@ -209,11 +147,23 @@ public class NonJavaTrustStoreImpl
{
super.validateChange(proxyForValidation, changedAttributes);
NonJavaTrustStore changedStore = (NonJavaTrustStore) proxyForValidation;
- if (changedAttributes.contains(NAME) && !getName().equals(changedStore.getName()))
+ validateTrustStoreAttributes(changedStore);
+ }
+
+ @Override
+ protected void checkCertificateExpiry()
+ {
+ int expiryWarning = getCertificateExpiryWarnPeriod();
+ if(expiryWarning > 0)
{
- throw new IllegalConfigurationException("Changing the key store name is not allowed");
+ long currentTime = System.currentTimeMillis();
+ Date expiryTestDate = new Date(currentTime + (ONE_DAY * (long) expiryWarning));
+
+ Arrays.stream(_certificates)
+ .filter(cert -> cert instanceof X509Certificate)
+ .forEach(x509cert -> checkCertificateExpiry(currentTime, expiryTestDate,
+ x509cert));
}
- validateTrustStoreAttributes(changedStore);
}
private void validateTrustStoreAttributes(NonJavaTrustStore<?> keyStore)
@@ -276,29 +226,4 @@ public class NonJavaTrustStoreImpl
}
return url;
}
-
-
- @Override
- public boolean isExposedAsMessageSource()
- {
- return _exposedAsMessageSource;
- }
-
- @Override
- public List<VirtualHostNode<?>> getIncludedVirtualHostNodeMessageSources()
- {
- return _includedVirtualHostNodeMessageSources;
- }
-
- @Override
- public List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources()
- {
- return _excludedVirtualHostNodeMessageSources;
- }
-
- @Override
- protected void logOperation(final String operation)
- {
- _broker.getEventLogger().message(TrustStoreMessages.OPERATION(operation));
- }
}
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f218a1dd/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
index 891403b..bb93101 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStoreImpl.java
@@ -31,9 +31,8 @@ import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -58,41 +57,23 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.messages.TrustStoreMessages;
-import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.IntegrityViolationException;
import org.apache.qpid.server.model.ManagedAttributeField;
import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
-import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.StateTransition;
-import org.apache.qpid.server.model.TrustStore;
-import org.apache.qpid.server.model.VirtualHostNode;
-import org.apache.qpid.server.security.auth.manager.SimpleLDAPAuthenticationManager;
import org.apache.qpid.server.transport.network.security.ssl.SSLUtil;
import org.apache.qpid.server.util.Strings;
@ManagedObject( category = false )
public class SiteSpecificTrustStoreImpl
- extends AbstractConfiguredObject<SiteSpecificTrustStoreImpl> implements SiteSpecificTrustStore<SiteSpecificTrustStoreImpl>
+ extends AbstractTrustStore<SiteSpecificTrustStoreImpl> implements SiteSpecificTrustStore<SiteSpecificTrustStoreImpl>
{
private static final Logger LOGGER = LoggerFactory.getLogger(SiteSpecificTrustStoreImpl.class);
- private final Broker<?> _broker;
- private final EventLogger _eventLogger;
-
@ManagedAttributeField
private String _siteUrl;
- @ManagedAttributeField
- private boolean _exposedAsMessageSource;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _includedVirtualHostNodeMessageSources;
- @ManagedAttributeField
- private List<VirtualHostNode<?>> _excludedVirtualHostNodeMessageSources;
private volatile TrustManager[] _trustManagers = new TrustManager[0];
@@ -103,10 +84,7 @@ public class SiteSpecificTrustStoreImpl
@ManagedObjectFactoryConstructor
public SiteSpecificTrustStoreImpl(final Map<String, Object> attributes, Broker<?> broker)
{
- super(broker, attributes);
- _broker = broker;
- _eventLogger = _broker.getEventLogger();
- _eventLogger.message(TrustStoreMessages.CREATE(getName()));
+ super(attributes, broker);
}
@Override
@@ -189,54 +167,14 @@ public class SiteSpecificTrustStoreImpl
@StateTransition(currentState = {State.ACTIVE, State.ERRORED}, desiredState = State.DELETED)
protected ListenableFuture<Void> doDelete()
{
- // verify that it is not in use
- String storeName = getName();
-
- Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
- for (Port port : ports)
- {
- Collection<TrustStore> trustStores = port.getTrustStores();
- if(trustStores != null)
- {
- for (TrustStore store : trustStores)
- {
- if(storeName.equals(store.getAttribute(TrustStore.NAME)))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by a port: "
- + port.getName());
- }
- }
- }
- }
-
- Collection<AuthenticationProvider> authenticationProviders = new ArrayList<AuthenticationProvider>(_broker.getAuthenticationProviders());
- for (AuthenticationProvider authProvider : authenticationProviders)
- {
- if(authProvider.getAttributeNames().contains(SimpleLDAPAuthenticationManager.TRUST_STORE))
- {
- Object attributeType = authProvider.getAttribute(AuthenticationProvider.TYPE);
- Object attributeValue = authProvider.getAttribute(SimpleLDAPAuthenticationManager.TRUST_STORE);
- if (SimpleLDAPAuthenticationManager.PROVIDER_TYPE.equals(attributeType)
- && storeName.equals(attributeValue))
- {
- throw new IntegrityViolationException("Trust store '"
- + storeName
- + "' can't be deleted as it is in use by an authentication manager: "
- + authProvider.getName());
- }
- }
- }
- deleted();
- setState(State.DELETED);
- _eventLogger.message(TrustStoreMessages.DELETE(getName()));
- return Futures.immediateFuture(null);
+ return deleteIfNotInUse();
}
@StateTransition(currentState = {State.UNINITIALIZED, State.ERRORED}, desiredState = State.ACTIVE)
protected ListenableFuture<Void> doActivate()
{
+ initializeExpiryChecking();
+
final SettableFuture<Void> result = SettableFuture.create();
if(_x509Certificate == null)
{
@@ -386,24 +324,6 @@ public class SiteSpecificTrustStoreImpl
}
@Override
- public boolean isExposedAsMessageSource()
- {
- return _exposedAsMessageSource;
- }
-
- @Override
- public List<VirtualHostNode<?>> getIncludedVirtualHostNodeMessageSources()
- {
- return _includedVirtualHostNodeMessageSources;
- }
-
- @Override
- public List<VirtualHostNode<?>> getExcludedVirtualHostNodeMessageSources()
- {
- return _excludedVirtualHostNodeMessageSources;
- }
-
- @Override
public List<CertificateDetails> getCertificateDetails()
{
return Collections.singletonList(new CertificateDetailsImpl(_x509Certificate));
@@ -428,9 +348,16 @@ public class SiteSpecificTrustStoreImpl
}
@Override
- protected void logOperation(final String operation)
+ protected void checkCertificateExpiry()
{
- _broker.getEventLogger().message(TrustStoreMessages.OPERATION(operation));
+ int expiryWarning = getCertificateExpiryWarnPeriod();
+ if(expiryWarning > 0)
+ {
+ long currentTime = System.currentTimeMillis();
+ Date expiryTestDate = new Date(currentTime + (ONE_DAY * (long) expiryWarning));
+
+ checkCertificateExpiry(currentTime, expiryTestDate, _x509Certificate);
+ }
}
private static class AlwaysTrustManager implements X509TrustManager
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[4/6] qpid-broker-j git commit: NO-JIRA: [Java Broker] [Operational
Message Code Gen] Stabilise order of methods within generated code.
Posted by kw...@apache.org.
NO-JIRA: [Java Broker] [Operational Message Code Gen] Stabilise order of methods within generated code.
Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/f28d3b54
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/f28d3b54
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/f28d3b54
Branch: refs/heads/master
Commit: f28d3b547a3cd46fa27a6d45fc4b5d29abacaf40
Parents: 90e2251
Author: Keith Wall <kw...@apache.org>
Authored: Sun Jul 30 17:49:58 2017 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Sun Jul 30 18:07:22 2017 +0100
----------------------------------------------------------------------
.../logging/messages/AccessControlMessages.java | 104 ++++-----
.../AuthenticationProviderMessages.java | 130 ++++++------
.../logging/messages/BindingMessages.java | 10 +-
.../server/logging/messages/BrokerMessages.java | 182 ++++++++--------
.../logging/messages/ChannelMessages.java | 188 ++++++++---------
.../logging/messages/ConfigStoreMessages.java | 68 +++---
.../logging/messages/ConnectionMessages.java | 188 ++++++++---------
.../logging/messages/ExchangeMessages.java | 10 +-
.../messages/HighAvailabilityMessages.java | 210 +++++++++----------
.../logging/messages/KeyStoreMessages.java | 68 +++---
.../messages/ManagementConsoleMessages.java | 88 ++++----
.../logging/messages/MessageStoreMessages.java | 114 +++++-----
.../server/logging/messages/PortMessages.java | 126 +++++------
.../server/logging/messages/QueueMessages.java | 57 ++---
.../logging/messages/SubscriptionMessages.java | 126 +++++------
.../messages/TransactionLogMessages.java | 168 +++++++--------
.../logging/messages/TrustStoreMessages.java | 86 ++++----
.../logging/messages/VirtualHostMessages.java | 74 +++----
.../server/logging/GenerateLogMessages.java | 9 +-
.../qpid/server/logging/messages/LogMessages.vm | 12 +-
20 files changed, 1010 insertions(+), 1008 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
index eb8f2b3..c21ac0f 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AccessControlMessages.java
@@ -36,7 +36,7 @@ import org.apache.qpid.server.logging.LogMessage;
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class AccessControlMessages
{
@@ -64,25 +64,25 @@ public class AccessControlMessages
public static final String ACCESSCONTROL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol";
public static final String ALLOWED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.allowed";
- public static final String DENIED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.denied";
- public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.delete";
- public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.create";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.operation";
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.close";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.create";
+ public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.delete";
+ public static final String DENIED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.denied";
public static final String LOADED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.loaded";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "accesscontrol.operation";
static
{
LoggerFactory.getLogger(ACCESSCONTROL_LOG_HIERARCHY);
LoggerFactory.getLogger(ALLOWED_LOG_HIERARCHY);
- LoggerFactory.getLogger(DENIED_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DENIED_LOG_HIERARCHY);
LoggerFactory.getLogger(LOADED_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.AccessControl_logmessages", _currentLocale);
}
@@ -149,21 +149,16 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1002 : Denied : {0} {1} {2}</pre>
+ * <pre>ACL-1013 : Close</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)
+ public static LogMessage CLOSE()
{
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -176,7 +171,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return DENIED_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -209,14 +204,14 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1014 : Delete "{0}"</pre>
+ * <pre>ACL-1011 : Create "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1)
+ public static LogMessage CREATE(String param1)
{
- String rawMessage = _messages.getString("DELETE");
+ String rawMessage = _messages.getString("CREATE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -236,7 +231,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -269,14 +264,14 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1011 : Create "{0}"</pre>
+ * <pre>ACL-1014 : Delete "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATE(String param1)
+ public static LogMessage DELETE(String param1)
{
- String rawMessage = _messages.getString("CREATE");
+ String rawMessage = _messages.getString("DELETE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -296,7 +291,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -329,16 +324,16 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1016 : Operation : {0}</pre>
+ * <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 OPERATION(String param1)
+ public static LogMessage DENIED(String param1, String param2, String param3)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("DENIED");
- final Object[] messageArguments = {param1};
+ 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);
@@ -356,7 +351,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return DENIED_LOG_HIERARCHY;
}
@Override
@@ -389,16 +384,21 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1013 : Close</pre>
+ * <pre>ACL-1015 : Rules loaded : Source "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage LOADED(String param1)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("LOADED");
- final String message = rawMessage;
+ 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()
{
@@ -411,7 +411,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return LOADED_LOG_HIERARCHY;
}
@Override
@@ -444,21 +444,16 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1015 : Rules loaded : Source "{0}"</pre>
+ * <pre>ACL-1012 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage LOADED(String param1)
+ public static LogMessage OPEN()
{
- String rawMessage = _messages.getString("LOADED");
-
- 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);
+ String rawMessage = _messages.getString("OPEN");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -471,7 +466,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return LOADED_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -504,16 +499,21 @@ public class AccessControlMessages
/**
* Log a AccessControl message of the Format:
- * <pre>ACL-1012 : Open</pre>
+ * <pre>ACL-1016 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("OPERATION");
- final String message = rawMessage;
+ 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()
{
@@ -526,7 +526,7 @@ public class AccessControlMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AuthenticationProviderMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AuthenticationProviderMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AuthenticationProviderMessages.java
index a80f242..da2f15e 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AuthenticationProviderMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/AuthenticationProviderMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of AuthenticationProvider_logmessages.properties
*
- * To regenerate, edit the templates/properties and run the build with -Dgenerate=true
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class AuthenticationProviderMessages
{
@@ -63,36 +63,59 @@ public class AuthenticationProviderMessages
}
public static final String AUTHENTICATIONPROVIDER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider";
- public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.delete";
- public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.create";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.operation";
public static final String AUTHENTICATION_FAILED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.authentication_failed";
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.close";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.create";
+ public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.delete";
public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.open";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "authenticationprovider.operation";
static
{
LoggerFactory.getLogger(AUTHENTICATIONPROVIDER_LOG_HIERARCHY);
- LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(AUTHENTICATION_FAILED_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.AuthenticationProvider_logmessages", _currentLocale);
}
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1004 : Delete "{0}"</pre>
+ * <pre>ATH-1010 : Authentication Failed[ : "{0}"]</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1)
+ public static LogMessage AUTHENTICATION_FAILED(String param1, boolean opt1)
{
- String rawMessage = _messages.getString("DELETE");
+ String rawMessage = _messages.getString("AUTHENTICATION_FAILED");
+ 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.
@@ -112,7 +135,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return AUTHENTICATION_FAILED_LOG_HIERARCHY;
}
@Override
@@ -145,21 +168,16 @@ public class AuthenticationProviderMessages
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1001 : Create "{0}"</pre>
+ * <pre>ATH-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATE(String param1)
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("CREATE");
-
- 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);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -172,7 +190,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -205,14 +223,14 @@ public class AuthenticationProviderMessages
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1005 : Operation : {0}</pre>
+ * <pre>ATH-1001 : Create "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage CREATE(String param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("CREATE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -232,7 +250,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -265,37 +283,14 @@ public class AuthenticationProviderMessages
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1010 : Authentication Failed[ : "{0}"]</pre>
+ * <pre>ATH-1004 : Delete "{0}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage AUTHENTICATION_FAILED(String param1, boolean opt1)
+ public static LogMessage DELETE(String param1)
{
- String rawMessage = _messages.getString("AUTHENTICATION_FAILED");
- 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();
+ String rawMessage = _messages.getString("DELETE");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -315,7 +310,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return AUTHENTICATION_FAILED_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -348,14 +343,14 @@ public class AuthenticationProviderMessages
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1003 : Close</pre>
+ * <pre>ATH-1002 : Open</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage OPEN()
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("OPEN");
final String message = rawMessage;
@@ -370,7 +365,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return OPEN_LOG_HIERARCHY;
}
@Override
@@ -403,16 +398,21 @@ public class AuthenticationProviderMessages
/**
* Log a AuthenticationProvider message of the Format:
- * <pre>ATH-1002 : Open</pre>
+ * <pre>ATH-1005 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("OPERATION");
- final String message = rawMessage;
+ 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()
{
@@ -425,7 +425,7 @@ public class AuthenticationProviderMessages
@Override
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
index 2e7128d..1612232 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BindingMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class BindingMessages
{
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
index aa9773e..79319be 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
@@ -36,7 +36,7 @@ import org.apache.qpid.server.logging.LogMessage;
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class BrokerMessages
{
@@ -63,56 +63,61 @@ public class BrokerMessages
}
public static final String BROKER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker";
- public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
+ public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
public static final String FAILED_CHILDREN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.failed_children";
+ public static final String FATAL_ERROR_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.fatal_error";
public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.listening";
- public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode";
- public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
+ public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.operation";
public static final String PLATFORM_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.platform";
- public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
+ public static final String PROCESS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.process";
+ public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down";
+ public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
- public static final String FATAL_ERROR_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.fatal_error";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.operation";
+ public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
- public static final String PROCESS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.process";
- public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
static
{
LoggerFactory.getLogger(BROKER_LOG_HIERARCHY);
- LoggerFactory.getLogger(READY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CONFIG_LOG_HIERARCHY);
LoggerFactory.getLogger(FAILED_CHILDREN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(FATAL_ERROR_LOG_HIERARCHY);
LoggerFactory.getLogger(LISTENING_LOG_HIERARCHY);
- LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
LoggerFactory.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY);
- LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
+ LoggerFactory.getLogger(MAX_MEMORY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(PLATFORM_LOG_HIERARCHY);
- LoggerFactory.getLogger(CONFIG_LOG_HIERARCHY);
+ LoggerFactory.getLogger(PROCESS_LOG_HIERARCHY);
+ LoggerFactory.getLogger(READY_LOG_HIERARCHY);
LoggerFactory.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
- LoggerFactory.getLogger(FATAL_ERROR_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
- LoggerFactory.getLogger(PROCESS_LOG_HIERARCHY);
- LoggerFactory.getLogger(MAX_MEMORY_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale);
}
/**
* Log a Broker message of the Format:
- * <pre>BRK-1004 : Qpid Broker Ready</pre>
+ * <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 READY()
+ public static LogMessage CONFIG(String param1)
{
- String rawMessage = _messages.getString("READY");
+ String rawMessage = _messages.getString("CONFIG");
- final String message = rawMessage;
+ 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()
{
@@ -125,7 +130,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return READY_LOG_HIERARCHY;
+ return CONFIG_LOG_HIERARCHY;
}
@Override
@@ -218,16 +223,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre>
+ * <pre>BRK-1016 : Fatal error : {0} : See log file for more information</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage LISTENING(String param1, Number param2)
+ public static LogMessage FATAL_ERROR(String param1)
{
- String rawMessage = _messages.getString("LISTENING");
+ String rawMessage = _messages.getString("FATAL_ERROR");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -245,7 +250,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return LISTENING_LOG_HIERARCHY;
+ return FATAL_ERROR_LOG_HIERARCHY;
}
@Override
@@ -278,14 +283,14 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre>
+ * <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 STARTUP(String param1, String param2)
+ public static LogMessage LISTENING(String param1, Number param2)
{
- String rawMessage = _messages.getString("STARTUP");
+ String rawMessage = _messages.getString("LISTENING");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -305,7 +310,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return STARTUP_LOG_HIERARCHY;
+ return LISTENING_LOG_HIERARCHY;
}
@Override
@@ -398,16 +403,16 @@ public class BrokerMessages
/**
* 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>
+ * <pre>BRK-1011 : Maximum Memory : Heap : {0,number} bytes Direct : {1,number} bytes</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)
+ public static LogMessage MAX_MEMORY(Number param1, Number param2)
{
- String rawMessage = _messages.getString("STATS_MSGS");
+ String rawMessage = _messages.getString("MAX_MEMORY");
- final Object[] messageArguments = {param1, param2, param3};
+ 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);
@@ -425,7 +430,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return STATS_MSGS_LOG_HIERARCHY;
+ return MAX_MEMORY_LOG_HIERARCHY;
}
@Override
@@ -458,16 +463,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1010 : Platform : JVM : {0} version: {1} OS : {2} version: {3} arch: {4} cores: {5}</pre>
+ * <pre>BRK-1018 : Operation : {0}</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 param6)
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("PLATFORM");
+ String rawMessage = _messages.getString("OPERATION");
- final Object[] messageArguments = {param1, param2, param3, param4, param5, param6};
+ 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);
@@ -485,7 +490,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return PLATFORM_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -518,16 +523,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1006 : Using configuration : {0}</pre>
+ * <pre>BRK-1010 : Platform : JVM : {0} version: {1} OS : {2} version: {3} arch: {4} cores: {5}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONFIG(String param1)
+ public static LogMessage PLATFORM(String param1, String param2, String param3, String param4, String param5, String param6)
{
- String rawMessage = _messages.getString("CONFIG");
+ String rawMessage = _messages.getString("PLATFORM");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2, param3, param4, param5, param6};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -545,7 +550,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return CONFIG_LOG_HIERARCHY;
+ return PLATFORM_LOG_HIERARCHY;
}
@Override
@@ -578,16 +583,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre>
+ * <pre>BRK-1017 : Process : PID : {0}</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)
+ public static LogMessage PROCESS(String param1)
{
- String rawMessage = _messages.getString("SHUTTING_DOWN");
+ String rawMessage = _messages.getString("PROCESS");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -605,7 +610,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return SHUTTING_DOWN_LOG_HIERARCHY;
+ return PROCESS_LOG_HIERARCHY;
}
@Override
@@ -638,21 +643,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
+ * <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 STATS_DATA(Number param1, Number param2, Number param3)
+ public static LogMessage READY()
{
- 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);
+ String rawMessage = _messages.getString("READY");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -665,7 +665,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return STATS_DATA_LOG_HIERARCHY;
+ return READY_LOG_HIERARCHY;
}
@Override
@@ -698,16 +698,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1016 : Fatal error : {0} : See log file for more information</pre>
+ * <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 FATAL_ERROR(String param1)
+ public static LogMessage SHUTTING_DOWN(String param1, Number param2)
{
- String rawMessage = _messages.getString("FATAL_ERROR");
+ String rawMessage = _messages.getString("SHUTTING_DOWN");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -725,7 +725,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return FATAL_ERROR_LOG_HIERARCHY;
+ return SHUTTING_DOWN_LOG_HIERARCHY;
}
@Override
@@ -758,16 +758,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1018 : Operation : {0}</pre>
+ * <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 OPERATION(String param1)
+ public static LogMessage STARTUP(String param1, String param2)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("STARTUP");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -785,7 +785,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return STARTUP_LOG_HIERARCHY;
}
@Override
@@ -818,16 +818,21 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1005 : Stopped</pre>
+ * <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 STOPPED()
+ public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("STOPPED");
+ String rawMessage = _messages.getString("STATS_DATA");
- final String message = rawMessage;
+ 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()
{
@@ -840,7 +845,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return STOPPED_LOG_HIERARCHY;
+ return STATS_DATA_LOG_HIERARCHY;
}
@Override
@@ -873,16 +878,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1017 : Process : PID : {0}</pre>
+ * <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 PROCESS(String param1)
+ public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("PROCESS");
+ String rawMessage = _messages.getString("STATS_MSGS");
- final Object[] messageArguments = {param1};
+ 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);
@@ -900,7 +905,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return PROCESS_LOG_HIERARCHY;
+ return STATS_MSGS_LOG_HIERARCHY;
}
@Override
@@ -933,21 +938,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1011 : Maximum Memory : Heap : {0,number} bytes Direct : {1,number} bytes</pre>
+ * <pre>BRK-1005 : Stopped</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage MAX_MEMORY(Number param1, Number param2)
+ public static LogMessage STOPPED()
{
- String rawMessage = _messages.getString("MAX_MEMORY");
-
- 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);
+ String rawMessage = _messages.getString("STOPPED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -960,7 +960,7 @@ public class BrokerMessages
@Override
public String getLogHierarchy()
{
- return MAX_MEMORY_LOG_HIERARCHY;
+ return STOPPED_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
index 4815015..2acac26 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ChannelMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ChannelMessages
{
@@ -63,52 +63,52 @@ public class ChannelMessages
}
public static final String CHANNEL_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel";
- public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.create";
- public static final String FLOW_CONTROL_IGNORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_control_ignored";
public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close";
- public static final String DISCARDMSG_NOROUTE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noroute";
+ public static final String CLOSE_FORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close_forced";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.create";
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 DISCARDMSG_NOROUTE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.discardmsg_noroute";
public static final String FLOW_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow";
- public static final String PREFETCH_SIZE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.prefetch_size";
- public static final String OPEN_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.open_txn";
- public static final String CLOSE_FORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.close_forced";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.operation";
- public static final String IDLE_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.idle_txn";
+ public static final String FLOW_CONTROL_IGNORED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_control_ignored";
public static final String FLOW_ENFORCED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_enforced";
public static final String FLOW_REMOVED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.flow_removed";
- 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 OPEN_TXN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.open_txn";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.operation";
+ public static final String PREFETCH_SIZE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "channel.prefetch_size";
static
{
LoggerFactory.getLogger(CHANNEL_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
- LoggerFactory.getLogger(FLOW_CONTROL_IGNORED_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
- LoggerFactory.getLogger(DISCARDMSG_NOROUTE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSE_FORCED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
LoggerFactory.getLogger(DEADLETTERMSG_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DISCARDMSG_NOALTEXCH_LOG_HIERARCHY);
+ LoggerFactory.getLogger(DISCARDMSG_NOROUTE_LOG_HIERARCHY);
LoggerFactory.getLogger(FLOW_LOG_HIERARCHY);
- LoggerFactory.getLogger(PREFETCH_SIZE_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPEN_TXN_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSE_FORCED_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
- LoggerFactory.getLogger(IDLE_TXN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(FLOW_CONTROL_IGNORED_LOG_HIERARCHY);
LoggerFactory.getLogger(FLOW_ENFORCED_LOG_HIERARCHY);
LoggerFactory.getLogger(FLOW_REMOVED_LOG_HIERARCHY);
- LoggerFactory.getLogger(DISCARDMSG_NOALTEXCH_LOG_HIERARCHY);
+ LoggerFactory.getLogger(IDLE_TXN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPEN_TXN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(PREFETCH_SIZE_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Channel_logmessages", _currentLocale);
}
/**
* Log a Channel message of the Format:
- * <pre>CHN-1001 : Create</pre>
+ * <pre>CHN-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CREATE()
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("CREATE");
+ String rawMessage = _messages.getString("CLOSE");
final String message = rawMessage;
@@ -123,7 +123,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return CREATE_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -156,16 +156,21 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1012 : Flow Control Ignored. Channel will be closed.</pre>
+ * <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 FLOW_CONTROL_IGNORED()
+ public static LogMessage CLOSE_FORCED(Number param1, String param2)
{
- String rawMessage = _messages.getString("FLOW_CONTROL_IGNORED");
+ String rawMessage = _messages.getString("CLOSE_FORCED");
- final String message = rawMessage;
+ 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()
{
@@ -178,7 +183,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return FLOW_CONTROL_IGNORED_LOG_HIERARCHY;
+ return CLOSE_FORCED_LOG_HIERARCHY;
}
@Override
@@ -211,14 +216,14 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1003 : Close</pre>
+ * <pre>CHN-1001 : Create</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage CREATE()
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("CREATE");
final String message = rawMessage;
@@ -233,7 +238,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return CREATE_LOG_HIERARCHY;
}
@Override
@@ -266,14 +271,14 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1010 : Discarded message : {0,number} as no binding on alternate exchange : {1}</pre>
+ * <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 DISCARDMSG_NOROUTE(Number param1, String param2)
+ public static LogMessage DEADLETTERMSG(Number param1, String param2)
{
- String rawMessage = _messages.getString("DISCARDMSG_NOROUTE");
+ String rawMessage = _messages.getString("DEADLETTERMSG");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -293,7 +298,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return DISCARDMSG_NOROUTE_LOG_HIERARCHY;
+ return DEADLETTERMSG_LOG_HIERARCHY;
}
@Override
@@ -326,16 +331,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1011 : Message : {0,number} moved to dead letter queue : {1}</pre>
+ * <pre>CHN-1009 : Discarded message : {0,number} as no alternate binding 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 DEADLETTERMSG(Number param1, String param2)
+ public static LogMessage DISCARDMSG_NOALTEXCH(Number param1, String param2, String param3)
{
- String rawMessage = _messages.getString("DEADLETTERMSG");
+ String rawMessage = _messages.getString("DISCARDMSG_NOALTEXCH");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -353,7 +358,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return DEADLETTERMSG_LOG_HIERARCHY;
+ return DISCARDMSG_NOALTEXCH_LOG_HIERARCHY;
}
@Override
@@ -386,16 +391,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1002 : Flow {0}</pre>
+ * <pre>CHN-1010 : Discarded message : {0,number} as alternate binding yields no routes : {1}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FLOW(String param1)
+ public static LogMessage DISCARDMSG_NOROUTE(Number param1, String param2)
{
- String rawMessage = _messages.getString("FLOW");
+ String rawMessage = _messages.getString("DISCARDMSG_NOROUTE");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -413,7 +418,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return FLOW_LOG_HIERARCHY;
+ return DISCARDMSG_NOROUTE_LOG_HIERARCHY;
}
@Override
@@ -446,16 +451,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}</pre>
+ * <pre>CHN-1002 : Flow {0}</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)
+ public static LogMessage FLOW(String param1)
{
- String rawMessage = _messages.getString("PREFETCH_SIZE");
+ String rawMessage = _messages.getString("FLOW");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -473,7 +478,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return PREFETCH_SIZE_LOG_HIERARCHY;
+ return FLOW_LOG_HIERARCHY;
}
@Override
@@ -506,21 +511,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1007 : Open Transaction : {0,number} ms</pre>
+ * <pre>CHN-1012 : Flow Control Ignored. Channel will be closed.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN_TXN(Number param1)
+ public static LogMessage FLOW_CONTROL_IGNORED()
{
- 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);
+ String rawMessage = _messages.getString("FLOW_CONTROL_IGNORED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -533,7 +533,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return OPEN_TXN_LOG_HIERARCHY;
+ return FLOW_CONTROL_IGNORED_LOG_HIERARCHY;
}
@Override
@@ -566,16 +566,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1003 : Close : {0,number} - {1}</pre>
+ * <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 CLOSE_FORCED(Number param1, String param2)
+ public static LogMessage FLOW_ENFORCED(String param1)
{
- String rawMessage = _messages.getString("CLOSE_FORCED");
+ String rawMessage = _messages.getString("FLOW_ENFORCED");
- final Object[] messageArguments = {param1, param2};
+ 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);
@@ -593,7 +593,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_FORCED_LOG_HIERARCHY;
+ return FLOW_ENFORCED_LOG_HIERARCHY;
}
@Override
@@ -626,21 +626,16 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1014 : Operation : {0}</pre>
+ * <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 OPERATION(String param1)
+ public static LogMessage FLOW_REMOVED()
{
- String rawMessage = _messages.getString("OPERATION");
-
- 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);
+ String rawMessage = _messages.getString("FLOW_REMOVED");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -653,7 +648,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return FLOW_REMOVED_LOG_HIERARCHY;
}
@Override
@@ -746,14 +741,14 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1005 : Flow Control Enforced (Queue {0})</pre>
+ * <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 FLOW_ENFORCED(String param1)
+ public static LogMessage OPEN_TXN(Number param1)
{
- String rawMessage = _messages.getString("FLOW_ENFORCED");
+ String rawMessage = _messages.getString("OPEN_TXN");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -773,7 +768,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return FLOW_ENFORCED_LOG_HIERARCHY;
+ return OPEN_TXN_LOG_HIERARCHY;
}
@Override
@@ -806,16 +801,21 @@ public class ChannelMessages
/**
* Log a Channel message of the Format:
- * <pre>CHN-1006 : Flow Control Removed</pre>
+ * <pre>CHN-1014 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FLOW_REMOVED()
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("FLOW_REMOVED");
+ String rawMessage = _messages.getString("OPERATION");
- final String message = rawMessage;
+ 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()
{
@@ -828,7 +828,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return FLOW_REMOVED_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -861,16 +861,16 @@ public class ChannelMessages
/**
* 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>
+ * <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 DISCARDMSG_NOALTEXCH(Number param1, String param2, String param3)
+ public static LogMessage PREFETCH_SIZE(Number param1, Number param2)
{
- String rawMessage = _messages.getString("DISCARDMSG_NOALTEXCH");
+ String rawMessage = _messages.getString("PREFETCH_SIZE");
- final Object[] messageArguments = {param1, param2, param3};
+ 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);
@@ -888,7 +888,7 @@ public class ChannelMessages
@Override
public String getLogHierarchy()
{
- return DISCARDMSG_NOALTEXCH_LOG_HIERARCHY;
+ return PREFETCH_SIZE_LOG_HIERARCHY;
}
@Override
http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/f28d3b54/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
index ece4439..05de6ac 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ConfigStoreMessages.java
@@ -22,21 +22,21 @@ package org.apache.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.server.logging.LogMessage;
-
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.logging.LogMessage;
+
/**
* 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
+ * To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class ConfigStoreMessages
{
@@ -63,34 +63,34 @@ public class ConfigStoreMessages
}
public static final String CONFIGSTORE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore";
- public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_start";
- 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 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 RECOVERY_COMPLETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_complete";
+ public static final String RECOVERY_START_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.recovery_start";
+ public static final String STORE_LOCATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "configstore.store_location";
static
{
LoggerFactory.getLogger(CONFIGSTORE_LOG_HIERARCHY);
- LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
- LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATED_LOG_HIERARCHY);
LoggerFactory.getLogger(RECOVERY_COMPLETE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(RECOVERY_START_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STORE_LOCATION_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ConfigStore_logmessages", _currentLocale);
}
/**
* Log a ConfigStore message of the Format:
- * <pre>CFG-1004 : Recovery Start</pre>
+ * <pre>CFG-1003 : Closed</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage RECOVERY_START()
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("RECOVERY_START");
+ String rawMessage = _messages.getString("CLOSE");
final String message = rawMessage;
@@ -105,7 +105,7 @@ public class ConfigStoreMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_START_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -193,21 +193,16 @@ public class ConfigStoreMessages
/**
* Log a ConfigStore message of the Format:
- * <pre>CFG-1002 : Store location : {0}</pre>
+ * <pre>CFG-1005 : Recovery Complete</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STORE_LOCATION(String param1)
+ public static LogMessage RECOVERY_COMPLETE()
{
- 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);
+ String rawMessage = _messages.getString("RECOVERY_COMPLETE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -220,7 +215,7 @@ public class ConfigStoreMessages
@Override
public String getLogHierarchy()
{
- return STORE_LOCATION_LOG_HIERARCHY;
+ return RECOVERY_COMPLETE_LOG_HIERARCHY;
}
@Override
@@ -253,14 +248,14 @@ public class ConfigStoreMessages
/**
* Log a ConfigStore message of the Format:
- * <pre>CFG-1003 : Closed</pre>
+ * <pre>CFG-1004 : Recovery Start</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage RECOVERY_START()
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("RECOVERY_START");
final String message = rawMessage;
@@ -275,7 +270,7 @@ public class ConfigStoreMessages
@Override
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return RECOVERY_START_LOG_HIERARCHY;
}
@Override
@@ -308,16 +303,21 @@ public class ConfigStoreMessages
/**
* Log a ConfigStore message of the Format:
- * <pre>CFG-1005 : Recovery Complete</pre>
+ * <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 RECOVERY_COMPLETE()
+ public static LogMessage STORE_LOCATION(String param1)
{
- String rawMessage = _messages.getString("RECOVERY_COMPLETE");
+ String rawMessage = _messages.getString("STORE_LOCATION");
- final String message = rawMessage;
+ 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()
{
@@ -330,7 +330,7 @@ public class ConfigStoreMessages
@Override
public String getLogHierarchy()
{
- return RECOVERY_COMPLETE_LOG_HIERARCHY;
+ return STORE_LOCATION_LOG_HIERARCHY;
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org