Broker 10.5 | webMethods Broker Documentation | webMethods Broker Administration Java API Programmer’s Guide | Managing Broker Clients | Broker Client Administration | Getting Broker Client Information
 
Getting Broker Client Information
You can use the BrokerAdminClient.getClientInfoById method to obtain details about a particular Broker client, such as its state sharing limit and client group name. The information is returned as a BrokerClientInfo object, which contains the following Broker client information:
*Application name
*State sharing status and limit
*Client group affiliation
*Highest publish sequence number
*All sessions for the Broker client
A Broker client may share its client state, which means that several client applications can create BrokerClient objects using the same client identifier. All client application sessions using a particular client identifier will be described as an array of BrokerClientSession objects.
You can use the BrokerAdminClient.getClientInfosById method to obtain information about all Broker clients for a particular Broker.
The following example illustrates how to obtain the BrokerClientInfo object and extract the value of three fields. In this example, the client identifier is hard-coded. See Obtaining Broker Client Identifiers for information on discovering client identifiers at run time.
. . .
BrokerClientInfo inf;
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Get the information for a particular Broker client */
inf = c.getClientInfoById("A123");
System.out.println("Application name: "+inf.app_name);
System.out.println("Can share state: "+inf.can_share_state);
System.out.println("Client group: "+inf.client_group);
. . .
} catch (BrokerException ex) {
System.out.println("Error BrokerClientInfo\n"+ex);
return;
}
. . .