Viewing Currently Set Filters on Queue Browser
Use the getFilters method to view the current filter set on the client queue lock. The filters are returned as BrokerFilterDescriptor objects.
The following example illustrates how to view set filters:
BrokerAdminClient admin = null;
BrokerQueueBrowser browser = null;
BrokerFilterDescriptor[] inFilters = null;
BrokerFilterDescriptor[] outFilters = null;
//Create a Broker admin client
try {
admin = new BrokerAdminClient(broker_host,
broker_name,
null,
"admin",
"QueueBrowser-UNLOCKED",
null);
} catch(BrokerException ex) {
System.out.println("Failed to create admin client.");
return;
}
. . .
//Create a queue browser in locked or unlocked mode
...
// Set filters on browser
browser.setFilters(inFilters);
. . .
//Various browse operations
. . .
//Get filters applied on browser
try {
outFilters = browser.getFilters();
} catch(BrokerException ex) {
System.out.println("Failed to get filters.");
}
. . .
//Various browse operations
. . .
//Close the queue browser
try {
browser.closeQueueBrowser();
} catch(BrokerException ex) {
System.out.println("Failed to close client queue browser.");
return;
}