[jboss-cvs] JBoss Messaging SVN: r4508 - in trunk: src/config and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 17 16:49:51 EDT 2008
Author: timfox
Date: 2008-06-17 16:49:51 -0400 (Tue, 17 Jun 2008)
New Revision: 4508
Added:
trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java
Removed:
trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityManagerDeployer.java
Modified:
trunk/docs/userguide/en/modules/configuration.xml
trunk/src/config/jbm-beans.xml
trunk/src/config/jbm-standalone-beans.xml
trunk/src/main/org/jboss/messaging/core/security/impl/JBMSecurityManagerImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/SecurityManagerDeployerTest.java
Log:
Renamed SecurityManagerDeployer
Modified: trunk/docs/userguide/en/modules/configuration.xml
===================================================================
--- trunk/docs/userguide/en/modules/configuration.xml 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/docs/userguide/en/modules/configuration.xml 2008-06-17 20:49:51 UTC (rev 4508)
@@ -779,7 +779,7 @@
<programlisting>
<![CDATA[
<bean name="SecurityManagerDeployer"
- class="org.jboss.messaging.core.deployers.impl.SecurityManagerDeployer">
+ class="org.jboss.messaging.core.deployers.impl.BasicSecurityDeployer">
<property name="jbmSecurityManager">
<inject bean="JBMSecurityManager"/>
</property>
Modified: trunk/src/config/jbm-beans.xml
===================================================================
--- trunk/src/config/jbm-beans.xml 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/src/config/jbm-beans.xml 2008-06-17 20:49:51 UTC (rev 4508)
@@ -14,7 +14,7 @@
</constructor>
</bean>
- <bean name="SecurityManagerDeployer" class="org.jboss.messaging.core.deployers.impl.SecurityManagerDeployer">
+ <bean name="BasicSecurityDeployer" class="org.jboss.messaging.core.deployers.impl.BasicSecurityDeployer">
<property name="jbmSecurityManager">
<inject bean="JBMSecurityManager"/>
</property>
Modified: trunk/src/config/jbm-standalone-beans.xml
===================================================================
--- trunk/src/config/jbm-standalone-beans.xml 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/src/config/jbm-standalone-beans.xml 2008-06-17 20:49:51 UTC (rev 4508)
@@ -30,7 +30,7 @@
</constructor>
</bean>
- <bean name="SecurityManagerDeployer" class="org.jboss.messaging.core.deployers.impl.SecurityManagerDeployer">
+ <bean name="BasicSecurityDeployer" class="org.jboss.messaging.core.deployers.impl.BasicSecurityDeployer">
<constructor>
<parameter>
<inject bean="DeploymentManager"/>
Copied: trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java (from rev 4507, trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityManagerDeployer.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/BasicSecurityDeployer.java 2008-06-17 20:49:51 UTC (rev 4508)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.core.deployers.impl;
+
+import org.jboss.messaging.core.deployers.DeploymentManager;
+import org.jboss.messaging.core.security.JBMUpdateableSecurityManager;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * deployer for adding security loaded from the file "jbm-security.xml"
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class BasicSecurityDeployer extends XmlDeployer
+{
+ private JBMUpdateableSecurityManager jbmSecurityManager;
+ private static final String PASSWORD_ATTRIBUTE = "password";
+ private static final String ROLES_NODE = "role";
+ private static final String ROLE_ATTR_NAME = "name";
+
+ public BasicSecurityDeployer(final DeploymentManager deploymentManager)
+ {
+ super(deploymentManager);
+ }
+
+ public String[] getElementTagName()
+ {
+ return new String[]{"user"};
+ }
+
+ public void deploy(final Node node) throws Exception
+ {
+ String username = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();
+ String password = node.getAttributes().getNamedItem(PASSWORD_ATTRIBUTE).getNodeValue();
+ //add the user
+ jbmSecurityManager.addUser(username, password);
+ NodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++)
+ {
+ Node child = children.item(i);
+ //and add any roles
+ if (ROLES_NODE.equalsIgnoreCase(child.getNodeName()))
+ {
+ String role = child.getAttributes().getNamedItem(ROLE_ATTR_NAME).getNodeValue();
+ jbmSecurityManager.addRole(username, role);
+ }
+ }
+ }
+
+ public void undeploy(final Node node) throws Exception
+ {
+ String username = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();
+ jbmSecurityManager.removeUser(username);
+ }
+
+ public String getConfigFileName()
+ {
+ return "jbm-security.xml";
+ }
+
+ public void setJbmSecurityManager(final JBMUpdateableSecurityManager jbmSecurityManager)
+ {
+ this.jbmSecurityManager = jbmSecurityManager;
+ }
+}
Deleted: trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityManagerDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityManagerDeployer.java 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/SecurityManagerDeployer.java 2008-06-17 20:49:51 UTC (rev 4508)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.messaging.core.deployers.impl;
-
-import org.jboss.messaging.core.deployers.DeploymentManager;
-import org.jboss.messaging.core.security.JBMUpdateableSecurityManager;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- * TODO should rename this to security deployer rather than security manager deployer since doesn't deploy
- * security managers
- *
- * deployer for adding security loaded from the file "jbm-security.xml"
- * @author <a href="ataylor at redhat.com">Andy Taylor</a>
- */
-public class SecurityManagerDeployer extends XmlDeployer
-{
- private JBMUpdateableSecurityManager jbmSecurityManager;
- private static final String PASSWORD_ATTRIBUTE = "password";
- private static final String ROLES_NODE = "role";
- private static final String ROLE_ATTR_NAME = "name";
-
- public SecurityManagerDeployer(final DeploymentManager deploymentManager)
- {
- super(deploymentManager);
- }
-
- public String[] getElementTagName()
- {
- return new String[]{"user"};
- }
-
- public void deploy(Node node) throws Exception
- {
- String username = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();
- String password = node.getAttributes().getNamedItem(PASSWORD_ATTRIBUTE).getNodeValue();
- //add the user
- jbmSecurityManager.addUser(username, password);
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++)
- {
- Node child = children.item(i);
- //and add any roles
- if (ROLES_NODE.equalsIgnoreCase(child.getNodeName()))
- {
- String role = child.getAttributes().getNamedItem(ROLE_ATTR_NAME).getNodeValue();
- jbmSecurityManager.addRole(username, role);
- }
- }
- }
-
- public void undeploy(Node node) throws Exception
- {
- String username = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue();
- jbmSecurityManager.removeUser(username);
- }
-
- public String getConfigFileName()
- {
- return "jbm-security.xml";
- }
-
- public void setJbmSecurityManager(JBMUpdateableSecurityManager jbmSecurityManager)
- {
- this.jbmSecurityManager = jbmSecurityManager;
- }
-}
Modified: trunk/src/main/org/jboss/messaging/core/security/impl/JBMSecurityManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/security/impl/JBMSecurityManagerImpl.java 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/src/main/org/jboss/messaging/core/security/impl/JBMSecurityManagerImpl.java 2008-06-17 20:49:51 UTC (rev 4508)
@@ -34,7 +34,7 @@
/**
* A basic implementation of the JBMUpdateableSecurityManager. This can be used within an appserver and be deployed by
- * SecurityManagerDeployer or used standalone or embedded.
+ * BasicSecurityDeployer or used standalone or embedded.
*
* @author <a href="ataylor at redhat.com">Andy Taylor</a>
*/
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2008-06-17 20:49:51 UTC (rev 4508)
@@ -127,7 +127,7 @@
The following components are pluggable on the messaging server:
Configuration, StorageManager, RemotingService and SecurityManager
They must already be injected by the time the messaging server starts
- It's up to the user to make sure the pluggable components are started - there
+ It's up to the user to make sure the pluggable components are started - their
lifecycle will not be controlled here
*/
@@ -234,26 +234,19 @@
// MessagingServer implementation -----------------------------------------------------------
- public Version getVersion()
+
+ // The plugabble components
+
+ public void setConfiguration(Configuration configuration)
{
- return version;
+ this.configuration = configuration;
}
-
+
public Configuration getConfiguration()
{
return configuration;
}
-
- public boolean isStarted()
- {
- return started;
- }
-
- public void setConfiguration(Configuration configuration)
- {
- this.configuration = configuration;
- }
-
+
public void setRemotingService(RemotingService remotingService)
{
this.remotingService = remotingService;
@@ -264,55 +257,74 @@
return remotingService;
}
- public ConnectionManager getConnectionManager()
+ public void setStorageManager(StorageManager storageManager)
{
- return connectionManager;
+ this.storageManager = storageManager;
}
-
+
public StorageManager getStorageManager()
{
return storageManager;
}
-
- public void setStorageManager(StorageManager storageManager)
+
+ public void setSecurityManager(JBMSecurityManager securityManager)
{
- this.storageManager = storageManager;
+ this.securityManager = securityManager;
}
+
+ public JBMSecurityManager getSecurityManager()
+ {
+ return securityManager;
+ }
+ //The hardwired components
+
public PostOffice getPostOffice()
{
return postOffice;
}
-
- public void setPostOffice(PostOffice postOffice)
+
+ public ConnectionManager getConnectionManager()
{
- this.postOffice = postOffice;
+ return connectionManager;
}
-
+
public HierarchicalRepository<Set<Role>> getSecurityRepository()
{
return securityRepository;
}
-
+
+ public SecurityStore getSecurityStore()
+ {
+ return securityStore;
+ }
+
public HierarchicalRepository<QueueSettings> getQueueSettingsRepository()
{
return queueSettingsRepository;
}
-
- public SecurityStore getSecurityStore()
+
+ public ExecutorFactory getExecutorFactory()
{
- return securityStore;
+ return executorFactory;
}
- public JBMSecurityManager getSecurityManager()
+ public ResourceManager getResourceManager()
{
- return securityManager;
+ return resourceManager;
}
-
- public void setSecurityManager(JBMSecurityManager securityManager)
+
+ public Version getVersion()
{
- this.securityManager = securityManager;
+ return version;
}
+
+ //Operations
+
+ public boolean isStarted()
+ {
+ return started;
+ }
public CreateConnectionResponse createConnection(final String username, final String password,
final long remotingClientSessionID,
@@ -343,16 +355,6 @@
return new CreateConnectionResponse(connection.getID(), version);
}
- public ExecutorFactory getExecutorFactory()
- {
- return executorFactory;
- }
-
- public ResourceManager getResourceManager()
- {
- return resourceManager;
- }
-
// Public ---------------------------------------------------------------------------------------
// Package protected ----------------------------------------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/SecurityManagerDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/SecurityManagerDeployerTest.java 2008-06-17 20:01:27 UTC (rev 4507)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/SecurityManagerDeployerTest.java 2008-06-17 20:49:51 UTC (rev 4508)
@@ -24,19 +24,19 @@
import junit.framework.TestCase;
import org.easymock.EasyMock;
import org.jboss.messaging.core.deployers.DeploymentManager;
-import org.jboss.messaging.core.deployers.impl.SecurityManagerDeployer;
+import org.jboss.messaging.core.deployers.impl.BasicSecurityDeployer;
import org.jboss.messaging.core.security.JBMUpdateableSecurityManager;
import org.jboss.messaging.util.XMLUtil;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
- * tests SecurityManagerDeployer
+ * tests BasicSecurityDeployer
* @author <a href="ataylor at redhat.com">Andy Taylor</a>
*/
public class SecurityManagerDeployerTest extends TestCase
{
- SecurityManagerDeployer deployer;
+ BasicSecurityDeployer deployer;
String simpleSecurityXml = "<deployment>\n" +
"</deployment>";
@@ -61,7 +61,7 @@
protected void setUp() throws Exception
{
DeploymentManager deploymentManager = EasyMock.createNiceMock(DeploymentManager.class);
- deployer = new SecurityManagerDeployer(deploymentManager);
+ deployer = new BasicSecurityDeployer(deploymentManager);
}
protected void tearDown() throws Exception
More information about the jboss-cvs-commits
mailing list