[jboss-cvs] JBoss Messaging SVN: r4835 - in trunk: src/main/org/jboss/messaging/jms/server/management/impl and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Aug 19 05:52:15 EDT 2008
Author: jmesnil
Date: 2008-08-19 05:52:15 -0400 (Tue, 19 Aug 2008)
New Revision: 4835
Added:
trunk/src/main/org/jboss/messaging/jms/server/management/SubscriptionInfo.java
trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriptionInfoTest.java
Removed:
trunk/src/main/org/jboss/messaging/jms/server/management/SubscriberInfo.java
trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriberInfoTest.java
Modified:
trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/DurableSubscriptionTest.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java
trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/impl/TopicControlTest.java
Log:
renamed SubscriberInfo to SubscriptionInfo + related refactorings
- renamed SubscriptionInfo 'id' field to 'queueName' to make it less ambiguous
- renamed all TopicControlMBean methods to deal with subscriptions instead of subscribers
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/SubscriberInfo.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/SubscriberInfo.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/SubscriberInfo.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -1,182 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * 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.jms.server.management;
-
-import static javax.management.openmbean.SimpleType.BOOLEAN;
-import static javax.management.openmbean.SimpleType.INTEGER;
-import static javax.management.openmbean.SimpleType.STRING;
-
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class SubscriberInfo
-{
- // Constants -----------------------------------------------------
-
- public static final CompositeType TYPE;
- private static final TabularType TABULAR_TYPE;
- private static final String SUBSCRIBER_TYPE_NAME = "SubscriberInfo";
- private static final String SUBSCRIBER_TABULAR_TYPE_NAME = "SubscriberTabularInfo";
- private static final String[] ITEM_NAMES = new String[] { "id", "clientID",
- "name", "durable", "selector", "messageCount", "maxSizeBytes" };
- private static final String[] ITEM_DESCRIPTIONS = new String[] {
- "ID of the subscriber", "ClientID of the subscription",
- "name of the subscription", "Is the subscriber durable?", "Selector",
- "Number of messages", "Maximum size in bytes" };
- private static final OpenType[] ITEM_TYPES = new OpenType[] { STRING,
- STRING, STRING, BOOLEAN, STRING, INTEGER, INTEGER };
-
- static
- {
- try
- {
- TYPE = createSubscriberInfoType();
- TABULAR_TYPE = createSubscriberInfoTabularType();
- } catch (OpenDataException e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- // Attributes ----------------------------------------------------
-
- private final String id;
- private final String clientID;
- private final String name;
- private final boolean durable;
- private final String selector;
- private final int messageCount;
- private final int maxSizeBytes;
-
- // Static --------------------------------------------------------
-
- public static TabularData toTabularData(final SubscriberInfo[] infos)
- {
- TabularData data = new TabularDataSupport(TABULAR_TYPE);
- for (SubscriberInfo subscriberInfo : infos)
- {
- data.put(subscriberInfo.toCompositeData());
- }
- return data;
- }
-
- private static CompositeType createSubscriberInfoType()
- throws OpenDataException
- {
- return new CompositeType(SUBSCRIBER_TYPE_NAME,
- "Information for a Topic Subscriber", ITEM_NAMES,
- ITEM_DESCRIPTIONS, ITEM_TYPES);
- }
-
- private static TabularType createSubscriberInfoTabularType()
- throws OpenDataException
- {
- return new TabularType(SUBSCRIBER_TABULAR_TYPE_NAME,
- "Table of SubscriberInfo", TYPE, new String[] { "id" });
- }
-
- // Constructors --------------------------------------------------
-
- public SubscriberInfo(final String id, final String clientID,
- final String name, final boolean durable, final String selector,
- final int messageCount, final int maxSizeBytes)
- {
- this.id = id;
- this.clientID = clientID;
- this.name = name;
- this.durable = durable;
- this.selector = selector;
- this.messageCount = messageCount;
- this.maxSizeBytes = maxSizeBytes;
- }
-
- // Public --------------------------------------------------------
-
- public String getID()
- {
- return id;
- }
-
- public String getClientID()
- {
- return clientID;
- }
-
- public String getName()
- {
- return name;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public String getSelector()
- {
- return selector;
- }
-
- public int getMessageCount()
- {
- return messageCount;
- }
-
- public int getMaxSizeBytes()
- {
- return maxSizeBytes;
- }
-
- public CompositeData toCompositeData()
- {
- try
- {
- return new CompositeDataSupport(TYPE, ITEM_NAMES, new Object[] { id,
- clientID, name, durable, selector, messageCount, maxSizeBytes });
- } catch (OpenDataException e)
- {
- e.printStackTrace();
- return null;
- }
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/SubscriptionInfo.java (from rev 4818, trunk/src/main/org/jboss/messaging/jms/server/management/SubscriberInfo.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/SubscriptionInfo.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/SubscriptionInfo.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.jms.server.management;
+
+import static javax.management.openmbean.SimpleType.BOOLEAN;
+import static javax.management.openmbean.SimpleType.INTEGER;
+import static javax.management.openmbean.SimpleType.STRING;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularDataSupport;
+import javax.management.openmbean.TabularType;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class SubscriptionInfo
+{
+ // Constants -----------------------------------------------------
+
+ public static final CompositeType TYPE;
+ private static final TabularType TABULAR_TYPE;
+ private static final String SUBSCRIPTION_TYPE_NAME = "SubscriptionInfo";
+ private static final String SUBSCRIPTION_TABULAR_TYPE_NAME = "SubscriptionTabularInfo";
+ private static final String[] ITEM_NAMES = new String[] { "queueName", "clientID",
+ "name", "durable", "selector", "messageCount", "maxSizeBytes" };
+ private static final String[] ITEM_DESCRIPTIONS = new String[] {
+ "ID of the subscription", "ClientID of the subscription",
+ "name of the subscription", "Is the subscriber durable?", "Selector",
+ "Number of messages", "Maximum size in bytes" };
+ private static final OpenType[] ITEM_TYPES = new OpenType[] { STRING,
+ STRING, STRING, BOOLEAN, STRING, INTEGER, INTEGER };
+
+ static
+ {
+ try
+ {
+ TYPE = createSubscriptionInfoType();
+ TABULAR_TYPE = createSubscriptionInfoTabularType();
+ } catch (OpenDataException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ // Attributes ----------------------------------------------------
+
+ private final String queueName;
+ private final String clientID;
+ private final String name;
+ private final boolean durable;
+ private final String selector;
+ private final int messageCount;
+ private final int maxSizeBytes;
+
+ // Static --------------------------------------------------------
+
+ public static TabularData toTabularData(final SubscriptionInfo[] infos)
+ {
+ TabularData data = new TabularDataSupport(TABULAR_TYPE);
+ for (SubscriptionInfo subscriberInfo : infos)
+ {
+ data.put(subscriberInfo.toCompositeData());
+ }
+ return data;
+ }
+
+ private static CompositeType createSubscriptionInfoType()
+ throws OpenDataException
+ {
+ return new CompositeType(SUBSCRIPTION_TYPE_NAME,
+ "Information for a Topic Subscription", ITEM_NAMES,
+ ITEM_DESCRIPTIONS, ITEM_TYPES);
+ }
+
+ private static TabularType createSubscriptionInfoTabularType()
+ throws OpenDataException
+ {
+ return new TabularType(SUBSCRIPTION_TABULAR_TYPE_NAME,
+ "Table of SubscriptionInfo", TYPE, new String[] { "queueName" });
+ }
+
+ // Constructors --------------------------------------------------
+
+ public SubscriptionInfo(final String queueName, final String clientID,
+ final String name, final boolean durable, final String selector,
+ final int messageCount, final int maxSizeBytes)
+ {
+ this.queueName = queueName;
+ this.clientID = clientID;
+ this.name = name;
+ this.durable = durable;
+ this.selector = selector;
+ this.messageCount = messageCount;
+ this.maxSizeBytes = maxSizeBytes;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getQueueName()
+ {
+ return queueName;
+ }
+
+ public String getClientID()
+ {
+ return clientID;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean isDurable()
+ {
+ return durable;
+ }
+
+ public String getSelector()
+ {
+ return selector;
+ }
+
+ public int getMessageCount()
+ {
+ return messageCount;
+ }
+
+ public int getMaxSizeBytes()
+ {
+ return maxSizeBytes;
+ }
+
+ public CompositeData toCompositeData()
+ {
+ try
+ {
+ return new CompositeDataSupport(TYPE, ITEM_NAMES, new Object[] { queueName,
+ clientID, name, durable, selector, messageCount, maxSizeBytes });
+ } catch (OpenDataException e)
+ {
+ return null;
+ }
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Property changes on: trunk/src/main/org/jboss/messaging/jms/server/management/SubscriptionInfo.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -37,43 +37,43 @@
{
// Attributes ----------------------------------------------------
- int getSubcribersCount();
+ int getSubcriptionsCount();
- int getDurableSubcribersCount();
+ int getDurableSubcriptionsCount();
- int getNonDurableSubcribersCount();
+ int getNonDurableSubcriptionsCount();
- int getDurableMessageCount();
+ int getDurableMessagesCount();
- int getNonDurableMessageCount();
+ int getNonDurableMessagesCount();
// Operations ----------------------------------------------------
// Open Type API
- @Operation(desc = "List all subscribers")
- TabularData listAllSubscribers();
+ @Operation(desc = "List all subscriptions")
+ TabularData listAllSubscriptions();
- @Operation(desc = "List only the durable subscribers")
- TabularData listDurableSubscribers();
+ @Operation(desc = "List only the durable subscriptions")
+ TabularData listDurableSubscriptions();
- @Operation(desc = "List only the non durable subscribers")
- TabularData listNonDurableSubscribers();
+ @Operation(desc = "List only the non durable subscriptions")
+ TabularData listNonDurableSubscriptions();
- @Operation(desc = "List all the message for the given subscriber")
- public TabularData listMessagesForSubscriber(
- @Parameter(name = "subscriberID", desc = "Subscriber's ID") String subscriberID)
+ @Operation(desc = "List all the message for the given subscription")
+ public TabularData listMessagesForSubscription(
+ @Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName)
throws Exception;
// Specific API
- @Operation(desc = "List all subscribers")
- SubscriberInfo[] listAllSubscriberInfos();
+ @Operation(desc = "List all subscriptions")
+ SubscriptionInfo[] listAllSubscriptionInfos();
- @Operation(desc = "List only the durable subscribers")
- SubscriberInfo[] listDurableSubscriberInfos();
+ @Operation(desc = "List only the durable subscriptions")
+ SubscriptionInfo[] listDurableSubscriptionInfos();
- @Operation(desc = "List only the non durable subscribers")
- SubscriberInfo[] listNonDurableSubscriberInfos();
+ @Operation(desc = "List only the non durable subscriptions")
+ SubscriptionInfo[] listNonDurableSubscriptionInfos();
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -42,7 +42,7 @@
import org.jboss.messaging.core.server.ServerMessage;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.server.management.JMSMessageInfo;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.messaging.jms.server.management.TopicControlMBean;
import org.jboss.messaging.util.Pair;
import org.jboss.messaging.util.SimpleString;
@@ -126,65 +126,65 @@
return getMessageCount(DurabilityType.ALL);
}
- public int getDurableMessageCount()
+ public int getDurableMessagesCount()
{
return getMessageCount(DurabilityType.DURABLE);
}
- public int getNonDurableMessageCount()
+ public int getNonDurableMessagesCount()
{
return getMessageCount(DurabilityType.NON_DURABLE);
}
- public int getSubcribersCount()
+ public int getSubcriptionsCount()
{
return getQueues(DurabilityType.ALL).size();
}
- public int getDurableSubcribersCount()
+ public int getDurableSubcriptionsCount()
{
return getQueues(DurabilityType.DURABLE).size();
}
- public int getNonDurableSubcribersCount()
+ public int getNonDurableSubcriptionsCount()
{
return getQueues(DurabilityType.NON_DURABLE).size();
}
- public TabularData listAllSubscribers()
+ public TabularData listAllSubscriptions()
{
- return SubscriberInfo.toTabularData(listAllSubscriberInfos());
+ return SubscriptionInfo.toTabularData(listAllSubscriptionInfos());
}
- public TabularData listDurableSubscribers()
+ public TabularData listDurableSubscriptions()
{
- return SubscriberInfo.toTabularData(listDurableSubscriberInfos());
+ return SubscriptionInfo.toTabularData(listDurableSubscriptionInfos());
}
- public TabularData listNonDurableSubscribers()
+ public TabularData listNonDurableSubscriptions()
{
- return SubscriberInfo.toTabularData(listNonDurableSubscriberInfos());
+ return SubscriptionInfo.toTabularData(listNonDurableSubscriptionInfos());
}
- public SubscriberInfo[] listAllSubscriberInfos()
+ public SubscriptionInfo[] listAllSubscriptionInfos()
{
return listSubscribersInfos(DurabilityType.ALL);
}
- public SubscriberInfo[] listDurableSubscriberInfos()
+ public SubscriptionInfo[] listDurableSubscriptionInfos()
{
return listSubscribersInfos(DurabilityType.DURABLE);
}
- public SubscriberInfo[] listNonDurableSubscriberInfos()
+ public SubscriptionInfo[] listNonDurableSubscriptionInfos()
{
return listSubscribersInfos(DurabilityType.NON_DURABLE);
}
- public TabularData listMessagesForSubscriber(final String subscriberID)
+ public TabularData listMessagesForSubscription(final String queueName)
throws Exception
{
- SimpleString sAddress = new SimpleString(subscriberID);
+ SimpleString sAddress = new SimpleString(queueName);
Binding binding = postOffice.getBinding(sAddress);
if (binding == null)
{
@@ -222,10 +222,10 @@
// Private -------------------------------------------------------
- private SubscriberInfo[] listSubscribersInfos(final DurabilityType durability)
+ private SubscriptionInfo[] listSubscribersInfos(final DurabilityType durability)
{
List<Queue> queues = getQueues(durability);
- List<SubscriberInfo> subInfos = new ArrayList<SubscriberInfo>(queues
+ List<SubscriptionInfo> subInfos = new ArrayList<SubscriptionInfo>(queues
.size());
for (Queue queue : queues)
{
@@ -243,12 +243,12 @@
String filter = queue.getFilter() != null ? queue.getFilter()
.getFilterString().toString() : null;
- SubscriberInfo info = new SubscriberInfo(queue.getName().toString(),
+ SubscriptionInfo info = new SubscriptionInfo(queue.getName().toString(),
clientID, subName, queue.isDurable(), filter, queue
.getMessageCount(), queue.getMaxSizeBytes());
subInfos.add(info);
}
- return (SubscriberInfo[]) subInfos.toArray(new SubscriberInfo[subInfos
+ return (SubscriptionInfo[]) subInfos.toArray(new SubscriptionInfo[subInfos
.size()]);
}
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/JBMServerTestCase.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -43,7 +43,7 @@
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.test.messaging.tools.ServerManagement;
import org.jboss.test.messaging.tools.container.DatabaseClearer;
import org.jboss.test.messaging.tools.container.Server;
@@ -798,7 +798,7 @@
servers.get(server).undeployConnectionFactory(objectName);
}
- protected List<SubscriberInfo> listAllSubscribersForTopic(String s) throws Exception
+ protected List<SubscriptionInfo> listAllSubscribersForTopic(String s) throws Exception
{
return servers.get(0).listAllSubscribersForTopic(s);
}
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/DurableSubscriptionTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/DurableSubscriptionTest.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/DurableSubscriptionTest.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -36,7 +36,7 @@
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
/**
@@ -81,13 +81,13 @@
s.createDurableSubscriber(topic1, "monicabelucci");
- List<SubscriberInfo> subs = listAllSubscribersForTopic("Topic1");
+ List<SubscriptionInfo> subs = listAllSubscribersForTopic("Topic1");
assertNotNull(subs);
assertEquals(1, subs.size());
- SubscriberInfo info = subs.get(0);
+ SubscriptionInfo info = subs.get(0);
assertEquals("monicabelucci", info.getName());
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -50,7 +50,7 @@
import org.jboss.messaging.jms.JBossDestination;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.messaging.jms.server.management.TopicControlMBean;
import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
import org.jboss.messaging.microcontainer.JBMBootstrapServer;
@@ -654,12 +654,12 @@
}
}
- public List<SubscriberInfo> listAllSubscribersForTopic(String s) throws Exception
+ public List<SubscriptionInfo> listAllSubscribersForTopic(String s) throws Exception
{
ObjectName objectName = JMSManagementServiceImpl.getJMSTopicObjectName(s);
TopicControlMBean topic = (TopicControlMBean) MBeanServerInvocationHandler.newProxyInstance(
ManagementFactory.getPlatformMBeanServer(), objectName, TopicControlMBean.class, false);
- return Arrays.asList(topic.listAllSubscriberInfos());
+ return Arrays.asList(topic.listAllSubscriptionInfos());
}
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -46,7 +46,7 @@
import org.jboss.messaging.jms.JBossDestination;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.messaging.jms.server.management.TopicControlMBean;
import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
@@ -472,12 +472,12 @@
}
- public List<SubscriberInfo> listAllSubscribersForTopic(String s) throws Exception
+ public List<SubscriptionInfo> listAllSubscribersForTopic(String s) throws Exception
{
ObjectName objectName = JMSManagementServiceImpl.getJMSTopicObjectName(s);
TopicControlMBean topic = (TopicControlMBean) MBeanServerInvocationHandler.newProxyInstance(
ManagementFactory.getPlatformMBeanServer(), objectName, TopicControlMBean.class, false);
- return Arrays.asList(topic.listAllSubscriberInfos());
+ return Arrays.asList(topic.listAllSubscriptionInfos());
}
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/Server.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -36,7 +36,7 @@
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.jms.JBossDestination;
import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
/**
* The remote interface exposed by TestServer.
@@ -260,7 +260,7 @@
Integer getMessageCountForQueue(String queueName) throws Exception;
- List<SubscriberInfo> listAllSubscribersForTopic(String s) throws Exception;
+ List<SubscriptionInfo> listAllSubscribersForTopic(String s) throws Exception;
Set<Role> getSecurityConfig() throws Exception;
Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriberInfoTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriberInfoTest.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriberInfoTest.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * 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.tests.unit.jms.server.management;
-
-import static org.jboss.messaging.tests.util.RandomUtil.randomBoolean;
-import static org.jboss.messaging.tests.util.RandomUtil.randomInt;
-import static org.jboss.messaging.tests.util.RandomUtil.randomString;
-
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
-
-import junit.framework.TestCase;
-
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class SubscriberInfoTest extends TestCase
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- public static void assertEquals(SubscriberInfo expected,
- CompositeData actual)
- {
- assertTrue(actual.getCompositeType().equals(SubscriberInfo.TYPE));
-
- assertEquals(expected.getID(), actual.get("id"));
- assertEquals(expected.getClientID(), actual.get("clientID"));
- assertEquals(expected.getName(), actual.get("name"));
- assertEquals(expected.isDurable(), actual.get("durable"));
- assertEquals(expected.getSelector(), actual.get("selector"));
- assertEquals(expected.getMessageCount(), actual.get("messageCount"));
- assertEquals(expected.getMaxSizeBytes(), actual.get("maxSizeBytes"));
- }
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public void testToCompositeData() throws Exception
- {
- SubscriberInfo info = new SubscriberInfo(randomString(), randomString(),
- randomString(), randomBoolean(), randomString(), randomInt(),
- randomInt());
- CompositeData data = info.toCompositeData();
-
- assertEquals(info, data);
- }
-
- public void testToTabularData() throws Exception
- {
- SubscriberInfo info_1 = new SubscriberInfo(randomString(), randomString(),
- randomString(), randomBoolean(), randomString(), randomInt(),
- randomInt());
- SubscriberInfo info_2 = new SubscriberInfo(randomString(), randomString(),
- randomString(), randomBoolean(), randomString(), randomInt(),
- randomInt());
- SubscriberInfo[] infos = new SubscriberInfo[] { info_1, info_2 };
-
- TabularData data = SubscriberInfo.toTabularData(infos);
- assertEquals(2, data.size());
- CompositeData data_1 = data.get(new Object[] { info_1.getID() });
- CompositeData data_2 = data.get(new Object[] { info_2.getID() });
-
- assertEquals(info_1, data_1);
- assertEquals(info_2, data_2);
- }
-
- public void testToTabularDataWithEmptyMessages() throws Exception
- {
- TabularData data = SubscriberInfo.toTabularData(new SubscriberInfo[0]);
- assertEquals(0, data.size());
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriptionInfoTest.java (from rev 4818, trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriberInfoTest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriptionInfoTest.java (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriptionInfoTest.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.tests.unit.jms.server.management;
+
+import static org.jboss.messaging.tests.util.RandomUtil.randomBoolean;
+import static org.jboss.messaging.tests.util.RandomUtil.randomInt;
+import static org.jboss.messaging.tests.util.RandomUtil.randomString;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
+import junit.framework.TestCase;
+
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class SubscriptionInfoTest extends TestCase
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ public static void assertEquals(SubscriptionInfo expected,
+ CompositeData actual)
+ {
+ assertTrue(actual.getCompositeType().equals(SubscriptionInfo.TYPE));
+
+ assertEquals(expected.getQueueName(), actual.get("queueName"));
+ assertEquals(expected.getClientID(), actual.get("clientID"));
+ assertEquals(expected.getName(), actual.get("name"));
+ assertEquals(expected.isDurable(), actual.get("durable"));
+ assertEquals(expected.getSelector(), actual.get("selector"));
+ assertEquals(expected.getMessageCount(), actual.get("messageCount"));
+ assertEquals(expected.getMaxSizeBytes(), actual.get("maxSizeBytes"));
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public void testToCompositeData() throws Exception
+ {
+ SubscriptionInfo info = new SubscriptionInfo(randomString(), randomString(),
+ randomString(), randomBoolean(), randomString(), randomInt(),
+ randomInt());
+ CompositeData data = info.toCompositeData();
+
+ assertEquals(info, data);
+ }
+
+ public void testToTabularData() throws Exception
+ {
+ SubscriptionInfo info_1 = new SubscriptionInfo(randomString(), randomString(),
+ randomString(), randomBoolean(), randomString(), randomInt(),
+ randomInt());
+ SubscriptionInfo info_2 = new SubscriptionInfo(randomString(), randomString(),
+ randomString(), randomBoolean(), randomString(), randomInt(),
+ randomInt());
+ SubscriptionInfo[] infos = new SubscriptionInfo[] { info_1, info_2 };
+
+ TabularData data = SubscriptionInfo.toTabularData(infos);
+ assertEquals(2, data.size());
+ CompositeData data_1 = data.get(new Object[] { info_1.getQueueName() });
+ CompositeData data_2 = data.get(new Object[] { info_2.getQueueName() });
+
+ assertEquals(info_1, data_1);
+ assertEquals(info_2, data_2);
+ }
+
+ public void testToTabularDataWithEmptyMessages() throws Exception
+ {
+ TabularData data = SubscriptionInfo.toTabularData(new SubscriptionInfo[0]);
+ assertEquals(0, data.size());
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Property changes on: trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/SubscriptionInfoTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/impl/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/impl/TopicControlTest.java 2008-08-19 07:44:46 UTC (rev 4834)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/jms/server/management/impl/TopicControlTest.java 2008-08-19 09:52:15 UTC (rev 4835)
@@ -42,7 +42,7 @@
import org.jboss.messaging.core.postoffice.PostOffice;
import org.jboss.messaging.core.server.Queue;
import org.jboss.messaging.jms.JBossTopic;
-import org.jboss.messaging.jms.server.management.SubscriberInfo;
+import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.messaging.jms.server.management.impl.TopicControl;
/**
@@ -185,15 +185,15 @@
assertEquals(countForNonDurableQueue + countForDurableQueue_1
+ countForDurableQueue_2, control.getMessageCount());
assertEquals(countForDurableQueue_1 + countForDurableQueue_2, control
- .getDurableMessageCount());
- assertEquals(countForNonDurableQueue, control.getNonDurableMessageCount());
+ .getDurableMessagesCount());
+ assertEquals(countForNonDurableQueue, control.getNonDurableMessagesCount());
verify(postOffice, storageManager, bindingForNonDurableQueue,
nonDurableQueue, bindingForDurableQueue_1, durableQueue_1,
bindingForDurableQueue_2, durableQueue_2);
}
- public void testGetSubcribersCount() throws Exception
+ public void testGetSubcriptionsCount() throws Exception
{
String jndiBinding = randomString();
String name = randomString();
@@ -230,9 +230,9 @@
TopicControl control = new TopicControl(topic, jndiBinding, postOffice,
storageManager);
- assertEquals(3, control.getSubcribersCount());
- assertEquals(2, control.getDurableSubcribersCount());
- assertEquals(1, control.getNonDurableSubcribersCount());
+ assertEquals(3, control.getSubcriptionsCount());
+ assertEquals(2, control.getDurableSubcriptionsCount());
+ assertEquals(1, control.getNonDurableSubcriptionsCount());
verify(postOffice, storageManager, bindingForNonDurableQueue,
nonDurableQueue, bindingForDurableQueue_1, durableQueue_1,
@@ -275,7 +275,7 @@
bindingForQueue_2, queue_2);
}
- public void testListSubscriberInfos() throws Exception
+ public void testListSubscriptionInfos() throws Exception
{
String jndiBinding = randomString();
String name = randomString();
@@ -313,20 +313,20 @@
TopicControl control = new TopicControl(topic, jndiBinding, postOffice,
storageManager);
- SubscriberInfo[] infos = control.listAllSubscriberInfos();
+ SubscriptionInfo[] infos = control.listAllSubscriptionInfos();
assertEquals(2, infos.length);
- infos = control.listDurableSubscriberInfos();
+ infos = control.listDurableSubscriptionInfos();
assertEquals(1, infos.length);
- assertEquals(durableQueue.getName().toString(), infos[0].getID());
- infos = control.listNonDurableSubscriberInfos();
+ assertEquals(durableQueue.getName().toString(), infos[0].getQueueName());
+ infos = control.listNonDurableSubscriptionInfos();
assertEquals(1, infos.length);
- assertEquals(nonDurableQueue.getName().toString(), infos[0].getID());
+ assertEquals(nonDurableQueue.getName().toString(), infos[0].getQueueName());
verify(postOffice, storageManager, bindingForDurableQueue, durableQueue,
bindingForNonDurableQueue, nonDurableQueue);
}
- public void testListSubscribers() throws Exception
+ public void testListSubscriptions() throws Exception
{
String jndiBinding = randomString();
String name = randomString();
@@ -365,14 +365,14 @@
TopicControl control = new TopicControl(topic, jndiBinding, postOffice,
storageManager);
- TabularData data = control.listAllSubscribers();
+ TabularData data = control.listAllSubscriptions();
assertEquals(2, data.size());
- data = control.listDurableSubscribers();
+ data = control.listDurableSubscriptions();
assertEquals(1, data.size());
CompositeData info = data.get(new String[] { durableQueue.getName()
.toString() });
assertNotNull(info);
- data = control.listNonDurableSubscribers();
+ data = control.listNonDurableSubscriptions();
assertEquals(1, data.size());
info = data.get(new String[] { nonDurableQueue.getName().toString() });
assertNotNull(info);
More information about the jboss-cvs-commits
mailing list