list_queues.jacl

 

###   
### list_queues.jacl   
###   
###   
###   
###   
###   
   
proc list_queues {cname nname sname} {   
   
   
###   
### set up globals   
###   
   
global AdminConfig   
global AdminControl   
global AdminApp   

    puts " " 

    puts "Getting JDCProviders for $cname $nname $sname..."
    puts " " 
    set JMSProviderIDs [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JMSProvider:/]

    if {[llength $JMSProviderIDs] == 0} {
        puts "Cannot find JDBC Provider for $cname $nname $sname"
        return
    }



    foreach JMSProviderID $JMSProviderIDs {

        set QueueName [$AdminConfig showAttribute $JMSProviderID name]


        if {$QueueName == "WebSphere MQ JMS Provider"} {

            puts " "
            puts "Queues for $QueueName"

            set xMQQueues [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JMSProvider:$QueueName/MQQueue:/]

            if {[llength $xMQQueues] == 0} {   
                puts "               "
                puts "No MQ queues configured for $cname $nname $sname $QueueName"   
                puts "               "
            }   


            foreach  xMQQueue $xMQQueues {
                set xyz [$AdminConfig showAttribute $xMQQueue name]
                puts "$xyz"
            }
        }

    }   
}
   
   
   
###   
### Main   
###   
   
   
if { !($argc == 3) } {   
   puts ""   
   puts "Usage:  "   
   puts " "   
   puts "wsadmin.sh -username system -password password -f list_JMSProvider.jacl cellname nodename servername" 
   puts ""   
   puts "For example:  "   
   puts " "   
   puts "wsadmin.sh -username was -password acme@ -f  list_JMSProvider.jacl hostnameNetwork hostname ops_1_1" 
} else {    
   set xcell        [lindex $argv 0]     
   set xnode        [lindex $argv 1]     
   set xserver      [lindex $argv 2]     
   list_queues $xcell $xnode $xserver    
}