Author: jmesnil
Date: 2010-02-16 09:47:14 -0500 (Tue, 16 Feb 2010)
New Revision: 8881
Modified:
trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-300: SecuritySettings should be manageable via
the management API
* reorder addSecuritySettings arguments to have send & consume roles first
Modified: trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-02-16
14:12:26 UTC (rev 8880)
+++ trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-02-16
14:47:14 UTC (rev 8881)
@@ -480,12 +480,12 @@
@Operation(desc= "Add security settings for addresses matching the
addressMatch", impact = MBeanOperationInfo.ACTION)
void addSecuritySettings(
@Parameter(desc="an address match",
name="addressMatch") String addressMatch,
+ @Parameter(desc="a comma-separated list of roles allowed
to send messages", name="send") String sendRoles,
+ @Parameter(desc="a comma-separated list of roles allowed
to consume messages", name="consume") String consumeRoles,
@Parameter(desc="a comma-separated list of roles allowed
to create durable queues", name="createDurableQueueRoles") String
createDurableQueueRoles,
@Parameter(desc="a comma-separated list of roles allowed
to delete durable queues", name="deleteDurableQueueRoles") String
deleteDurableQueueRoles,
@Parameter(desc="a comma-separated list of roles allowed
to create temporary queues", name="createTempQueueRoles") String
createTempQueueRoles,
@Parameter(desc="a comma-separated list of roles allowed
to delete temporary queues", name="deleteTempQueueRoles") String
deleteTempQueueRoles,
- @Parameter(desc="a comma-separated list of roles allowed
to send messages", name="send") String sendRoles,
- @Parameter(desc="a comma-separated list of roles allowed
to consume messages", name="consume") String consumeRoles,
@Parameter(desc="a comma-separated list of roles allowed
to send management messages messages", name="manage") String manageRoles)
throws Exception;
void removeSecuritySettings(String addressMatch) throws Exception;
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
---
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-02-16
14:12:26 UTC (rev 8880)
+++
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-02-16
14:47:14 UTC (rev 8881)
@@ -1073,12 +1073,12 @@
}
public void addSecuritySettings(String addressMatch,
+ String sendRoles,
+ String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createTempQueueRoles,
String deleteTempQueueRoles,
- String sendRoles,
- String consumeRoles,
String manageRoles)
{
clearIO();
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-02-16
14:12:26 UTC (rev 8880)
+++
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-02-16
14:47:14 UTC (rev 8881)
@@ -399,7 +399,7 @@
String exactAddress = "test.whatever";
assertEquals(0, serverControl.getRoles(addressMatch).length);
- serverControl.addSecuritySettings(addressMatch, "foo", "bar",
"foo, bar", "", "foo", "foo, bar", "");
+ serverControl.addSecuritySettings(addressMatch, "foo", "foo,
bar", "foo", "bar", "foo, bar", "",
"");
String rolesAsJSON = serverControl.getRolesAsJSON(exactAddress);
RoleInfo[] roleInfos = RoleInfo.from(rolesAsJSON);
@@ -416,20 +416,20 @@
fooRole = roleInfos[1];
barRole = roleInfos[0];
}
+ assertTrue(fooRole.isSend());
+ assertTrue(fooRole.isConsume());
assertTrue(fooRole.isCreateDurableQueue());
assertFalse(fooRole.isDeleteDurableQueue());
assertTrue(fooRole.isCreateNonDurableQueue());
assertFalse(fooRole.isDeleteNonDurableQueue());
- assertTrue(fooRole.isSend());
- assertTrue(fooRole.isConsume());
assertFalse(fooRole.isManage());
+ assertFalse(barRole.isSend());
+ assertTrue(barRole.isConsume());
assertFalse(barRole.isCreateDurableQueue());
assertTrue(barRole.isDeleteDurableQueue());
assertTrue(barRole.isCreateNonDurableQueue());
assertFalse(barRole.isDeleteNonDurableQueue());
- assertFalse(barRole.isSend());
- assertTrue(barRole.isConsume());
assertFalse(barRole.isManage());
serverControl.removeSecuritySettings(addressMatch);
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-02-16
14:12:26 UTC (rev 8880)
+++
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-02-16
14:47:14 UTC (rev 8881)
@@ -448,18 +448,18 @@
}
public void addSecuritySettings(String addressMatch,
+ String sendRoles,
+ String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createTempQueueRoles,
String deleteTempQueueRoles,
- String sendRoles,
- String consumeRoles,
String manageRoles) throws Exception
{
proxy.invokeOperation("addSecuritySettings", addressMatch,
+ sendRoles, consumeRoles,
createDurableQueueRoles, deleteDurableQueueRoles,
createTempQueueRoles, deleteTempQueueRoles,
- sendRoles, consumeRoles,
manageRoles);
}
Modified:
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java 2010-02-16
14:12:26 UTC (rev 8880)
+++
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java 2010-02-16
14:47:14 UTC (rev 8881)
@@ -562,12 +562,12 @@
}
public void addSecuritySettings(String addressMatch,
+ String sendRoles,
+ String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createTempQueueRoles,
String deleteTempQueueRoles,
- String sendRoles,
- String consumeRoles,
String manageRoles) throws Exception
{
}