[jboss-cvs] JBoss Messaging SVN: r3730 - in trunk/src/main/org/jboss: jms/server/endpoint and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 18 09:21:10 EST 2008


Author: ataylor
Date: 2008-02-18 09:21:09 -0500 (Mon, 18 Feb 2008)
New Revision: 3730

Added:
   trunk/src/main/org/jboss/jms/server/ClientInfo.java
   trunk/src/main/org/jboss/jms/server/MessageStatistics.java
Removed:
   trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageStatistics.java
Modified:
   trunk/src/main/org/jboss/jms/server/JMSServerManager.java
   trunk/src/main/org/jboss/jms/server/JMSServerManagerImpl.java
   trunk/src/main/org/jboss/jms/server/endpoint/MessagingServerPacketHandler.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
   trunk/src/main/org/jboss/messaging/core/MessagingServerManagement.java
   trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageCounter.java
   trunk/src/main/org/jboss/messaging/core/impl/server/MessagingServerManagementImpl.java
Log:
refactoring of management interfaces second draft

Added: trunk/src/main/org/jboss/jms/server/ClientInfo.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ClientInfo.java	                        (rev 0)
+++ trunk/src/main/org/jboss/jms/server/ClientInfo.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -0,0 +1,83 @@
+/*
+   * 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.jms.server;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+
+/**
+ * @author <a href="ataylor at redhat.com">Andy Taylor</a>
+ */
+public class ClientInfo
+{
+   private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("HH:mm:ss, EEE, MMM d, yyyy");
+
+   enum status{ STARTED, STOPPED }
+
+   private String user;
+   private String address;
+   private boolean started;
+   private long created;
+
+   public ClientInfo(String user, String address, boolean started, long created)
+   {
+      this.user = user;
+      this.address = address;
+      this.started = started;
+      this.created = created;
+   }
+
+   public String getUser()
+   {
+      return user;
+   }
+
+   public String getAddress()
+   {
+      return address;
+   }
+
+   public status getStatus()
+   {
+      return started? status.STARTED:status.STOPPED;
+   }
+
+    public String getTimeCreated()
+   {
+
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTime(new Date(created));
+      return SIMPLE_DATE_FORMAT.format(calendar.getTime());
+   }
+
+   public String getAliveTime()
+   {
+      StringBuilder builder = new StringBuilder();
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTime(new Date(System.currentTimeMillis() - created));
+      builder.append(calendar.get(Calendar.DAY_OF_YEAR) - 1).append(" days ").append(calendar.get(Calendar.HOUR_OF_DAY)).
+              append(" hours ").append(calendar.get(Calendar.MINUTE)).append(" minutes ").append(calendar.get(Calendar.SECOND)).
+              append(" seconds.");
+      return builder.toString();
+   }
+}

Modified: trunk/src/main/org/jboss/jms/server/JMSServerManager.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/JMSServerManager.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/jms/server/JMSServerManager.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -3,7 +3,7 @@
 import org.jboss.jms.destination.JBossQueue;
 import org.jboss.jms.destination.JBossTopic;
 import org.jboss.messaging.core.impl.server.SubscriptionInfo;
-import org.jboss.messaging.core.impl.messagecounter.MessageStatistics;
+import org.jboss.jms.server.MessageStatistics;
 
 import javax.jms.Message;
 import java.util.List;
@@ -87,7 +87,7 @@
 
    int getConsumerCountForQueue(JBossQueue queue) throws Exception;
 
-   List getClients() throws Exception;
+   List<ClientInfo> getClients() throws Exception;
 
    void startGatheringStatistics();
 

Modified: trunk/src/main/org/jboss/jms/server/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/JMSServerManagerImpl.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/jms/server/JMSServerManagerImpl.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -30,7 +30,7 @@
 import org.jboss.messaging.core.MessagingServerManagement;
 import org.jboss.messaging.core.Queue;
 import org.jboss.messaging.core.impl.server.SubscriptionInfo;
-import org.jboss.messaging.core.impl.messagecounter.MessageStatistics;
+import org.jboss.jms.server.MessageStatistics;
 import org.jboss.messaging.core.impl.messagecounter.MessageCounter;
 import org.jboss.messaging.deployers.Deployer;
 import org.jboss.messaging.deployers.DeploymentManager;
@@ -564,15 +564,19 @@
    {
        return messagingServerManagement.getConsumerCountForQueue(queue.getName());
    }
