Broker 10.5 | webMethods Broker Documentation | webMethods Broker Administration Java API Programmer’s Guide | Managing Broker Event Types | Getting Event Type Statistics
 
Getting Event Type Statistics
The BrokerAdminClient.getEventTypeStats method lets your client application obtain statistics for a particular event type definition. The statistics are returned as fields within a BrokerEvent.
After you have obtained the BrokerEvent containing the statistics, you can retrieve each field using the BrokerEvent.get<type>Field method, described in the webMethods Broker Client Java API Programmer’s Guide . The version of the get<type>Field method to be used will depend on the data type of field you are retrieving. The following example illustrates how to obtain a BrokerEvent containing an event type definition's statistics and extract the value of two fields.
. . .
BrokerDate create_time;
BrokerDate update_time;
BrokerEvent e;
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
 
/* Get the BrokerEvent containing an event type’s statistics */
e = c.getEventTypeStats(“myEventType”);
/* Get the time and date the event type definition was created */
create_time = e.getDateField( “createTime”);
/* Get the time and date the event type definition was modified */
update_time = e.getDateField( “updateTime”);
} catch (BrokerException ex) {
System.out.println("Error while getting the event type statistics\n"+ex);
return;
}
. . .