public class org.apache.activemq.console.command.AmqBrowseCommand extends org.apache.activemq.console.command.AbstractAmqCommand
{
public static final java.lang.String QUEUE_PREFIX;
public static final java.lang.String TOPIC_PREFIX;
public static final java.lang.String VIEW_GROUP_HEADER;
public static final java.lang.String VIEW_GROUP_CUSTOM;
public static final java.lang.String VIEW_GROUP_BODY;
protected java.lang.String[] helpFile;
private final java.util.List queryAddObjects;
private final java.util.List querySubObjects;
private final java.util.Set groupViews;
private final java.util.Set queryViews;
public void <init>()
{
java.util.HashSet v, v;
java.lang.String[] v;
org.apache.activemq.console.command.AmqBrowseCommand v;
java.util.ArrayList v, v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
specialinvoke v.<org.apache.activemq.console.command.AbstractAmqCommand: void <init>()>();
v = newarray (java.lang.String)[43];
v[0] = "Task Usage: Main browse [browse-options] <destinations>";
v[1] = "Description: Display selected destination\'s messages.";
v[2] = "";
v[3] = "Browse Options:";
v[4] = "    --amqurl <url>                Set the broker URL to connect to. Default tcp://localhost:61616";
v[5] = "    --msgsel <msgsel,msglsel2>   Add to the search list messages matched by the query similar to";
v[6] = "                                  the messages selector format.";
v[7] = "    --factory <className>         Load className as the javax.jms.ConnectionFactory to use for creating connections.";
v[8] = "    --passwordFactory <className> Load className as the org.apache.activemq.console.command.PasswordFactory";
v[9] = "                                  for retrieving the password from a keystore.";
v[10] = "    --user <username>             Username to use for JMS connections.";
v[11] = "    --password <password>         Password to use for JMS connections.";
v[12] = "    -V<header|custom|body>        Predefined view that allows you to view the message header, custom";
v[13] = "                                  message header, or the message body.";
v[14] = "    --view <attr1>,<attr2>,...    Select the specific attribute of the message to view.";
v[15] = "    --version                     Display the version information.";
v[16] = "    -h,-?,--help                  Display the browse broker help information.";
v[17] = "";
v[18] = "Examples:";
v[19] = "    Main browse --amqurl tcp://localhost:61616 FOO.BAR";
v[20] = "        - Print the message header, custom message header, and message body of all messages in the";
v[21] = "          queue FOO.BAR";
v[22] = "";
v[23] = "    Main browse --amqurl tcp://localhost:61616 -Vheader,body queue:FOO.BAR";
v[24] = "        - Print only the message header and message body of all messages in the queue FOO.BAR";
v[25] = "";
v[26] = "    Main browse --amqurl tcp://localhost:61616 -Vheader --view custom:MyField queue:FOO.BAR";
v[27] = "        - Print the message header and the custom field \'MyField\' of all messages in the queue FOO.BAR";
v[28] = "";
v[29] = "    Main browse --amqurl tcp://localhost:61616 --msgsel \"JMSMessageID=\'*:10\',JMSPriority>5\" FOO.BAR";
v[30] = "        - Print all the message fields that has a JMSMessageID in the header field that matches the";
v[31] = "          wildcard *:10, and has a JMSPriority field > 5 in the queue FOO.BAR";
v[32] = "        * To use wildcard queries, the field must be a string and the query enclosed in \'\'";
v[33] = "";
v[34] = "    Main browse --amqurl tcp://localhost:61616 --user someUser --password somePass FOO.BAR";
v[35] = "        - Print the message header, custom message header, and message body of all messages in the";
v[36] = "          queue FOO.BAR, using someUser as the user name, and somePass as the password";
v[37] = "";
v[38] = "    Main browse --amqurl tcp://localhost:61616 --user someUser --password somePass --factory org.apache.activemq.ActiveMQConnectionFactory --passwordFactory org.apache.activemq.AMQPasswordFactory FOO.BAR";
v[39] = "        - Print the message header, custom message header, and message body of all messages in the";
v[40] = "          queue FOO.BAR, using someUser as the user name, org.apache.activemq.AMQFactorySubClass to create JMS connections,";
v[41] = "          and org.apache.activemq.console.command.DefaultPasswordFactory to turn somePass into the password to be used.";
v[42] = "";
v.<org.apache.activemq.console.command.AmqBrowseCommand: java.lang.String[] helpFile> = v;
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>(int)>(10);
v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List queryAddObjects> = v;
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>(int)>(10);
v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List querySubObjects> = v;
v = new java.util.HashSet;
specialinvoke v.<java.util.HashSet: void <init>(int)>(10);
v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set groupViews> = v;
v = new java.util.HashSet;
specialinvoke v.<java.util.HashSet: void <init>(int)>(10);
v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews> = v;
return;
}
public java.lang.String getName()
{
org.apache.activemq.console.command.AmqBrowseCommand v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
return "browse";
}
public java.lang.String getOneLineDescription()
{
org.apache.activemq.console.command.AmqBrowseCommand v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
return "Display selected messages in a specified destination.";
}
protected void runTask(java.util.List) throws java.lang.Exception
{
org.apache.activemq.console.command.AmqBrowseCommand v;
java.net.URI v, v;
boolean v, v, v, v;
org.apache.activemq.console.CommandContext v, v;
java.util.Set v, v;
java.lang.Exception v;
org.apache.activemq.command.ActiveMQDestination v;
org.apache.activemq.command.ActiveMQTopic v;
java.util.List v, v, v, v, v, v, v;
org.apache.activemq.command.ActiveMQQueue v, v;
int v, v, v;
java.lang.String v, v, v, v, v, v;
java.util.Iterator v;
java.lang.IllegalArgumentException v;
java.lang.Object v;
javax.jms.ConnectionFactory v, v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
v := @parameter: java.util.List;
label:
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("No JMS destination specified.");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
label:
return;
label:
v = virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: java.net.URI getBrokerUrl()>();
if v != null goto label;
v = <org.apache.activemq.ActiveMQConnectionFactory: java.lang.String DEFAULT_BROKER_BIND_URL>;
virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: void setBrokerUrl(java.lang.String)>(v);
label:
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("queue:");
if v == 0 goto label;
v = new org.apache.activemq.command.ActiveMQQueue;
v = "queue:";
v = virtualinvoke v.<java.lang.String: int length()>();
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(v);
specialinvoke v.<org.apache.activemq.command.ActiveMQQueue: void <init>(java.lang.String)>(v);
v = v;
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("topic:");
if v == 0 goto label;
v = new org.apache.activemq.command.ActiveMQTopic;
v = "topic:";
v = virtualinvoke v.<java.lang.String: int length()>();
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(v);
specialinvoke v.<org.apache.activemq.command.ActiveMQTopic: void <init>(java.lang.String)>(v);
v = v;
goto label;
label:
v = new org.apache.activemq.command.ActiveMQQueue;
specialinvoke v.<org.apache.activemq.command.ActiveMQQueue: void <init>(java.lang.String)>(v);
v = v;
label:
v = virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: javax.jms.ConnectionFactory getConnectionFactory()>();
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List queryAddObjects>;
v = staticinvoke <org.apache.activemq.console.util.AmqMessagesUtil: java.util.List getMessages(javax.jms.ConnectionFactory,javax.jms.Destination,java.util.List)>(v, v, v);
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List querySubObjects>;
v = interfaceinvoke v.<java.util.List: int size()>();
if v <= 0 goto label;
v = virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: javax.jms.ConnectionFactory getConnectionFactory()>();
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List querySubObjects>;
v = staticinvoke <org.apache.activemq.console.util.AmqMessagesUtil: java.util.List getMessages(javax.jms.ConnectionFactory,javax.jms.Destination,java.util.List)>(v, v, v);
interfaceinvoke v.<java.util.List: boolean removeAll(java.util.Collection)>(v);
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set groupViews>;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = staticinvoke <org.apache.activemq.console.util.AmqMessagesUtil: java.util.List filterMessagesView(java.util.List,java.util.Set,java.util.Set)>(v, v, v);
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printMessage(java.util.Collection)>(v);
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: java.net.URI getBrokerUrl()>();
v = virtualinvoke v.<java.net.URI: java.lang.String toString()>();
virtualinvoke v.<org.apache.activemq.console.command.AmqBrowseCommand: void handleException(java.lang.Exception,java.lang.String)>(v, v);
label:
return;
catch java.lang.Exception from label to label with label;
catch java.lang.Exception from label to label with label;
}
protected void handleOption(java.lang.String, java.util.List) throws java.lang.Exception
{
java.util.Set v, v, v, v, v, v, v, v, v;
java.util.StringTokenizer v, v, v;
java.lang.String v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.activemq.console.command.AmqBrowseCommand v;
boolean v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.activemq.console.CommandContext v, v, v, v;
java.util.List v, v, v;
int v, v, v;
java.lang.IllegalArgumentException v, v, v;
java.lang.Object v, v, v, v, v, v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
v := @parameter: java.lang.String;
v := @parameter: java.util.List;
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("--msgsel");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("Message selector not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = new java.util.StringTokenizer;
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
specialinvoke v.<java.util.StringTokenizer: void <init>(java.lang.String,java.lang.String)>(v, ",");
label:
v = virtualinvoke v.<java.util.StringTokenizer: boolean hasMoreTokens()>();
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List queryAddObjects>;
v = virtualinvoke v.<java.util.StringTokenizer: java.lang.String nextToken()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("--xmsgsel");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("Message selector not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = new java.util.StringTokenizer;
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
specialinvoke v.<java.util.StringTokenizer: void <init>(java.lang.String,java.lang.String)>(v, ",");
label:
v = virtualinvoke v.<java.util.StringTokenizer: boolean hasMoreTokens()>();
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.List querySubObjects>;
v = virtualinvoke v.<java.util.StringTokenizer: java.lang.String nextToken()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("--view");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("Attributes to view not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = new java.util.StringTokenizer;
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
specialinvoke v.<java.util.StringTokenizer: void <init>(java.lang.String,java.lang.String)>(v, ",");
label:
v = virtualinvoke v.<java.util.StringTokenizer: boolean hasMoreTokens()>();
if v == 0 goto label;
v = virtualinvoke v.<java.util.StringTokenizer: java.lang.String nextToken()>();
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("header:");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = "header:";
v = virtualinvoke v.<java.lang.String: int length()>();
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_HEADER_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("custom:");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = "custom:";
v = virtualinvoke v.<java.lang.String: int length()>();
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_CUSTOM_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("body:");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = "body:";
v = virtualinvoke v.<java.lang.String: int length()>();
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_BODY_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_HEADER_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_CUSTOM_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set queryViews>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("JMS_BODY_FIELD:\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-V");
if v == 0 goto label;
v = virtualinvoke v.<java.lang.String: java.lang.String substring(int)>(2);
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("header");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set groupViews>;
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>("JMS_HEADER_FIELD:");
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("custom");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set groupViews>;
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>("JMS_CUSTOM_FIELD:");
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("body");
if v == 0 goto label;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.util.Set groupViews>;
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>("JMS_BODY_FIELD:");
goto label;
label:
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Unknown group view: \u. Ignoring group view option.");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printInfo(java.lang.String)>(v);
goto label;
label:
specialinvoke v.<org.apache.activemq.console.command.AbstractAmqCommand: void handleOption(java.lang.String,java.util.List)>(v, v);
label:
return;
}
protected void printHelp()
{
java.lang.String[] v;
org.apache.activemq.console.command.AmqBrowseCommand v;
org.apache.activemq.console.CommandContext v;
v := @this: org.apache.activemq.console.command.AmqBrowseCommand;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: org.apache.activemq.console.CommandContext context>;
v = v.<org.apache.activemq.console.command.AmqBrowseCommand: java.lang.String[] helpFile>;
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printHelp(java.lang.String[])>(v);
return;
}
}