-   //todo something!
-   public List getClients() throws Exception
+
+   public List<ClientInfo> getClients() throws Exception
    {
-      List<ServerConnectionEndpoint> endpoints = messagingServerManagement.getClients();
+      List<ClientInfo> clientInfos = new ArrayList<ClientInfo>();
+      List<ServerConnectionEndpoint> endpoints = messagingServerManagement.getActiveConnections();
       for (ServerConnectionEndpoint endpoint : endpoints)
       {
-         //endpoint.
+         clientInfos.add(new ClientInfo(endpoint.getUsername(),
+                 endpoint.getClientAddress(),
+                 endpoint.isStarted(),
+                 endpoint.getCreated()));
       }
-      return null;
+      return clientInfos;
    }
 
 

Copied: trunk/src/main/org/jboss/jms/server/MessageStatistics.java (from rev 3729, trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageStatistics.java)
===================================================================
--- trunk/src/main/org/jboss/jms/server/MessageStatistics.java	                        (rev 0)
+++ trunk/src/main/org/jboss/jms/server/MessageStatistics.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -0,0 +1,340 @@
+/*
+* 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.jms.server;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+
+//FIXME this doesn't belong here
+
+/**
+ * Message statistics
+ * 
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version <tt>$Revision: 1.3 $</tt>
+ */
+public class MessageStatistics implements Serializable
+{
+   // Constants -----------------------------------------------------
+
+   /** The serialVersionUID */
+   static final long serialVersionUID = 8056884098781414022L;
+
+   // Attributes ----------------------------------------------------
+
+   /** Whether we are topic */
+   private boolean topic;
+
+   /** Whether we are durable */
+   private boolean durable;
+
+   /** The name */
+   private String name;
+
+   /** The subscription id */
+   private String subscriptionID;
+
+   /** The message count */
+   private int count;
+
+   /** The message count delta */
+   private int countDelta;
+
+   /** The message depth */
+   private int depth;
+
+   /** The message depth delta */
+   private int depthDelta;
+
+   /** The last update */
+   private long timeLastUpdate;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Construct a new Message Statistics
+    */
+   public MessageStatistics()
+   {
+   }
+
+   // Public --------------------------------------------------------
+
+   /**
+    * Get the count.
+    * 
+    * @return Returns the count.
+    */
+   public int getCount()
+   {
+      return count;
+   }
+
+   /**
+    * Set the count.
+    * 
+    * @param count The count to set.
+    */
+   public void setCount(int count)
+   {
+      this.count = count;
+   }
+
+   /**
+    * Get the countDelta.
+    * 
+    * @return Returns the countDelta.
+    */
+   public int getCountDelta()
+   {
+      return countDelta;
+   }
+
+   /**
+    * Set the countDelta.
+    * 
+    * @param countDelta The countDelta to set.
+    */
+   public void setCountDelta(int countDelta)
+   {
+      this.countDelta = countDelta;
+   }
+
+   /**
+    * Get the depth.
+    * 
+    * @return Returns the depth.
+    */
+   public int getDepth()
+   {
+      return depth;
+   }
+
+   /**
+    * Set the depth.
+    * 
+    * @param depth The depth to set.
+    */
+   public void setDepth(int depth)
+   {
+      this.depth = depth;
+   }
+
+   /**
+    * Get the depthDelta.
+    * 
+    * @return Returns the depthDelta.
+    */
+   public int getDepthDelta()
+   {
+      return depthDelta;
+   }
+
+   /**
+    * Set the depthDelta.
+    * 
+    * @param depthDelta The depthDelta to set.
+    */
+   public void setDepthDelta(int depthDelta)
+   {
+      this.depthDelta = depthDelta;
+   }
+
+   /**
+    * Get the durable.
+    * 
+    * @return Returns the durable.
+    */
+   public boolean isDurable()
+   {
+      return durable;
+   }
+
+   /**
+    * Set the durable.
+    * 
+    * @param durable The durable to set.
+    */
+   public void setDurable(boolean durable)
+   {
+      this.durable = durable;
+   }
+
+   /**
+    * Get the name.
+    * 
+    * @return Returns the name.
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * Set the name.
+    * 
+    * @param name The name to set.
+    */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    * Get the subscriptionID.
+    * 
+    * @return Returns the subscriptionID.
+    */
+   public String getSubscriptionID()
+   {
+      return subscriptionID;
+   }
+
+   /**
+    * Set the subscriptionID.
+    * 
+    * @param subscriptionID The subscriptionID to set.
+    */
+   public void setSubscriptionID(String subscriptionID)
+   {
+      this.subscriptionID = subscriptionID;
+   }
+
+   /**
+    * Get the timeLastUpdate.
+    * 
+    * @return Returns the timeLastUpdate.
+    */
+   public long getTimeLastUpdate()
+   {
+      return timeLastUpdate;
+   }
+
+   /**
+    * Set the timeLastUpdate.
+    * 
+    * @param timeLastUpdate The timeLastUpdate to set.
+    */
+   public void setTimeLastUpdate(long timeLastUpdate)
+   {
+      this.timeLastUpdate = timeLastUpdate;
+   }
+
+   /**
+    * Get the topic.
+    * 
+    * @return Returns the topic.
+    */
+   public boolean isTopic()
+   {
+      return topic;
+   }
+
+   /**
+    * Set the topic.
+    * 
+    * @param topic The topic to set.
+    */
+   public void setTopic(boolean topic)
+   {
+      this.topic = topic;
+   }
+
+   /**
+    * Get message data as string in format
+    *
+    *  "Topic/Queue, Name, Subscription, Durable, Count, CountDelta,
+    *  Depth, DepthDelta, Timestamp Last Increment"  
+    *
+    * @return  String data as a string
+    */
+   public String getAsString()
+   {
+      StringBuffer buffer = new StringBuffer(50);
+
+      // Topic/Queue
+      if (topic)
+         buffer.append("Topic,");
+      else
+         buffer.append("Queue,");
+
+      // name 
+      buffer.append(name).append(',');
+
+      // subscription
+      if (subscriptionID != null)
+         buffer.append(subscriptionID).append(',');
+      else
+         buffer.append("-,");
+
+      // Durable subscription
+      if (topic)
+      {
+         // Topic
+         if (durable)
+            buffer.append("DURABLE,");
+         else
+            buffer.append("NONDURABLE,");
+      }
+      else
+      {
+         buffer.append("-,");
+      }
+
+      // counter values
+      buffer.append(count).append(',').append(countDelta).append(',').append(depth).append(',').append(depthDelta)
+            .append(',');
+
+      // timestamp last counter update
+      if (timeLastUpdate > 0)
+      {
+         DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+
+         buffer.append(dateFormat.format(new Date(timeLastUpdate)));
+      }
+      else
+      {
+         buffer.append('-');
+      }
+
+      return buffer.toString();
+   }
+
+   // Object overrides ----------------------------------------------
+
+   public String toString()
+   {
+      return getAsString();
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}
\ No newline at end of file

Modified: trunk/src/main/org/jboss/jms/server/endpoint/MessagingServerPacketHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/MessagingServerPacketHandler.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/jms/server/endpoint/MessagingServerPacketHandler.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -76,7 +76,7 @@
          
          response = createConnection(request
                .getUsername(), request.getPassword(), request.getRemotingSessionID(),
-               request.getClientVMID(), request.getPrefetchSize());
+               request.getClientVMID(), request.getPrefetchSize(), sender.getRemoteAddress());
       }     
       else
       {
@@ -90,7 +90,8 @@
    private CreateConnectionResponse
       createConnection(String username,
                               String password,
-                              String remotingSessionID, String clientVMID, int prefetchSize)
+                              String remotingSessionID, String clientVMID, int prefetchSize,
+                              String address)
       throws Exception
    {
       log.trace("creating a new connection for user " + username);
@@ -125,7 +126,7 @@
       // server peer's ClientManager
       final ServerConnectionEndpoint endpoint =
          new ServerConnectionEndpoint(messagingServer, username, password, prefetchSize,
-                                      remotingSessionID, clientVMID);
+                                      remotingSessionID, clientVMID, address);
 
       String connectionID = endpoint.getConnectionID();
 

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -99,12 +99,16 @@
 
    private final int prefetchSize;
 
