public class QueueControlImpl extends AbstractControl implements QueueControl
| Modifier and Type | Field and Description |
|---|---|
static int |
FLUSH_LIMIT |
| Constructor and Description |
|---|
QueueControlImpl(Queue queue,
String address,
PostOffice postOffice,
StorageManager storageManager,
SecurityStore securityStore,
HierarchicalRepository<AddressSettings> addressSettingsRepository) |
| Modifier and Type | Method and Description |
|---|---|
CompositeData[] |
browse(String filterStr)
Resets the MessagesAdded property
|
boolean |
changeMessagePriority(long messageID,
int newPriority)
Changes the message's priority corresponding to the specified message ID to the specified priority.
|
int |
changeMessagesPriority(String filterStr,
int newPriority)
Changes the priority for all the message corresponding to the specified filter to the specified priority.
|
long |
countMessages(String filterStr)
Counts the number of messages in this queue matching the specified filter.
|
boolean |
expireMessage(long messageID)
Expires the message corresponding to the specified message ID.
|
int |
expireMessages(String filterStr)
Expires all the message corresponding to the specified filter.
|
protected MBeanAttributeInfo[] |
fillMBeanAttributeInfo() |
protected MBeanOperationInfo[] |
fillMBeanOperationInfo() |
void |
flushExecutor()
it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call
any other measure.
|
String |
getAddress()
Returns the address this queue is bound to.
|
int |
getConsumerCount()
Returns the number of consumers consuming messages from this queue.
|
String |
getDeadLetterAddress()
Returns the dead-letter address associated with this queue.
|
int |
getDeliveringCount()
Returns the number of messages that this queue is currently delivering to its consumers.
|
String |
getExpiryAddress()
Returns the expiry address associated with this queue.
|
String |
getFilter()
Returns the filter associated with this queue.
|
protected Map<String,Object>[] |
getFirstMessage() |
Long |
getFirstMessageAge()
Returns the age of the first message in milliseconds.
|
String |
getFirstMessageAsJSON()
Returns the first message on the queue as JSON
|
Long |
getFirstMessageTimestamp()
Returns the timestamp of the first message in milliseconds.
|
long |
getID()
Returns this queue ID.
|
long |
getMessageCount()
Returns the number of messages currently in this queue.
|
long |
getMessagesAcknowledged()
Returns the number of messages added to this queue since it was created.
|
long |
getMessagesAdded()
Returns the number of messages added to this queue since it was created.
|
long |
getMessagesExpired()
Returns the number of messages expired from this queue since it was created.
|
long |
getMessagesKilled()
Returns the number of messages removed from this queue since it was created due to exceeding the max delivery attempts.
|
String |
getName()
Returns the name of this queue.
|
long |
getScheduledCount()
Returns the number of scheduled messages in this queue.
|
boolean |
isDurable()
Returns whether this queue is durable.
|
boolean |
isPaused()
Returns whether the queue is paused.
|
boolean |
isTemporary()
Returns whether this queue is temporary.
|
String |
listConsumersAsJSON() |
Map<String,Map<String,Object>[]> |
listDeliveringMessages()
Lists all the messages being deliver per consumer.
|
String |
listDeliveringMessagesAsJSON()
Executes a conversion of
QueueControl.listDeliveringMessages() to JSON |
String |
listMessageCounter()
Lists the message counter for this queue.
|
String |
listMessageCounterAsHTML()
Lists the message counter for this queue as a HTML table.
|
String |
listMessageCounterHistory()
Lists the message counter history for this queue.
|
String |
listMessageCounterHistoryAsHTML()
Lists the message counter history for this queue as a HTML table.
|
Map<String,Object>[] |
listMessages(String filterStr)
Lists all the messages in this queue matching the specified filter.
|
String |
listMessagesAsJSON(String filter)
Lists all the messages in this queue matching the specified filter using JSON serialization.
|
Map<String,Object>[] |
listScheduledMessages()
Lists all the messages scheduled for delivery for this queue.
|
String |
listScheduledMessagesAsJSON()
Lists all the messages scheduled for delivery for this queue using JSON serialization.
|
boolean |
moveMessage(long messageID,
String otherQueueName)
Moves the message corresponding to the specified message ID to the specified other queue.
|
boolean |
moveMessage(long messageID,
String otherQueueName,
boolean rejectDuplicates)
Moves the message corresponding to the specified message ID to the specified other queue.
|
int |
moveMessages(int flushLimit,
String filterStr,
String otherQueueName,
boolean rejectDuplicates) |
int |
moveMessages(String filterStr,
String otherQueueName)
Moves all the message corresponding to the specified filter to the specified other queue.
|
int |
moveMessages(String filterStr,
String otherQueueName,
boolean rejectDuplicates)
Moves all the message corresponding to the specified filter to the specified other queue.
|
void |
pause()
Pauses the queue.
|
void |
pause(boolean persist)
Pauses the queue.
|
boolean |
removeMessage(long messageID)
Removes the message corresponding to the specified message ID.
|
int |
removeMessages(int flushLimit,
String filterStr)
Removes all the message corresponding to the specified filter.
|
int |
removeMessages(String filterStr)
Removes all the message corresponding to the specified filter.
|
void |
resetMessageCounter()
Resets the message counter for this queue.
|
void |
resetMessagesAcknowledged()
Resets the MessagesAdded property
|
void |
resetMessagesAdded()
Resets the MessagesAdded property
|
void |
resetMessagesExpired()
Resets the MessagesExpired property
|
void |
resetMessagesKilled()
Resets the MessagesExpired property
|
void |
resume()
Resumes the queue.
|
boolean |
retryMessage(long messageID)
Retries the message corresponding to the given messageID to the original queue.
|
int |
retryMessages()
Retries all messages on a DLQ to their respective original queues.
|
String |
sendMessage(Map<String,String> headers,
int type,
String body,
String userID,
boolean durable,
String user,
String password) |
int |
sendMessagesToDeadLetterAddress(String filterStr)
Sends all the message corresponding to the specified filter to this queue's dead letter address.
|
boolean |
sendMessageToDeadLetterAddress(long messageID)
Sends the message corresponding to the specified message ID to this queue's dead letter address.
|
void |
setMessageCounter(MessageCounter counter) |
blockOnIO, clearIO, getMBeanInfocacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementationpublic static final int FLUSH_LIMIT
public QueueControlImpl(Queue queue, String address, PostOffice postOffice, StorageManager storageManager, SecurityStore securityStore, HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception
Exceptionpublic void setMessageCounter(MessageCounter counter)
public String getName()
QueueControlgetName in interface QueueControlpublic String getAddress()
QueueControlgetAddress in interface QueueControlpublic String getFilter()
QueueControlgetFilter in interface QueueControlpublic boolean isDurable()
QueueControlisDurable in interface QueueControlpublic boolean isTemporary()
QueueControlisTemporary in interface QueueControlpublic long getMessageCount()
QueueControlgetMessageCount in interface QueueControlpublic int getConsumerCount()
QueueControlgetConsumerCount in interface QueueControlpublic int getDeliveringCount()
QueueControlgetDeliveringCount in interface QueueControlpublic long getMessagesAdded()
QueueControlgetMessagesAdded in interface QueueControlpublic long getMessagesAcknowledged()
QueueControlgetMessagesAcknowledged in interface QueueControlpublic long getMessagesExpired()
QueueControlgetMessagesExpired in interface QueueControlpublic long getMessagesKilled()
QueueControlgetMessagesKilled in interface QueueControlpublic long getID()
QueueControlgetID in interface QueueControlpublic long getScheduledCount()
QueueControlgetScheduledCount in interface QueueControlpublic String getDeadLetterAddress()
QueueControlgetDeadLetterAddress in interface QueueControlpublic String getExpiryAddress()
QueueControlgetExpiryAddress in interface QueueControlpublic Map<String,Object>[] listScheduledMessages() throws Exception
QueueControllistScheduledMessages in interface QueueControlExceptionpublic String listScheduledMessagesAsJSON() throws Exception
QueueControllistScheduledMessagesAsJSON in interface QueueControlExceptionpublic Map<String,Map<String,Object>[]> listDeliveringMessages() throws ActiveMQException
QueueControlMap<String,Object>[] same way is returned by QueueControl.listScheduledMessages()listDeliveringMessages in interface QueueControlActiveMQExceptionpublic String listDeliveringMessagesAsJSON() throws Exception
QueueControlQueueControl.listDeliveringMessages() to JSONlistDeliveringMessagesAsJSON in interface QueueControlExceptionpublic Map<String,Object>[] listMessages(String filterStr) throws Exception
QueueControlnull or an empty filter will list all messages from this queue.listMessages in interface QueueControlExceptionpublic String listMessagesAsJSON(String filter) throws Exception
QueueControlnull or an empty filter will list all messages from this queue.listMessagesAsJSON in interface QueueControlExceptionpublic String getFirstMessageAsJSON() throws Exception
QueueControlgetFirstMessageAsJSON in interface QueueControlExceptionpublic Long getFirstMessageTimestamp() throws Exception
QueueControlgetFirstMessageTimestamp in interface QueueControlExceptionpublic Long getFirstMessageAge() throws Exception
QueueControlgetFirstMessageAge in interface QueueControlExceptionpublic long countMessages(String filterStr) throws Exception
QueueControlnull or an empty filter will count all messages from this queue.countMessages in interface QueueControlExceptionpublic boolean removeMessage(long messageID)
throws Exception
QueueControlremoveMessage in interface QueueControltrue if the message was removed, false elseExceptionpublic int removeMessages(String filterStr) throws Exception
QueueControlnull or an empty filter will remove all messages from this queue.removeMessages in interface QueueControlExceptionpublic int removeMessages(int flushLimit,
String filterStr)
throws Exception
QueueControlnull or an empty filter will remove all messages from this queue.removeMessages in interface QueueControlExceptionpublic boolean expireMessage(long messageID)
throws Exception
QueueControlexpireMessage in interface QueueControltrue if the message was expired, false elseExceptionpublic int expireMessages(String filterStr) throws Exception
QueueControlnull or an empty filter will expire all messages from this queue.expireMessages in interface QueueControlExceptionpublic boolean retryMessage(long messageID)
throws Exception
QueueControlretryMessage in interface QueueControltrue if the message was retried, false elseExceptionpublic int retryMessages()
throws Exception
QueueControlretryMessages in interface QueueControlExceptionpublic boolean moveMessage(long messageID,
String otherQueueName)
throws Exception
QueueControlmoveMessage in interface QueueControltrue if the message was moved, false elseExceptionpublic boolean moveMessage(long messageID,
String otherQueueName,
boolean rejectDuplicates)
throws Exception
QueueControlmoveMessage in interface QueueControltrue if the message was moved, false elseExceptionpublic int moveMessages(String filterStr, String otherQueueName) throws Exception
QueueControlnull or an empty filter will move all messages from this queue.moveMessages in interface QueueControlExceptionpublic int moveMessages(int flushLimit,
String filterStr,
String otherQueueName,
boolean rejectDuplicates)
throws Exception
moveMessages in interface QueueControlExceptionpublic int moveMessages(String filterStr, String otherQueueName, boolean rejectDuplicates) throws Exception
QueueControlnull or an empty filter will move all messages from this queue.moveMessages in interface QueueControlExceptionpublic int sendMessagesToDeadLetterAddress(String filterStr) throws Exception
QueueControlnull or an empty filter will send all messages from this queue.sendMessagesToDeadLetterAddress in interface QueueControlExceptionpublic String sendMessage(Map<String,String> headers, int type, String body, String userID, boolean durable, String user, String password) throws Exception
sendMessage in interface QueueControlheaders - the message headers and properties to set. Can only
container Strings maped to primitive types.body - the text to sendpassword - @returnExceptionpublic boolean sendMessageToDeadLetterAddress(long messageID)
throws Exception
QueueControlsendMessageToDeadLetterAddress in interface QueueControltrue if the message was sent to the dead letter address, false elseExceptionpublic int changeMessagesPriority(String filterStr, int newPriority) throws Exception
QueueControlnull or an empty filter will change all messages from this queue.changeMessagesPriority in interface QueueControlExceptionpublic boolean changeMessagePriority(long messageID,
int newPriority)
throws Exception
QueueControlchangeMessagePriority in interface QueueControlnewPriority - between 0 and 9 inclusive.true if the message priority was changedExceptionpublic String listMessageCounter()
QueueControllistMessageCounter in interface QueueControlpublic void resetMessageCounter()
QueueControlresetMessageCounter in interface QueueControlpublic String listMessageCounterAsHTML()
QueueControllistMessageCounterAsHTML in interface QueueControlpublic String listMessageCounterHistory() throws Exception
QueueControllistMessageCounterHistory in interface QueueControlExceptionpublic String listMessageCounterHistoryAsHTML()
QueueControllistMessageCounterHistoryAsHTML in interface QueueControlpublic void pause()
QueueControlpause in interface QueueControlpublic void pause(boolean persist)
QueueControlpause in interface QueueControlpublic void resume()
QueueControlresume in interface QueueControlpublic boolean isPaused()
throws Exception
QueueControlisPaused in interface QueueControlExceptionpublic CompositeData[] browse(String filterStr) throws Exception
QueueControlbrowse in interface QueueControlExceptionpublic void flushExecutor()
QueueControlflushExecutor in interface QueueControlpublic String listConsumersAsJSON() throws Exception
listConsumersAsJSON in interface QueueControlExceptionprotected MBeanOperationInfo[] fillMBeanOperationInfo()
fillMBeanOperationInfo in class AbstractControlprotected MBeanAttributeInfo[] fillMBeanAttributeInfo()
fillMBeanAttributeInfo in class AbstractControlpublic void resetMessagesAdded()
throws Exception
QueueControlresetMessagesAdded in interface QueueControlExceptionpublic void resetMessagesAcknowledged()
throws Exception
QueueControlresetMessagesAcknowledged in interface QueueControlExceptionpublic void resetMessagesExpired()
throws Exception
QueueControlresetMessagesExpired in interface QueueControlExceptionpublic void resetMessagesKilled()
throws Exception
QueueControlresetMessagesKilled in interface QueueControlExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.