Controlling Event Publications
The BrokerAdminClient.getClientGroupCanPublishList method lets you obtain all of the event types that may be published or delivered by Broker clients belonging to a particular client group.
The following example illustrates how to get a client group's can-publish list:
. . .
int i;
String publish_events[];
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Get event types that may be published by clients in this group.*/
publish_events = c.getClientGroupCanPublishList(“myGroup”);
for(i = 0; i < publish_events.length; i++) {
System.out.println(publish_events[i]);
}
} catch (BrokerException ex) {
System.out.println("Error while getting can-publish list\n"+ex);
return;
}
. . .
Use the BrokerAdminClient.setClientGroupCanPublishList method to set the list of event types to which Broker clients belonging to a particular client group may subscribe.
The BrokerAdminClient.getClientGroupsWhichCanPublish method lets you obtain the names of all the client groups that can publish a particular event type.
The following example illustrates how to get client groups that can publish an event type:
int i;
String groups[];
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Get a list of all client groups that may publish a
* particular event type.
*/
groups = c.getClientGroupsWhichCanPublish(“myEventType”);
for(i = 0; i < groups.length; i++) {
System.out.println(groups[i]);
}
} catch (BrokerException ex) {
System.out.println("Error while getting client groups\n"+ex);
return;
}
. . .