+   private String clientAddress;
+   private long created;
+
    // Constructors ---------------------------------------------------------------------------------
 
    public ServerConnectionEndpoint(MessagingServer messagingServer,
                                    String username, String password, int prefetchSize,
                                    String remotingSessionID,
-                                   String clientVMID) throws Exception
+                                   String clientVMID,
+                                   String clientAddress) throws Exception
    {
       this.messagingServer = messagingServer;
 
@@ -125,7 +129,11 @@
       this.remotingClientSessionID = remotingSessionID;
 
       this.jmsClientVMID = clientVMID;
-      
+
+      this.clientAddress = clientAddress;
+
+      created = System.currentTimeMillis();
+
       cm.registerConnection(jmsClientVMID, remotingClientSessionID, this);
    }
 
@@ -206,6 +214,16 @@
       return password;
    }
 
+   public long getCreated()
+   {
+      return created;
+   }
+
+   public String getClientAddress()
+   {
+      return clientAddress;
+   }
+
    public SecurityStore getSecurityManager()
    {
       return sm;
@@ -238,7 +256,7 @@
       return id;
    }
 
-   boolean isStarted()
+   public boolean isStarted()
    {
       return started;
    }

Modified: trunk/src/main/org/jboss/messaging/core/MessagingServerManagement.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/MessagingServerManagement.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/messaging/core/MessagingServerManagement.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -86,5 +86,5 @@
 
    public int getConsumerCountForQueue(String queue) throws Exception;
 
