You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2013/09/20 20:59:50 UTC
svn commit: r1525101 [12/21] - in /qpid/branches/linearstore/qpid: ./ bin/
cpp/ cpp/bindings/ cpp/bindings/qmf/ cpp/bindings/qmf/python/
cpp/bindings/qmf/ruby/ cpp/bindings/qmf/tests/ cpp/bindings/qmf2/
cpp/bindings/qmf2/examples/cpp/ cpp/bindings/qmf2...
Propchange: qpid/branches/linearstore/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Sep 20 18:59:30 2013
@@ -0,0 +1,15 @@
+/qpid/branches/0.5.x-dev/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:886720-886722
+/qpid/branches/0.5.x-dev/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:886720-886722
+/qpid/branches/0.5.x-dev/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:886720-886722,887145,892761,894875,916304,916325,930288,931179
+/qpid/branches/0.5.x-dev/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:886720-886722,887145,892761,894875,916304,916325,930288,931179
+/qpid/branches/java-broker-0-10/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:795950-829653
+/qpid/branches/java-broker-0-10/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:795950-829653
+/qpid/branches/java-broker-vhost-refactor/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:1493674-1494547
+/qpid/branches/java-broker-vhost-refactor/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:1493674-1494547
+/qpid/branches/java-network-refactor/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:805429-821809
+/qpid/branches/java-network-refactor/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:805429-821809
+/qpid/branches/qpid-2935/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:1061302-1072333
+/qpid/branches/qpid-2935/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:1061302-1072333
+/qpid/trunk/qpid/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:796646-796653
+/qpid/trunk/qpid/broker-plugins/management-http/src/main/java/resources/virtualhost/store/pool:796646-796653
+/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/pool:1502835-1525056
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Fri Sep 20 18:59:30 2013
@@ -20,9 +20,9 @@
*/
package org.apache.qpid.server.management.plugin;
-import java.io.File;
import java.lang.reflect.Type;
import java.net.SocketAddress;
+import java.security.GeneralSecurityException;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
@@ -31,6 +31,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.UUID;
+import javax.net.ssl.SSLContext;
import org.apache.log4j.Logger;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -39,11 +40,15 @@ import org.apache.qpid.server.management
import org.apache.qpid.server.management.plugin.filter.RedirectingAuthorisationFilter;
import org.apache.qpid.server.management.plugin.servlet.DefinedFileServlet;
import org.apache.qpid.server.management.plugin.servlet.FileServlet;
+import org.apache.qpid.server.management.plugin.servlet.LogFileServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.HelperServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.LogFileListingServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.LogRecordsServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.LogoutServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.MessageContentServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.MessageServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.PreferencesServlet;
+import org.apache.qpid.server.management.plugin.servlet.rest.UserPreferencesServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.RestServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.SaslServlet;
import org.apache.qpid.server.management.plugin.servlet.rest.StructureServlet;
@@ -60,6 +65,7 @@ import org.apache.qpid.server.model.Grou
import org.apache.qpid.server.model.KeyStore;
import org.apache.qpid.server.model.Plugin;
import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.PreferencesProvider;
import org.apache.qpid.server.model.Protocol;
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.model.Session;
@@ -70,7 +76,6 @@ import org.apache.qpid.server.model.User
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.model.adapter.AbstractPluginAdapter;
import org.apache.qpid.server.plugin.PluginFactory;
-import org.apache.qpid.server.security.SubjectCreator;
import org.apache.qpid.server.util.MapValueConverter;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.DispatcherType;
@@ -238,13 +243,17 @@ public class HttpManagement extends Abst
{
throw new IllegalConfigurationException("Key store is not configured. Cannot start management on HTTPS port without keystore");
}
- String keyStorePath = (String)keyStore.getAttribute(KeyStore.PATH);
- String keyStorePassword = keyStore.getPassword();
-
SslContextFactory factory = new SslContextFactory();
- factory.setKeyStorePath(keyStorePath);
- factory.setKeyStorePassword(keyStorePassword);
-
+ try
+ {
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(keyStore.getKeyManagers(), null, null);
+ factory.setSslContext(sslContext);
+ }
+ catch (GeneralSecurityException e)
+ {
+ throw new RuntimeException("Cannot configure port " + port.getName() + " for transport " + Transport.SSL, e);
+ }
connector = new SslSocketConnector(factory);
}
else
@@ -288,7 +297,10 @@ public class HttpManagement extends Abst
addRestServlet(root, "keystore", KeyStore.class);
addRestServlet(root, "truststore", TrustStore.class);
addRestServlet(root, "plugin", Plugin.class);
+ addRestServlet(root, "preferencesprovider", AuthenticationProvider.class, PreferencesProvider.class);
+ root.addServlet(new ServletHolder(new UserPreferencesServlet()), "/rest/userpreferences/*");
+ root.addServlet(new ServletHolder(new PreferencesServlet()), "/rest/preferences");
root.addServlet(new ServletHolder(new StructureServlet()), "/rest/structure");
root.addServlet(new ServletHolder(new MessageServlet()), "/rest/message/*");
root.addServlet(new ServletHolder(new MessageContentServlet()), "/rest/message-content/*");
@@ -312,6 +324,15 @@ public class HttpManagement extends Abst
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.txt");
root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.xsl");
root.addServlet(new ServletHolder(new HelperServlet()), "/rest/helper");
+ root.addServlet(new ServletHolder(new LogFileListingServlet()), "/rest/logfiles");
+ root.addServlet(new ServletHolder(new LogFileServlet()), "/rest/logfile");
+
+ String[] timeZoneFiles = {"africa", "antarctica", "asia", "australasia", "backward",
+ "etcetera", "europe", "northamerica", "pacificnew", "southamerica"};
+ for (String timeZoneFile : timeZoneFiles)
+ {
+ root.addServlet(new ServletHolder(FileServlet.INSTANCE), "/dojo/dojox/date/zoneinfo/" + timeZoneFile);
+ }
final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
sessionManager.setSessionCookie(JSESSIONID_COOKIE_PREFIX + lastPort);
@@ -407,9 +428,9 @@ public class HttpManagement extends Abst
}
@Override
- public SubjectCreator getSubjectCreator(SocketAddress localAddress)
+ public AuthenticationProvider getAuthenticationProvider(SocketAddress localAddress)
{
- return getBroker().getSubjectCreator(localAddress);
+ return getBroker().getAuthenticationProvider(localAddress);
}
@Override
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementConfiguration.java Fri Sep 20 18:59:30 2013
@@ -22,7 +22,7 @@ package org.apache.qpid.server.managemen
import java.net.SocketAddress;
-import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.model.AuthenticationProvider;
public interface HttpManagementConfiguration
{
@@ -34,5 +34,5 @@ public interface HttpManagementConfigura
boolean isHttpBasicAuthenticationEnabled();
- SubjectCreator getSubjectCreator(SocketAddress localAddress);
+ AuthenticationProvider getAuthenticationProvider(SocketAddress localAddress);
}
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java Fri Sep 20 18:59:30 2013
@@ -168,7 +168,7 @@ public class HttpManagementUtil
{
Subject subject = null;
SocketAddress localAddress = getSocketAddress(request);
- SubjectCreator subjectCreator = managementConfig.getSubjectCreator(localAddress);
+ SubjectCreator subjectCreator = managementConfig.getAuthenticationProvider(localAddress).getSubjectCreator();
String remoteUser = request.getRemoteUser();
if (remoteUser != null || subjectCreator.isAnonymousAuthenticationAllowed())
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/AbstractServlet.java Fri Sep 20 18:59:30 2013
@@ -21,6 +21,7 @@
package org.apache.qpid.server.management.plugin.servlet.rest;
import java.io.IOException;
+import java.io.PrintWriter;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
@@ -40,6 +41,10 @@ import org.apache.qpid.server.management
import org.apache.qpid.server.management.plugin.HttpManagementUtil;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.security.SecurityManager;
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
public abstract class AbstractServlet extends HttpServlet
{
@@ -219,14 +224,7 @@ public abstract class AbstractServlet ex
}
finally
{
- try
- {
- SecurityManager.setThreadSubject(null);
- }
- finally
- {
- AMQShortString.clearLocalCache();
- }
+ SecurityManager.setThreadSubject(null);
}
}
@@ -261,4 +259,20 @@ public abstract class AbstractServlet ex
throw new RuntimeException("Failed to send error response code " + errorCode, e);
}
}
+
+ protected void sendJsonResponse(Object object, HttpServletResponse response) throws IOException,
+ JsonGenerationException, JsonMappingException
+ {
+ response.setStatus(HttpServletResponse.SC_OK);
+
+ response.setHeader("Cache-Control","no-cache");
+ response.setHeader("Pragma","no-cache");
+ response.setDateHeader ("Expires", 0);
+ response.setContentType("application/json");
+
+ final PrintWriter writer = response.getWriter();
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+ mapper.writeValue(writer, object);
+ }
}
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/HelperServlet.java Fri Sep 20 18:59:30 2013
@@ -41,6 +41,8 @@ import org.codehaus.jackson.map.Serializ
public class HelperServlet extends AbstractServlet
{
+ private static final long serialVersionUID = 1L;
+
private static final String PARAM_ACTION = "action";
private Map<String, Action> _actions;
@@ -55,6 +57,8 @@ public class HelperServlet extends Abstr
new ListAuthenticationProviderAttributes(),
new ListBrokerAttribute(Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES, "ListMessageStoreTypes"),
new ListBrokerAttribute(Broker.SUPPORTED_VIRTUALHOST_TYPES, "ListVirtualHostTypes"),
+ new ListBrokerAttribute(Broker.SUPPORTED_PREFERENCES_PROVIDERS_TYPES, "ListPreferencesProvidersTypes"),
+ new ListBrokerAttribute(Broker.PRODUCT_VERSION, "version"),
new ListGroupProviderAttributes(),
new ListAccessControlProviderAttributes(),
new PluginClassProviderAction()
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java Fri Sep 20 18:59:30 2013
@@ -31,6 +31,10 @@ import org.codehaus.jackson.map.Serializ
public class LogRecordsServlet extends AbstractServlet
{
+ private static final long serialVersionUID = 2L;
+
+ public static final String PARAM_LAST_LOG_ID = "lastLogId";
+
public LogRecordsServlet()
{
super();
@@ -46,12 +50,31 @@ public class LogRecordsServlet extends A
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
+ if (!getBroker().getSecurityManager().authoriseLogsAccess())
+ {
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Broker logs access is denied");
+ return;
+ }
+
+ long lastLogId = 0;
+ try
+ {
+ lastLogId = Long.parseLong(request.getParameter(PARAM_LAST_LOG_ID));
+ }
+ catch(Exception e)
+ {
+ // ignore null and incorrect parameter values
+ }
+
List<Map<String,Object>> logRecords = new ArrayList<Map<String, Object>>();
LogRecorder logRecorder = getBroker().getLogRecorder();
for(LogRecorder.Record record : logRecorder)
{
- logRecords.add(logRecordToObject(record));
+ if (record.getId() > lastLogId)
+ {
+ logRecords.add(logRecordToObject(record));
+ }
}
final PrintWriter writer = response.getWriter();
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java Fri Sep 20 18:59:30 2013
@@ -80,6 +80,7 @@ public class MessageServlet extends Abst
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
+ response.setContentType("application/json");
final PrintWriter writer = response.getWriter();
ObjectMapper mapper = new ObjectMapper();
@@ -352,20 +353,32 @@ public class MessageServlet extends Abst
if(messageHeader != null)
{
addIfPresent(object, "messageId", messageHeader.getMessageId());
- addIfPresent(object, "expirationTime", messageHeader.getExpiration());
+ addIfPresentAndNotZero(object, "expirationTime", messageHeader.getExpiration());
addIfPresent(object, "applicationId", messageHeader.getAppId());
addIfPresent(object, "correlationId", messageHeader.getCorrelationId());
addIfPresent(object, "encoding", messageHeader.getEncoding());
addIfPresent(object, "mimeType", messageHeader.getMimeType());
addIfPresent(object, "priority", messageHeader.getPriority());
addIfPresent(object, "replyTo", messageHeader.getReplyTo());
- addIfPresent(object, "timestamp", messageHeader.getTimestamp());
+ addIfPresentAndNotZero(object, "timestamp", messageHeader.getTimestamp());
addIfPresent(object, "type", messageHeader.getType());
addIfPresent(object, "userId", messageHeader.getUserId());
}
}
+ private void addIfPresentAndNotZero(Map<String, Object> object, String name, Object property)
+ {
+ if(property instanceof Number)
+ {
+ Number value = (Number)property;
+ if (value.longValue() != 0)
+ {
+ object.put(name, property);
+ }
+ }
+ }
+
private void addIfPresent(Map<String, Object> object, String name, Object property)
{
if(property != null)
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java Fri Sep 20 18:59:30 2013
@@ -123,7 +123,7 @@ public class RestServlet extends Abstrac
if(names.size() > _hierarchy.length)
{
- throw new IllegalArgumentException("Too many entries in path");
+ throw new IllegalArgumentException("Too many entries in path. Expected " + _hierarchy.length + "; path: " + names);
}
}
@@ -337,7 +337,7 @@ public class RestServlet extends Abstrac
if(names.size() != _hierarchy.length)
{
throw new IllegalArgumentException("Path to object to create must be fully specified. "
- + "Found " + names.size() + " expecting " + _hierarchy.length);
+ + "Found " + names + " of size " + names.size() + " expecting " + _hierarchy.length);
}
}
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/SaslServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/SaslServlet.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/SaslServlet.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/SaslServlet.java Fri Sep 20 18:59:30 2013
@@ -278,7 +278,7 @@ public class SaslServlet extends Abstrac
private SubjectCreator getSubjectCreator(HttpServletRequest request)
{
SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
- return HttpManagementUtil.getManagementConfiguration(getServletContext()).getSubjectCreator(localAddress);
+ return HttpManagementUtil.getManagementConfiguration(getServletContext()).getAuthenticationProvider(localAddress).getSubjectCreator();
}
@Override
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css Fri Sep 20 18:59:30 2013
@@ -92,4 +92,74 @@ div .messages {
.formLabel-labelCell {
font-weight: bold;
+}
+
+.columnDefDialogButtonIcon {
+ background: url("../dojo/dojox/grid/enhanced/resources/images/sprite_icons.png") no-repeat;
+ background-position: -260px 2px;
+ width: 14px;
+ height: 14px;
+}
+
+.logViewerIcon {
+ background: url("../images/log-viewer.png") no-repeat;
+ width: 14px;
+ height: 16px;
+}
+
+.downloadLogsIcon {
+ background: url("../images/download.png") no-repeat;
+ width: 14px;
+ height: 14px;
+}
+
+.dojoxGridFBarClearFilterButtontnIcon
+{
+ background: url("../dojo/dojox/grid/enhanced/resources/images/sprite_icons.png") no-repeat;
+ background-position: -120px -18px;
+ width: 14px;
+ height: 14px;
+}
+
+.rowNumberLimitIcon
+{
+ background: url("../dojo/dojox/grid/enhanced/resources/images/sprite_icons.png") no-repeat;
+ background-position: -240px -18px;
+ width: 14px;
+ height: 14px;
+}
+
+.gridRefreshIcon
+{
+ background: url("../images/refresh.png") no-repeat;
+ width: 16px;
+ height: 16px;
+}
+
+.gridAutoRefreshIcon
+{
+ background: url("../images/auto-refresh.png") no-repeat;
+ width: 16px;
+ height: 16px;
+}
+
+.redBackground tr{ background-color:#ffdcd7 !important; background-image: none !important;}
+.yellowBackground tr{background-color:#fbfddf !important; background-image: none !important;}
+.grayBackground tr{background-color:#eeeeee !important; background-image: none !important;}
+.dojoxGridRowOdd.grayBackground tr{ background-color:#e9e9e9 !important; background-image: none !important;}
+.dojoxGridRowOdd.yellowBackground tr{background-color:#fafdd5 !important; background-image: none !important;}
+.dojoxGridRowOdd.redBackground tr{background-color:#f4c1c1 !important; background-image: none !important;}
+
+.preferencesIcon
+{
+ background: url("../images/gear.png") no-repeat;
+ width: 16px;
+ height: 16px;
+}
+
+.helpIcon
+{
+ background: url("../images/help.png") no-repeat;
+ width: 16px;
+ height: 16px;
}
\ No newline at end of file
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/images/qpid-logo.png
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/images/qpid-logo.png?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
Files qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/images/qpid-logo.png (original) and qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/images/qpid-logo.png Fri Sep 20 18:59:30 2013 differ
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html Fri Sep 20 18:59:30 2013
@@ -42,7 +42,6 @@
var dojoConfig = {
tlmSiblingOfDojo:false,
- parseOnLoad:true,
async:true,
baseUrl: getContextPath(),
packages:[
@@ -58,7 +57,14 @@
</script>
<script>
- require(["dijit/layout/BorderContainer",
+ var qpidHelpLocation = "http://qpid.apache.org/releases/qpid-";
+ var qpidHelpURL = null;
+ var qpidPreferences = null;
+ require([
+ "dojo/_base/xhr",
+ "dojo/parser",
+ "qpid/management/Preferences",
+ "dijit/layout/BorderContainer",
"dijit/layout/TabContainer",
"dijit/layout/ContentPane",
"dijit/TitlePane",
@@ -66,7 +72,18 @@
"qpid/management/treeView",
"qpid/management/controller",
"qpid/common/footer",
- "qpid/authorization/checkUser"]);
+ "qpid/authorization/checkUser"], function(xhr, parser, Preferences){
+ parser.parse();
+ qpidPreferences = new Preferences();
+ xhr.get({
+ sync: true,
+ url: "rest/helper?action=version",
+ handleAs: "json"
+ }).then(function(qpidVersion) {
+ qpidHelpURL = qpidHelpLocation + qpidVersion + "/java-broker/book/index.html";
+ });
+
+ });
</script>
</head>
@@ -75,7 +92,27 @@
<div id="pageLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline', gutters: false">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
<div id="header" class="header" style="float: left; width: 300px"></div>
- <div id="login" style="float: right; display:none"><strong>User: </strong> <span id="authenticatedUser"></span><a href="logout">[logout]</a></div>
+ <div style="float: right;">
+ <div id="login" style="display:none"><strong>User: </strong> <span id="authenticatedUser"></span><a href="logout">[logout]</a></div>
+ <div id="preferencesButton" style="float: right; margin-top: 0px;" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'preferencesIcon', title: 'Preferences', showLabel:false">
+ <div data-dojo-type="dijit.Menu">
+ <div data-dojo-type="dijit.MenuItem" data-dojo-props="
+ iconClass: 'dijitIconFunction',
+ onClick: function(){ qpidPreferences.showDialog(); } ">
+ Preferences
+ </div>
+ <!--
+ <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass: 'dijitIconMail', onClick: function(){ console.log('TODO'); }">
+ Contacts
+ </div>
+ -->
+ <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass: 'helpIcon', onClick: function(){
+ var newWindow = window.open(qpidHelpURL,'QpidHelp','height=600,width=600,scrollbars=1,location=1,resizable=1,status=0,toolbar=0,titlebar=1,menubar=0',true); newWindow.focus(); } ">
+ Help
+ </div>
+ </div>
+ </div>
+ </div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'leading', splitter: true" style="width:20%">
<div qpid-type="treeView" qpid-props="query: 'rest/structure'" ></div>
@@ -104,4 +141,4 @@
</div>
</body>
-</html>
\ No newline at end of file
+</html>
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/authorization/checkUser.js Fri Sep 20 18:59:30 2013
@@ -29,7 +29,7 @@ var updateUI = function updateUI(data)
if(data.user)
{
dom.byId("authenticatedUser").innerHTML = entities.encode(String(data.user));
- dom.byId("login").style.display = "block";
+ dom.byId("login").style.display = "inline";
}
};
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js Fri Sep 20 18:59:30 2013
@@ -23,12 +23,13 @@ define(["dojo/store/Memory",
"dojo/data/ObjectStore",
"dojo/store/Observable"], function (Memory, DataGrid, ObjectStore, Observable) {
- function UpdatableStore( data, divName, structure, func, props, Grid ) {
+ function UpdatableStore( data, divName, structure, func, props, Grid, notObservable ) {
var that = this;
var GridType = DataGrid;
- that.store = Observable(Memory({data: data, idProperty: "id"}));
+ that.memoryStore = new Memory({data: data, idProperty: "id"});
+ that.store = notObservable? that.memoryStore : new Observable(that.memoryStore);
that.dataStore = ObjectStore({objectStore: that.store});
var gridProperties = { store: that.dataStore,
@@ -63,7 +64,7 @@ define(["dojo/store/Memory",
UpdatableStore.prototype.update = function(data)
{
-
+ var changed = false;
var store = this.store;
var theItem;
@@ -78,7 +79,7 @@ define(["dojo/store/Memory",
}
}
store.remove(object.id);
-
+ changed = true;
});
// iterate over data...
@@ -91,20 +92,84 @@ define(["dojo/store/Memory",
if(theItem[ propName ] != data[i][ propName ]) {
theItem[ propName ] = data[i][ propName ];
modified = true;
+ changed = true;
}
}
}
if(modified) {
// ... check attributes for updates
store.notify(theItem, data[i].id);
+ changed = true;
}
} else {
// ,,, if not in the store then add
store.put(data[i]);
+ changed = true;
}
}
}
+ return changed;
+ };
+
+ function removeItemsFromArray(items, numberToRemove)
+ {
+ if (items)
+ {
+ if (numberToRemove > 0 && items.length > 0)
+ {
+ if (numberToRemove >= items.length)
+ {
+ numberToRemove = numberToRemove - items.length;
+ items.length = 0
+ }
+ else
+ {
+ items.splice(0, numberToRemove);
+ numberToRemove = 0;
+ }
+ }
+ }
+ return numberToRemove;
+ };
+
+ UpdatableStore.prototype.append = function(data, limit)
+ {
+ var changed = false;
+ var items = this.memoryStore.data;
+
+ if (limit)
+ {
+ var totalSize = items.length + (data ? data.length : 0);
+ var numberToRemove = totalSize - limit;
+
+ if (numberToRemove > 0)
+ {
+ changed = true;
+ numberToRemove = removeItemsFromArray(items, numberToRemove);
+ if (numberToRemove > 0)
+ {
+ removeItemsFromArray(data, numberToRemove);
+ }
+ }
+ }
+
+ if (data && data.length > 0)
+ {
+ changed = true;
+ items.push.apply(items, data);
+ }
+
+ this.memoryStore.setData(items);
+ return changed;
+ };
+
+ UpdatableStore.prototype.close = function()
+ {
+ this.dataStore.close();
+ this.dataStore = null;
+ this.store = null;
+ this.memoryStore = null;
};
return UpdatableStore;
});
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js Fri Sep 20 18:59:30 2013
@@ -77,10 +77,10 @@ define(["dojo/_base/xhr",
return exchangeName == null || exchangeName == "" || "<<default>>" == exchangeName || exchangeName.indexOf("amq.") == 0 || exchangeName.indexOf("qpid.") == 0;
};
- util.deleteGridSelections = function(updater, grid, url, confirmationMessageStart)
+ util.deleteGridSelections = function(updater, grid, url, confirmationMessageStart, idParam)
{
var data = grid.selection.getSelected();
-
+ var success = false;
if(data.length)
{
var confirmationMessage = null;
@@ -114,18 +114,19 @@ define(["dojo/_base/xhr",
{
queryParam = "?";
}
- queryParam += "id=" + data[i].id;
+ queryParam += ( idParam || "id" ) + "=" + encodeURIComponent(data[i].id);
}
var query = url + queryParam;
- var success = true
var failureReason = "";
xhr.del({url: query, sync: true, handleAs: "json"}).then(
function(data)
{
- // TODO why query *??
- //grid.setQuery({id: "*"});
+ success = true;
grid.selection.deselectAll();
- updater.update();
+ if (updater)
+ {
+ updater.update();
+ }
},
function(error) {success = false; failureReason = error;});
if(!success )
@@ -134,6 +135,7 @@ define(["dojo/_base/xhr",
}
}
}
+ return success;
}
util.isProviderManagingUsers = function(type)
@@ -353,5 +355,21 @@ define(["dojo/_base/xhr",
}
};
+ util.errorHandler = function errorHandler(error)
+ {
+ if(error.status == 401)
+ {
+ alert("Authentication Failed");
+ }
+ else if(error.status == 403)
+ {
+ alert("Access Denied");
+ }
+ else
+ {
+ alert(error);
+ }
+ }
+
return util;
});
\ No newline at end of file
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js Fri Sep 20 18:59:30 2013
@@ -32,10 +32,13 @@ define(["dojo/_base/xhr",
"dijit/registry",
"dojo/dom-style",
"dojox/html/entities",
- "dojox/grid/enhanced/plugins/Pagination",
- "dojox/grid/enhanced/plugins/IndirectSelection",
+ "dojo/dom",
+ "qpid/management/addPreferencesProvider",
+ "qpid/management/PreferencesProvider",
+ "qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager",
"dojo/domReady!"],
- function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid, addAuthenticationProvider, event, registry, domStyle, entities) {
+ function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid,
+ addAuthenticationProvider, event, registry, domStyle, entities, dom, addPreferencesProvider, PreferencesProvider, PrincipalDatabaseAuthenticationManager) {
function AuthenticationProvider(name, parent, controller) {
this.name = name;
@@ -48,7 +51,7 @@ define(["dojo/_base/xhr",
}
AuthenticationProvider.prototype.getTitle = function() {
- return "AuthenticationProvider";
+ return "AuthenticationProvider:" + this.name;
};
AuthenticationProvider.prototype.open = function(contentPane) {
@@ -62,8 +65,6 @@ define(["dojo/_base/xhr",
that.authProviderUpdater = new AuthProviderUpdater(contentPane.containerNode, that.modelObj, that.controller, that);
- updater.add( that.authProviderUpdater );
-
that.authProviderUpdater.update();
var editButton = query(".editAuthenticationProviderButton", contentPane.containerNode)[0];
@@ -81,6 +82,15 @@ define(["dojo/_base/xhr",
event.stop(evt);
that.deleteAuthenticationProvider();
});
+
+ var addPreferencesProviderButton = query(".addPreferencesProviderButton", contentPane.containerNode)[0];
+ var addPreferencesProviderWidget = registry.byNode(addPreferencesProviderButton);
+ connect.connect(addPreferencesProviderWidget, "onClick",
+ function(evt){
+ event.stop(evt);
+ that.addPreferencesProvider();
+ });
+ updater.add( that.authProviderUpdater );
}});
};
@@ -111,6 +121,14 @@ define(["dojo/_base/xhr",
}
};
+ AuthenticationProvider.prototype.addPreferencesProvider = function() {
+ if (this.authProviderUpdater && this.authProviderUpdater.authProviderData
+ && (!this.authProviderUpdater.authProviderData.preferencesproviders
+ || !this.authProviderUpdater.authProviderData.preferencesproviders[0])){
+ addPreferencesProvider.show(this.name);
+ }
+ };
+
function AuthProviderUpdater(node, authProviderObj, controller, authenticationProvider)
{
this.controller = controller;
@@ -118,6 +136,13 @@ define(["dojo/_base/xhr",
this.type = query(".type", node)[0];
this.state = query(".state", node)[0];
this.authenticationProvider = authenticationProvider;
+ this.preferencesProviderType=dom.byId("preferencesProviderType");
+ this.preferencesProviderName=dom.byId("preferencesProviderName");
+ this.preferencesProviderState=dom.byId("preferencesProviderState");
+ this.addPreferencesProviderButton = query(".addPreferencesProviderButton", node)[0];
+ this.editPreferencesProviderButton = query(".editPreferencesProviderButton", node)[0];
+ this.deletePreferencesProviderButton = query(".deletePreferencesProviderButton", node)[0];
+ this.preferencesProviderAttributes = dom.byId("preferencesProviderAttributes")
this.query = "rest/authenticationprovider/" + encodeURIComponent(authProviderObj.name);
@@ -139,16 +164,46 @@ define(["dojo/_base/xhr",
if (util.isProviderManagingUsers(that.authProviderData.type))
{
- require(["qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager"],
- function(PrincipalDatabaseAuthenticationManager) {
- that.details = new PrincipalDatabaseAuthenticationManager(node, data[0], controller, that);
- that.details.update();
- });
+ that.details = new PrincipalDatabaseAuthenticationManager(node, that.authProviderData, controller);
+ that.details.update(that.authProviderData);
+ }
+ if (that.authProviderData.type == "Anonymous")
+ {
+ var authenticationProviderPanel = registry.byNode( query(".preferencesPanel", node)[0]);
+ domStyle.set(authenticationProviderPanel.domNode, "display","none");
+ }
+ else
+ {
+ var preferencesProviderData = that.authProviderData.preferencesproviders? that.authProviderData.preferencesproviders[0]: null;
+ that.preferencesNode = query(".preferencesProviderDetails", node)[0];
+ that.updatePreferencesProvider(preferencesProviderData);
}
});
}
+ AuthProviderUpdater.prototype.updatePreferencesProvider = function(preferencesProviderData)
+ {
+ if (preferencesProviderData)
+ {
+ this.addPreferencesProviderButton.style.display = 'none';
+ if (!this.preferencesProvider)
+ {
+ this.preferencesProvider=new PreferencesProvider(preferencesProviderData.name, this.authProviderData);
+ this.preferencesProvider.init(this.preferencesNode);
+ }
+ this.preferencesProvider.update(preferencesProviderData);
+ }
+ else
+ {
+ if (this.preferencesProvider)
+ {
+ this.preferencesProvider.update(null);
+ }
+ this.addPreferencesProviderButton.style.display = 'inline';
+ }
+ };
+
AuthProviderUpdater.prototype.updateHeader = function()
{
this.authenticationProvider.name = this.authProviderData[ "name" ]
@@ -159,8 +214,44 @@ define(["dojo/_base/xhr",
AuthProviderUpdater.prototype.update = function()
{
+ var that = this;
- var that = this;
+ xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
+ .then(function(data) {
+ that.authProviderData = data[0];
+ that.name = data[0].name
+ util.flattenStatistics( that.authProviderData );
+ that.updateHeader();
+ if (that.details)
+ {
+ try
+ {
+ that.details.update(that.authProviderData);
+ }
+ catch(e)
+ {
+ if (console)
+ {
+ console.error(e);
+ }
+ }
+ }
+ var preferencesProviderData = that.authProviderData.preferencesproviders? that.authProviderData.preferencesproviders[0]: null;
+ if (preferencesProviderData)
+ {
+ try
+ {
+ that.updatePreferencesProvider(preferencesProviderData);
+ }
+ catch(e)
+ {
+ if (console)
+ {
+ console.error(e);
+ }
+ }
+ }
+ });
};
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js Fri Sep 20 18:59:30 2013
@@ -352,6 +352,12 @@ define(["dojo/_base/xhr",
that.brokerUpdater.update();
+ var logViewerButton = query(".logViewer", contentPane.containerNode)[0];
+ registry.byNode(logViewerButton).on("click", function(evt){
+ that.controller.show("logViewer", null, null);
+ });
+
+
var addProviderButton = query(".addAuthenticationProvider", contentPane.containerNode)[0];
connect.connect(registry.byNode(addProviderButton), "onClick", function(evt){ addAuthenticationProvider.show(); });
@@ -664,43 +670,6 @@ define(["dojo/_base/xhr",
}, gridProperties, EnhancedGrid);
that.displayACLWarnMessage(aclData);
});
-
- xhr.get({url: "rest/logrecords", sync: properties.useSyncGet, handleAs: "json"})
- .then(function(data)
- {
- that.logData = data;
-
- var gridProperties = {
- height: 400,
- plugins: {
- pagination: {
- pageSizes: ["10", "25", "50", "100"],
- description: true,
- sizeSwitch: true,
- pageStepper: true,
- gotoButton: true,
- maxPageStep: 4,
- position: "bottom"
- }
- }};
-
-
- that.logfileGrid =
- new UpdatableStore(that.logData, query(".broker-logfile")[0],
- [ { name: "Timestamp", field: "timestamp", width: "200px",
- formatter: function(val) {
- var d = new Date(0);
- d.setUTCSeconds(val/1000);
-
- return d.toLocaleString();
- }},
- { name: "Level", field: "level", width: "60px"},
- { name: "Logger", field: "logger", width: "280px"},
- { name: "Thread", field: "thread", width: "120px"},
- { name: "Log Message", field: "message", width: "100%"}
-
- ], null, gridProperties, EnhancedGrid);
- });
}
BrokerUpdater.prototype.updateHeader = function()
@@ -805,15 +774,6 @@ define(["dojo/_base/xhr",
that.displayACLWarnMessage(data);
}
});
-
-
- xhr.get({url: "rest/logrecords", sync: properties.useSyncGet, handleAs: "json"})
- .then(function(data)
- {
- that.logData = data;
- that.logfileGrid.update(that.logData);
- });
-
};
BrokerUpdater.prototype.showReadOnlyAttributes = function()
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js Fri Sep 20 18:59:30 2013
@@ -31,6 +31,7 @@ define(["dojo/_base/xhr",
"dijit/form/FilteringSelect",
"dojo/_base/connect",
"dojo/dom-style",
+ "qpid/management/addPreferencesProvider",
/* dojox/ validate resources */
"dojox/validate/us", "dojox/validate/web",
/* basic dijit classes */
@@ -44,7 +45,7 @@ define(["dojo/_base/xhr",
"dojox/form/BusyButton", "dojox/form/CheckedMultiSelect",
"dojox/layout/TableContainer",
"dojo/domReady!"],
- function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle) {
+ function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, addPreferencesProvider) {
var addAuthenticationProvider = {};
@@ -163,6 +164,10 @@ define(["dojo/_base/xhr",
if(this.success === true)
{
registry.byId("addAuthenticationProvider").hide();
+ if (newAuthenticationManager.type != "Anonymous" && dojo.byId("formAddAuthenticationProvider.id").value == "")
+ {
+ addPreferencesProvider.show(newAuthenticationManager.name);
+ }
}
else
{
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js Fri Sep 20 18:59:30 2013
@@ -30,7 +30,6 @@ define(["dojo/_base/xhr",
"dijit/registry",
"qpid/common/util",
"qpid/common/properties",
- "qpid/common/updater",
"qpid/common/UpdatableStore",
"dojox/grid/EnhancedGrid",
"dojox/grid/enhanced/plugins/Pagination",
@@ -43,8 +42,8 @@ define(["dojo/_base/xhr",
"dijit/form/Form",
"dijit/form/DateTextBox",
"dojo/domReady!"],
- function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater, UpdatableStore, EnhancedGrid) {
- function DatabaseAuthManager(containerNode, authProviderObj, controller, authenticationManagerUpdater) {
+ function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, UpdatableStore, EnhancedGrid) {
+ function DatabaseAuthManager(containerNode, authProviderObj, controller) {
var node = construct.create("div", null, containerNode, "last");
var that = this;
this.name = authProviderObj.name;
@@ -53,14 +52,7 @@ define(["dojo/_base/xhr",
load: function(data) {
node.innerHTML = data;
parser.parse(node);
-
-
- that.authDatabaseUpdater= new AuthProviderUpdater(node, authProviderObj, controller, authenticationManagerUpdater);
- updater.add( that.authDatabaseUpdater);
-
- that.authDatabaseUpdater.update();
-
-
+ that.init(node, authProviderObj, controller);
}});
}
@@ -72,19 +64,12 @@ define(["dojo/_base/xhr",
updater.remove( this.authDatabaseUpdater );
};
- function AuthProviderUpdater(node, authProviderObj, controller, authenticationManagerUpdater)
+ DatabaseAuthManager.prototype.init = function(node, authProviderObj, controller)
{
this.controller = controller;
- this.query = "rest/authenticationprovider?id="+encodeURIComponent(authProviderObj.id);
- this.name = authProviderObj.name;
- this.authenticationManagerUpdater = authenticationManagerUpdater;
var that = this;
- xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
- .then(function(data) {
- that.authProviderData = data[0];
- that.name = data[0].name
- util.flattenStatistics( that.authProviderData );
+ that.authProviderData = authProviderObj;
var userDiv = query(".users")[0];
@@ -131,10 +116,9 @@ define(["dojo/_base/xhr",
event.stop(evt);
that.deleteUsers();
});
- });
}
- AuthProviderUpdater.prototype.deleteUsers = function()
+ DatabaseAuthManager.prototype.deleteUsers = function()
{
var grid = this.usersGrid.grid;
var data = grid.selection.getSelected();
@@ -168,24 +152,11 @@ define(["dojo/_base/xhr",
}
};
- AuthProviderUpdater.prototype.update = function()
+ DatabaseAuthManager.prototype.update = function(data)
{
-
- var that = this;
-
- xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
- .then(function(data) {
- that.authProviderData = data[0];
- that.name = data[0].name
- util.flattenStatistics( that.authProviderData );
-
- that.usersGrid.update(that.authProviderData.users);
-
- that.authenticationManagerUpdater.authProviderData = data[0];
- that.authenticationManagerUpdater.updateHeader();
- });
-
-
+ this.authProviderData = data;
+ this.name = data.name
+ this.usersGrid.update(this.authProviderData.users);
};
var addUser = {};
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js Fri Sep 20 18:59:30 2013
@@ -35,10 +35,12 @@ define(["dojo/dom",
"qpid/management/AccessControlProvider",
"qpid/management/Port",
"qpid/management/Plugin",
+ "qpid/management/logs/LogViewer",
+ "qpid/management/PreferencesProvider",
"dojo/ready",
"dojo/domReady!"],
function (dom, registry, ContentPane, entities, Broker, VirtualHost, Exchange, Queue, Connection, AuthProvider,
- GroupProvider, Group, KeyStore, TrustStore, AccessControlProvider, Port, Plugin, ready) {
+ GroupProvider, Group, KeyStore, TrustStore, AccessControlProvider, Port, Plugin, LogViewer, PreferencesProvider, ready) {
var controller = {};
var constructors = { broker: Broker, virtualhost: VirtualHost, exchange: Exchange,
@@ -46,7 +48,7 @@ define(["dojo/dom",
authenticationprovider: AuthProvider, groupprovider: GroupProvider,
group: Group, keystore: KeyStore, truststore: TrustStore,
accesscontrolprovider: AccessControlProvider, port: Port,
- plugin: Plugin};
+ plugin: Plugin, logViewer: LogViewer, preferencesprovider: PreferencesProvider};
var tabDiv = dom.byId("managedViews");
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/showMessage.js Fri Sep 20 18:59:30 2013
@@ -37,15 +37,10 @@ define(["dojo/_base/xhr",
return typeof val === 'string' ? entities.encode(val) : val;
}
+ var populatedFields = [];
var showMessage = {};
showMessage.hide = function () {
- if(this.populatedFields) {
- for(var i = 0 ; i < this.populatedFields.length; i++) {
- this.populatedFields[i].innerHTML = "";
- }
- this.populatedFields = [];
- }
registry.byId("showMessage").hide();
};
@@ -65,16 +60,22 @@ define(["dojo/_base/xhr",
showMessage.populateShowMessage = function(data) {
- this.populatedFields = [];
+ // clear fields set by previous invocation.
+ if(populatedFields) {
+ for(var i = 0 ; i < populatedFields.length; i++) {
+ populatedFields[i].innerHTML = "";
+ }
+ populatedFields = [];
+ }
for(var attrName in data) {
if(data.hasOwnProperty(attrName)) {
var fields = query(".message-"+attrName, this.dialogNode);
if(fields && fields.length != 0) {
var field = fields[0];
- this.populatedFields.push(field);
+ populatedFields.push(field);
var val = data[attrName];
- if(val) {
+ if(val != null) {
if(domClass.contains(field,"map")) {
var tableStr = "<table style='border: 1pt'><tr><th style='width: 6em; font-weight: bold'>Header</th><th style='font-weight: bold'>Value</th></tr>";
for(var name in val) {
@@ -112,7 +113,7 @@ define(["dojo/_base/xhr",
+ "/" + encodeURIComponent(showMessage.messageNumber)
+ "\" target=\"_blank\">Download</a>";
}
- this.populatedFields.push(contentField);
+ populatedFields.push(contentField);
registry.byId("showMessage").show();
};
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js Fri Sep 20 18:59:30 2013
@@ -284,6 +284,8 @@ define(["dojo/_base/xhr",
controller.show("accesscontrolprovider", details.accesscontrolprovider, {broker: {type:"broker", name:""}});
} else if (details.type == 'plugin') {
controller.show("plugin", details.plugin, {broker: {type:"broker", name:""}});
+ } else if (details.type == "preferencesprovider") {
+ controller.show("preferencesprovider", details.preferencesprovider, { type: "authenticationprovider", name: details.authenticationprovider, parent: {broker: {type:"broker", name:""}}});
}
};
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html Fri Sep 20 18:59:30 2013
@@ -27,4 +27,11 @@
<br/>
<button data-dojo-type="dijit.form.Button" class="editAuthenticationProviderButton">Edit</button>
<button data-dojo-type="dijit.form.Button" class="deleteAuthenticationProviderButton">Delete</button>
+ <br/>
+ <br/>
+ <div class="preferencesPanel" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Preferences Provider', open: true">
+ <div class="preferencesProviderDetails"></div>
+ <button data-dojo-type="dijit.form.Button" class="addPreferencesProviderButton">Add</button>
+ </div>
+ <br/>
</div>
\ No newline at end of file
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html Fri Sep 20 18:59:30 2013
@@ -190,9 +190,7 @@
<button data-dojo-type="dijit.form.Button" class="deleteAccessControlProvider">Delete Access Control Provider</button>
</div>
<br/>
- <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Log File', open: false">
- <div class="broker-logfile"></div>
- </div>
- <br/>
+ <button data-dojo-type="dijit.form.Button" class="logViewer" data-dojo-props="iconClass: 'logViewerIcon'">Log Viewer</button>
+ <br/><br/>
</div>
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showMessage.html
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showMessage.html?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showMessage.html (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/main/java/resources/showMessage.html Fri Sep 20 18:59:30 2013
@@ -45,7 +45,7 @@
</tr>
<tr style="margin-bottom: 4pt">
<td style="width: 10em; vertical-align: top"><span style="font-weight: bold;">Expiration:</span></td>
- <td><span class="message-expiration datetime"></span></td>
+ <td><span class="message-expirationTime datetime"></span></td>
</tr>
<tr style="margin-bottom: 4pt">
<td style="width: 10em; vertical-align: top"><span style="font-weight: bold;">MIME Type:</span></td>
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java Fri Sep 20 18:59:30 2013
@@ -29,6 +29,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
+import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.security.SubjectCreator;
import org.apache.qpid.test.utils.QpidTestCase;
@@ -88,13 +89,13 @@ public class HttpManagementTest extends
_management.isHttpBasicAuthenticationEnabled());
}
- public void testGetSubjectCreator()
+ public void testGetAuthenticationProvider()
{
SocketAddress localAddress = InetSocketAddress.createUnresolved("localhost", 8080);
- SubjectCreator subjectCreator = mock(SubjectCreator.class);
- when(_broker.getSubjectCreator(localAddress)).thenReturn(subjectCreator);
- SubjectCreator httpManagementSubjectCreator = _management.getSubjectCreator(localAddress);
- assertEquals("Unexpected subject creator", subjectCreator, httpManagementSubjectCreator);
+ AuthenticationProvider brokerAuthenticationProvider = mock(AuthenticationProvider.class);
+ when(_broker.getAuthenticationProvider(localAddress)).thenReturn(brokerAuthenticationProvider);
+ AuthenticationProvider authenticationProvider = _management.getAuthenticationProvider(localAddress);
+ assertEquals("Unexpected subject creator", brokerAuthenticationProvider, authenticationProvider);
}
}
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java Fri Sep 20 18:59:30 2013
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.server.jmx;
+import javax.net.ssl.KeyManager;
import org.apache.log4j.Logger;
import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -124,26 +125,19 @@ public class JMXManagedObjectRegistry im
{
KeyStore keyStore = _connectorPort.getKeyStore();
- String keyStorePath = (String) keyStore.getAttribute(KeyStore.PATH);
- String keyStorePassword = keyStore.getPassword();
- String keyStoreType = (String) keyStore.getAttribute(KeyStore.TYPE);
- String keyManagerFactoryAlgorithm = (String) keyStore.getAttribute(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM);
-
SSLContext sslContext;
try
{
- sslContext = SSLContextFactory.buildServerContext(keyStorePath, keyStorePassword, keyStoreType, keyManagerFactoryAlgorithm);
+
+ sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(keyStore.getKeyManagers(), null, null);
}
catch (GeneralSecurityException e)
{
throw new RuntimeException("Unable to create SSLContext for key store", e);
}
- catch (IOException e)
- {
- throw new RuntimeException("Unable to create SSLContext for key store", e);
- }
- CurrentActor.get().message(ManagementConsoleMessages.SSL_KEYSTORE(keyStorePath));
+ CurrentActor.get().message(ManagementConsoleMessages.SSL_KEYSTORE(keyStore.getName()));
//create the SSL RMI socket factories
csf = new SslRMIClientSocketFactory();
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBean.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBean.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBean.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBean.java Fri Sep 20 18:59:30 2013
@@ -48,6 +48,7 @@ import org.apache.qpid.server.model.Queu
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
@MBeanDescription("This MBean exposes the broker level management features")
public class VirtualHostManagerMBean extends AbstractStatisticsGatheringMBean<VirtualHost> implements ManagedBroker
@@ -180,7 +181,8 @@ public class VirtualHostManagerMBean ext
throws IOException, JMException
{
final Map<String, Object> createArgs = processNewQueueArguments(queueName, owner, originalArguments);
- getConfiguredObject().createQueue(queueName, State.ACTIVE, durable, false, LifetimePolicy.PERMANENT, 0l, createArgs);
+ getConfiguredObject().createQueue(queueName, State.ACTIVE, durable, false, LifetimePolicy.PERMANENT, 0l,
+ QueueArgumentsConverter.convertWireArgsToModel(createArgs));
}
@@ -196,11 +198,11 @@ public class VirtualHostManagerMBean ext
if (_moveNonExclusiveQueueOwnerToDescription && owner != null)
{
argumentsCopy = new HashMap<String, Object>(arguments == null ? new HashMap<String, Object>() : arguments);
- if (!argumentsCopy.containsKey(AMQQueueFactory.X_QPID_DESCRIPTION))
+ if (!argumentsCopy.containsKey(QueueArgumentsConverter.X_QPID_DESCRIPTION))
{
- LOGGER.warn("Non-exclusive owner " + owner + " for new queue " + queueName + " moved to " + AMQQueueFactory.X_QPID_DESCRIPTION);
+ LOGGER.warn("Non-exclusive owner " + owner + " for new queue " + queueName + " moved to " + QueueArgumentsConverter.X_QPID_DESCRIPTION);
- argumentsCopy.put(AMQQueueFactory.X_QPID_DESCRIPTION, owner);
+ argumentsCopy.put(QueueArgumentsConverter.X_QPID_DESCRIPTION, owner);
}
else
{
Modified: qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBeanTest.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBeanTest.java (original)
+++ qpid/branches/linearstore/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/mbeans/VirtualHostManagerMBeanTest.java Fri Sep 20 18:59:30 2013
@@ -38,6 +38,7 @@ import org.apache.qpid.server.model.Queu
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.queue.QueueArgumentsConverter;
public class VirtualHostManagerMBeanTest extends TestCase
{
@@ -79,16 +80,16 @@ public class VirtualHostManagerMBeanTest
{
_virtualHostManagerMBean.createNewQueue(TEST_QUEUE_NAME, TEST_OWNER, true);
- Map<String, Object> expectedArguments = Collections.singletonMap(AMQQueueFactory.X_QPID_DESCRIPTION, (Object)TEST_OWNER);
+ Map<String, Object> expectedArguments = Collections.singletonMap(Queue.DESCRIPTION, (Object)TEST_OWNER);
verify(_mockVirtualHost).createQueue(TEST_QUEUE_NAME, State.ACTIVE, true, false, LifetimePolicy.PERMANENT, 0, expectedArguments);
}
public void testCreateQueueWithOwnerAndDescriptionDiscardsOwner() throws Exception
{
- Map<String, Object> arguments = Collections.singletonMap(AMQQueueFactory.X_QPID_DESCRIPTION, (Object)TEST_DESCRIPTION);
+ Map<String, Object> arguments = Collections.singletonMap(QueueArgumentsConverter.X_QPID_DESCRIPTION, (Object)TEST_DESCRIPTION);
_virtualHostManagerMBean.createNewQueue(TEST_QUEUE_NAME, TEST_OWNER, true, arguments);
- Map<String, Object> expectedArguments = Collections.singletonMap(AMQQueueFactory.X_QPID_DESCRIPTION, (Object)TEST_DESCRIPTION);
+ Map<String, Object> expectedArguments = Collections.singletonMap(Queue.DESCRIPTION, (Object)TEST_DESCRIPTION);
verify(_mockVirtualHost).createQueue(TEST_QUEUE_NAME, State.ACTIVE, true, false, LifetimePolicy.PERMANENT, 0, expectedArguments);
}
Modified: qpid/branches/linearstore/qpid/java/broker/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker/build.xml?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker/build.xml (original)
+++ qpid/branches/linearstore/qpid/java/broker/build.xml Fri Sep 20 18:59:30 2013
@@ -19,15 +19,15 @@
-
-->
<project name="AMQ Broker" default="build">
- <property name="module.depends" value="management/common common amqp-1-0-common"/>
+ <property name="module.depends" value="management/common common"/>
<property name="module.test.depends" value="common/tests" />
<property name="module.main" value="org.apache.qpid.server.Main"/>
<property name="module.genpom" value="true"/>
<!-- Add dependencies to the broker pom for the broker-plugins and bdbstore modules -->
- <property name="module.maven.depends" value="broker-plugins/management-http broker-plugins/management-jmx broker-plugins/access-control broker-plugins/jdbc-provider-bone bdbstore bdbstore/jmx broker-plugins/jdbc-store broker-plugins/derby-store"/>
+ <property name="module.maven.depends" value="broker-plugins/access-control broker-plugins/amqp-0-8-protocol broker-plugins/amqp-0-10-protocol broker-plugins/amqp-1-0-protocol broker-plugins/amqp-msg-conv-0-8-to-0-10 broker-plugins/amqp-msg-conv-0-8-to-1-0 broker-plugins/amqp-msg-conv-0-10-to-1-0 broker-plugins/derby-store broker-plugins/jdbc-provider-bone broker-plugins/jdbc-store broker-plugins/management-http broker-plugins/management-jmx broker-plugins/memory-store bdbstore bdbstore/jmx"/>
<!-- Make them runtime dependencies, make bdbstore modules optional -->
- <property name="module.genpom.args" value="-Sqpid-broker-plugins-management-http=runtime -Sqpid-broker-plugins-management-jmx=runtime -Sqpid-broker-plugins-access-control=runtime -Sqpid-bdbstore=runtime -Oqpid-bdbstore -Sqpid-bdbstore-jmx=runtime -Oqpid-bdbstore-jmx -Sqpid-broker-plugins-jdbc-provider-bone=runtime -Oqpid-broker-plugins-jdbc-provider-bone -Sqpid-broker-plugins-jdbc-store=runtime -Sqpid-broker-plugins-derby-store=runtime"/>
+ <property name="module.genpom.args" value="-Sqpid-broker-plugins-access-control=runtime -Sqpid-broker-plugins-amqp-0-8-protocol=runtime -Sqpid-broker-plugins-amqp-0-10-protocol=runtime -Sqpid-broker-plugins-amqp-1-0-protocol=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-8-to-0-10=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-8-to-1-0=runtime -Sqpid-broker-plugins-amqp-msg-conv-0-10-to-1-0=runtime -Sqpid-broker-plugins-derby-store=runtime -Sqpid-broker-plugins-jdbc-provider-bone=runtime -Sqpid-broker-plugins-jdbc-store=runtime -Sqpid-broker-plugins-management-http=runtime -Sqpid-broker-plugins-management-jmx=runtime -Sbroker-plugins-memory-store=runtime -Sqpid-bdbstore=runtime -Sqpid-bdbstore-jmx=runtime -Oqpid-bdbstore -Oqpid-bdbstore-jmx"/>
<import file="../module.xml"/>
@@ -67,9 +67,6 @@
<target name="release-bin-other-bdbstore" depends="check-bdbstore-requested" if="bdbstore-requested"
description="copy bdbstore items into module release">
- <copy todir="${module.release}/lib/" failonerror="true">
- <fileset file="${build.lib}/${project.name}-bdbstore-${project.version}.jar"/>
- </copy>
<copy todir="${module.release}/bin" failonerror="true" flatten="true">
<fileset dir="${basedir}/../bdbstore/bin"/>
</copy>
Modified: qpid/branches/linearstore/qpid/java/broker/etc/broker_example.acl
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker/etc/broker_example.acl?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker/etc/broker_example.acl (original)
+++ qpid/branches/linearstore/qpid/java/broker/etc/broker_example.acl Fri Sep 20 18:59:30 2013
@@ -76,6 +76,9 @@ ACL ALLOW-LOG webadmins UPDATE METHOD
# authorise operations changing broker model
ACL ALLOW-LOG webadmins CONFIGURE BROKER
+# authorise operations to view and download broker logs
+ACL ALLOW webadmins ACCESS_LOGS BROKER
+
# at the moment only the following UPDATE METHOD rules are supported by web management console
#ACL ALLOW-LOG webadmins UPDATE METHOD component="VirtualHost.Queue" name="moveMessages"
#ACL ALLOW-LOG webadmins UPDATE METHOD component="VirtualHost.Queue" name="copyMessages"
Modified: qpid/branches/linearstore/qpid/java/broker/src/main/java/broker.bnd
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker/src/main/java/broker.bnd?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker/src/main/java/broker.bnd (original)
+++ qpid/branches/linearstore/qpid/java/broker/src/main/java/broker.bnd Fri Sep 20 18:59:30 2013
@@ -17,7 +17,7 @@
# under the License.
#
-ver: 0.23.0
+ver: 0.25.0
Bundle-SymbolicName: qpid-broker
Bundle-Version: ${ver}
Modified: qpid/branches/linearstore/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java (original)
+++ qpid/branches/linearstore/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java Fri Sep 20 18:59:30 2013
@@ -67,17 +67,11 @@ public class Broker
}
finally
{
- try
- {
- if (_applicationRegistry != null)
- {
- _applicationRegistry.close();
- }
- }
- finally
+ if (_applicationRegistry != null)
{
- clearAMQShortStringCache();
+ _applicationRegistry.close();
}
+
}
}
@@ -96,14 +90,8 @@ public class Broker
}
finally
{
- try
- {
- CurrentActor.remove();
- }
- finally
- {
- clearAMQShortStringCache();
- }
+ CurrentActor.remove();
+
}
}
@@ -269,15 +257,6 @@ public class Broker
LOGGER.debug("Skipping shutdown hook removal as there either isnt one, or we are it.");
}
}
- /**
- * Workaround that prevents AMQShortStrings cache from being left in the thread local. This is important
- * when embedding the Broker in containers where the starting thread may not belong to Qpid.
- * The long term solution here is to stop our use of AMQShortString outside the AMQP transport layer.
- */
- private void clearAMQShortStringCache()
- {
- AMQShortString.clearLocalCache();
- }
public org.apache.qpid.server.model.Broker getBroker()
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org