Author: jmesnil
Date: 2009-12-11 10:12:06 -0500 (Fri, 11 Dec 2009)
New Revision: 8676
Modified:
trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java
trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc
Modified: trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java 2009-12-11 14:45:28 UTC
(rev 8675)
+++ trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java 2009-12-11 15:12:06 UTC
(rev 8676)
@@ -19,7 +19,7 @@
import org.hornetq.core.exception.HornetQException;
/**
- * A LargeMessageBufferImpl
+ * A LargeMessageBuffer represents the buffer of a large message.
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
*
@@ -27,18 +27,40 @@
*/
public interface LargeMessageBuffer extends HornetQBuffer
{
+ /**
+ * Returns the size of this buffer.
+
+ */
long getSize();
+ /**
+ * Discards packets unused by this buffer.
+ */
void discardUnusedPackets();
+ /**
+ * Closes this buffer.
+ */
void close();
+ /**
+ * Cancels this buffer.
+ */
void cancel();
+ /**
+ * Sets the OutputStream of this buffer to the specified output.
+ */
void setOutputStream(final OutputStream output) throws HornetQException;
+ /**
+ * Saves this buffer to the specified output.
+ */
void saveBuffer(final OutputStream output) throws HornetQException;
+ /**
+ * Waits for the completion for the specified waiting time (in milliseconds).
+ */
boolean waitCompletion(long timeWait) throws HornetQException;
}
Modified: trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/DayCounterInfo.java 2009-12-11 14:45:28 UTC
(rev 8675)
+++ trunk/src/main/org/hornetq/core/management/DayCounterInfo.java 2009-12-11 15:12:06 UTC
(rev 8676)
@@ -21,7 +21,10 @@
import org.hornetq.utils.json.JSONObject;
/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link QueueControl#listMessageCounterHistory()}.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public class DayCounterInfo
{
@@ -52,9 +55,12 @@
return json.toString();
}
+ /**
+ * Returns an array of RoleInfo corresponding to the JSON serialization returned
+ * by {@link QueueControl#listMessageCounterHistory()}.
+ */
public static DayCounterInfo[] fromJSON(final String jsonString) throws JSONException
{
-
JSONObject json = new JSONObject(jsonString);
JSONArray dayCounters = json.getJSONArray("dayCounters");
DayCounterInfo[] infos = new DayCounterInfo[dayCounters.length()];
@@ -85,12 +91,17 @@
// Public --------------------------------------------------------
/**
+ * Returns the date of the counter.
*/
public String getDate()
{
return date;
}
+ /**
+ * Returns a 24-length array corresponding to the number of messages added to the
queue
+ * for the given hour of the day.
+ */
public int[] getCounters()
{
return counters;
Modified: trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java 2009-12-11 14:45:28
UTC (rev 8675)
+++ trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java 2009-12-11 15:12:06
UTC (rev 8676)
@@ -21,10 +21,10 @@
import org.hornetq.utils.json.JSONObject;
/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link QueueControl#listMessageCounter()}.
*
- * @version <tt>$Revision$</tt>
- *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public class MessageCounterInfo
{
@@ -67,6 +67,10 @@
return json.toString();
}
+ /**
+ * Returns an array of RoleInfo corresponding to the JSON serialization returned
+ * by {@link QueueControl#listMessageCounter()}.
+ */
public static MessageCounterInfo fromJSON(final String jsonString) throws Exception
{
JSONObject data = new JSONObject(jsonString);
@@ -116,46 +120,73 @@
// Public --------------------------------------------------------
+ /**
+ * Returns the name of the queue.
+ */
public String getName()
{
return name;
}
+ /**
+ * Returns the name of the subscription.
+ */
public String getSubscription()
{
return subscription;
}
+ /**
+ * Returns whether the queue is durable.
+ */
public boolean isDurable()
{
return durable;
}
+ /**
+ * Returns the number of messages added to the queue since it was created.
+ */
public long getCount()
{
return count;
}
+ /**
+ * Returns the number of messages added to the queue since the last counter sample.
+ */
public long getCountDelta()
{
return countDelta;
}
+ /**
+ * Returns the number of messages currently in the queue.
+ */
public int getDepth()
{
return depth;
}
+ /**
+ * Returns the number of messages in the queue since last counter sample.
+ */
public int getDepthDelta()
{
return depthDelta;
}
+ /**
+ * Returns the timestamp of the last time a message was added to the queue.
+ */
public String getLastAddTimestamp()
{
return lastAddTimestamp;
}
+ /**
+ * Returns the timestamp of the last time the queue was updated.
+ */
public String getUdpateTimestamp()
{
return udpateTimestamp;
Show replies by date