-   List<ServerConnectionEndpoint> getClients();
+   List<ServerConnectionEndpoint> getActiveConnections();
 }

Modified: trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageCounter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageCounter.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageCounter.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -66,35 +66,7 @@
    // per hour day counter history
    private int dayCounterMax;
    private ArrayList<DayCounter> dayCounter;
-   
-   /**
-    * Get a list of message statistics from a list of message counters
-    *
-    * @return the message statistics
-    * @throws Exception for any error
-    */
-   public static List<? extends MessageStatistics> getMessageStatistics(List counters) throws Exception
-   {
-      List<MessageStatistics> list = new ArrayList<MessageStatistics>(counters.size());
 
-      for (Object counter1 : counters)
-      {
-         MessageCounter counter = (MessageCounter) counter1;
-
-         MessageStatistics stats = new MessageStatistics();
-         stats.setName(counter.getDestinationName());
-         stats.setDurable(counter.getDestinationDurable());
-         stats.setCount(counter.getCount());
-         stats.setCountDelta(counter.getCountDelta());
-         stats.setDepth(counter.getMessageCount());
-         stats.setDepthDelta(counter.getMessageCountDelta());
-         stats.setTimeLastUpdate(counter.getLastUpdate());
-
-         list.add(stats);
-      }
-      return list;
-   }
-
    /**
     *    Constructor
     *

Deleted: trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageStatistics.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageStatistics.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/messaging/core/impl/messagecounter/MessageStatistics.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -1,340 +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.impl.messagecounter;
-
-import java.io.Serializable;
-import java.text.DateFormat;
-import java.util.Date;
-
-//FIXME this doesn't belong here
-
-/**
- * Message statistics
- * 
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- * @version <tt>$Revision: 1.3 $</tt>
- */
-public class MessageStatistics implements Serializable
-{
-   // Constants -----------------------------------------------------
-
-   /** The serialVersionUID */
-   static final long serialVersionUID = 8056884098781414022L;
-
-   // Attributes ----------------------------------------------------
-
-   /** Whether we are topic */
-   private boolean topic;
-
-   /** Whether we are durable */
-   private boolean durable;
-
-   /** The name */
-   private String name;
-
-   /** The subscription id */
-   private String subscriptionID;
-
-   /** The message count */
-   private int count;
-
-   /** The message count delta */
-   private int countDelta;
-
-   /** The message depth */
-   private int depth;
-
-   /** The message depth delta */
-   private int depthDelta;
-
-   /** The last update */
-   private long timeLastUpdate;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Construct a new Message Statistics
-    */
-   public MessageStatistics()
-   {
-   }
-
-   // Public --------------------------------------------------------
-
-   /**
-    * Get the count.
-    * 
-    * @return Returns the count.
-    */
-   public int getCount()
-   {
-      return count;
-   }
-
-   /**
-    * Set the count.
-    * 
-    * @param count The count to set.
-    */
-   public void setCount(int count)
-   {
-      this.count = count;
-   }
-
-   /**
-    * Get the countDelta.
-    * 
-    * @return Returns the countDelta.
-    */
-   public int getCountDelta()
-   {
-      return countDelta;
-   }
-
-   /**
-    * Set the countDelta.
-    * 
-    * @param countDelta The countDelta to set.
-    */
-   public void setCountDelta(int countDelta)
-   {
-      this.countDelta = countDelta;
-   }
-
-   /**
-    * Get the depth.
-    * 
-    * @return Returns the depth.
-    */
-   public int getDepth()
-   {
-      return depth;
-   }
-
-   /**
-    * Set the depth.
-    * 
-    * @param depth The depth to set.
-    */
-   public void setDepth(int depth)
-   {
-      this.depth = depth;
-   }
-
-   /**
-    * Get the depthDelta.
-    * 
-    * @return Returns the depthDelta.
-    */
-   public int getDepthDelta()
-   {
-      return depthDelta;
-   }
-
-   /**
-    * Set the depthDelta.
-    * 
-    * @param depthDelta The depthDelta to set.
-    */
-   public void setDepthDelta(int depthDelta)
-   {
-      this.depthDelta = depthDelta;
-   }
-
-   /**
-    * Get the durable.
-    * 
-    * @return Returns the durable.
-    */
-   public boolean isDurable()
-   {
-      return durable;
-   }
-
-   /**
-    * Set the durable.
-    * 
-    * @param durable The durable to set.
-    */
-   public void setDurable(boolean durable)
-   {
-      this.durable = durable;
-   }
-
-   /**
-    * Get the name.
-    * 
-    * @return Returns the name.
-    */
-   public String getName()
-   {
-      return name;
-   }
-
-   /**
-    * Set the name.
-    * 
-    * @param name The name to set.
-    */
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-
-   /**
-    * Get the subscriptionID.
-    * 
-    * @return Returns the subscriptionID.
-    */
-   public String getSubscriptionID()
-   {
-      return subscriptionID;
-   }
-
-   /**
-    * Set the subscriptionID.
-    * 
-    * @param subscriptionID The subscriptionID to set.
-    */
-   public void setSubscriptionID(String subscriptionID)
-   {
-      this.subscriptionID = subscriptionID;
-   }
-
-   /**
-    * Get the timeLastUpdate.
-    * 
-    * @return Returns the timeLastUpdate.
-    */
-   public long getTimeLastUpdate()
-   {
-      return timeLastUpdate;
-   }
-
-   /**
-    * Set the timeLastUpdate.
-    * 
-    * @param timeLastUpdate The timeLastUpdate to set.
-    */
-   public void setTimeLastUpdate(long timeLastUpdate)
-   {
-      this.timeLastUpdate = timeLastUpdate;
-   }
-
-   /**
-    * Get the topic.
-    * 
-    * @return Returns the topic.
-    */
-   public boolean isTopic()
-   {
-      return topic;
-   }
-
-   /**
-    * Set the topic.
-    * 
-    * @param topic The topic to set.
-    */
-   public void setTopic(boolean topic)
-   {
-      this.topic = topic;
-   }
-
-   /**
-    * Get message data as string in format
-    *
-    *  "Topic/Queue, Name, Subscription, Durable, Count, CountDelta,
-    *  Depth, DepthDelta, Timestamp Last Increment"  
-    *
-    * @return  String data as a string
-    */
-   public String getAsString()
-   {
-      StringBuffer buffer = new StringBuffer(50);
-
-      // Topic/Queue
-      if (topic)
-         buffer.append("Topic,");
-      else
-         buffer.append("Queue,");
-
-      // name 
-      buffer.append(name).append(',');
-
-      // subscription
-      if (subscriptionID != null)
-         buffer.append(subscriptionID).append(',');
-      else
-         buffer.append("-,");
-
-      // Durable subscription
-      if (topic)
-      {
-         // Topic
-         if (durable)
-            buffer.append("DURABLE,");
-         else
-            buffer.append("NONDURABLE,");
-      }
-      else
-      {
-         buffer.append("-,");
-      }
-
-      // counter values
-      buffer.append(count).append(',').append(countDelta).append(',').append(depth).append(',').append(depthDelta)
-            .append(',');
-
-      // timestamp last counter update
-      if (timeLastUpdate > 0)
-      {
-         DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
-
-         buffer.append(dateFormat.format(new Date(timeLastUpdate)));
-      }
-      else
-      {
-         buffer.append('-');
-      }
-
-      return buffer.toString();
-   }
-
-   // Object overrides ----------------------------------------------
-
-   public String toString()
-   {
-      return getAsString();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}
\ No newline at end of file

Modified: trunk/src/main/org/jboss/messaging/core/impl/server/MessagingServerManagementImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/impl/server/MessagingServerManagementImpl.java	2008-02-18 09:46:19 UTC (rev 3729)
+++ trunk/src/main/org/jboss/messaging/core/impl/server/MessagingServerManagementImpl.java	2008-02-18 14:21:09 UTC (rev 3730)
@@ -294,7 +294,7 @@
       return getQueue(queue).getConsumerCount();
    }
 
-   public  List<ServerConnectionEndpoint> getClients()
+   public  List<ServerConnectionEndpoint> getActiveConnections()
    {
       return messagingServer.getConnectionManager().getActiveConnections();
    }
@@ -319,7 +319,7 @@
 ////      List counters = new ArrayList();
 ////      counters.add(getQueue(queue).getMessageCounter());
 ////
-////      List stats = MessageCounter.getMessageStatistics(counters);
+////      List stats = MessageCounter.getStatistics(counters);
 ////
 ////      return (MessageStatistics)stats.get(0);
 ////   }




More information about the jboss-cvs-commits mailing list