WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Querying events by global instance identifier

Events can be queried by a primary key.

Why and when to perform this task

The Common Base Event specification defines a globalInstanceId event property that can be used as a primary key for event identification. The content of this property is a globally unique identifier that is generated either by the application or by the emitter. Although the Common Base Event specification defines the globalInstanceId property as optional, the event emitter automatically assigns an identifier to any event that does not already have an identifier.

You can retrieve a specific single event from the event server by querying with the globalInstanceId property of the event that you want to retrieve. This query can be useful for testing purposes (to confirm that events are stored in the event database), or to retrieve an event associated with one that was received previously.

To query an event by the global instance identifier, use the queryEventByGlobalInstanceId method of the event access bean.

Steps for this task

  1. Optional: Create an event access bean.
  2. Call the queryEventByGlobalInstanceId(String) method of the EventAccess bean, specifying the global instance identifier of the event that you want to retrieve.
    CommonBaseEvent event = eventAccess.queryEventByGlobalInstanceId(eventId);
    The returned object is the event with the specified global instance identifier. If there is no matching event in the persistent data store, the returned object is null.

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_adminCBEB_queryByID.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)