org.apache.activemq.console.command
Class PurgeCommand

java.lang.Object
  extended by org.apache.activemq.console.command.AbstractCommand
      extended by org.apache.activemq.console.command.AbstractJmxCommand
          extended by org.apache.activemq.console.command.PurgeCommand
All Implemented Interfaces:
Command

public class PurgeCommand
extends AbstractJmxCommand


Field Summary
protected  java.lang.String[] helpFile
           
 
Fields inherited from class org.apache.activemq.console.command.AbstractJmxCommand
DEFAULT_JMX_URL
 
Fields inherited from class org.apache.activemq.console.command.AbstractCommand
COMMAND_OPTION_DELIMETER, context
 
Constructor Summary
PurgeCommand()
           
 
Method Summary
 java.lang.String convertToSQL92(java.util.List<java.lang.String> tokens)
          Converts the message selector as provided on command line argument to activem-admin into an SQL-92 conform string.
protected  void handleOption(java.lang.String token, java.util.List<java.lang.String> tokens)
          Handle the --msgsel, --xmsgsel.
protected  void printHelp()
          Print the help messages for the browse command
 void purgeQueue(javax.management.ObjectName queue)
          Purge all the messages in the queue
protected  void runTask(java.util.List<java.lang.String> tokens)
          Execute the purge command, which allows you to purge the messages in a given JMS destination
 
Methods inherited from class org.apache.activemq.console.command.AbstractJmxCommand
closeJmxConnection, createJmxConnection, execute, findJMXUrlByProcessId, getJmxPassword, getJmxServiceUrl, getJmxUser, getJVM, isJmxUseLocal, isSunJVM, setJmxPassword, setJmxServiceUrl, setJmxServiceUrl, setJmxUseLocal, setJmxUser, useJmxServiceUrl
 
Methods inherited from class org.apache.activemq.console.command.AbstractCommand
parseOptions, setCommandContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpFile

protected java.lang.String[] helpFile
Constructor Detail

PurgeCommand

public PurgeCommand()
Method Detail

runTask

protected void runTask(java.util.List<java.lang.String> tokens)
                throws java.lang.Exception
Execute the purge command, which allows you to purge the messages in a given JMS destination

Specified by:
runTask in class AbstractCommand
Parameters:
tokens - - command arguments
Throws:
java.lang.Exception

purgeQueue

public void purgeQueue(javax.management.ObjectName queue)
                throws java.lang.Exception
Purge all the messages in the queue

Parameters:
queue - - ObjectName of the queue to purge
Throws:
java.lang.Exception

handleOption

protected void handleOption(java.lang.String token,
                            java.util.List<java.lang.String> tokens)
                     throws java.lang.Exception
Handle the --msgsel, --xmsgsel.

Overrides:
handleOption in class AbstractJmxCommand
Parameters:
token - - option token to handle
tokens - - succeeding command arguments
Throws:
java.lang.Exception

convertToSQL92

public java.lang.String convertToSQL92(java.util.List<java.lang.String> tokens)
Converts the message selector as provided on command line argument to activem-admin into an SQL-92 conform string. E.g. "JMSMessageID='*:10',JMSPriority>5" gets converted into "(JMSMessageID='%:10') AND (JMSPriority>5)"

Parameters:
tokens - - List of message selector query parameters
Returns:
SQL-92 string of that query.

printHelp

protected void printHelp()
Print the help messages for the browse command

Specified by:
printHelp in class AbstractCommand


Copyright © 2005-2012. All Rights Reserved.