com.ibm.events.notification
Interface NotificationHelper


public interface NotificationHelper

The notification helper maps concepts related to the Common Event Infrastructure to concepts related to messaging. This enables event consumers to interact with the messaging infrastructure by using the messaging programming model rather than a Common Event Infrastructure interface.

Since:
5.1.0
Version:
1.22 6/8/04

Field Summary
static int CREATE_EVENT_NOTIFICATION_TYPE
          This field is used as a return type for the getNotificationType(javax.jms.Message) method.
static int UNKNOWN_NOTIFICATION_TYPE
          This field is used as a return type for the getNotificationType(javax.jms.Message) method.
 
Method Summary
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCreatedEvent(javax.jms.Message msg)
          This method is used to change a JMS message that contains a CREATE_EVENT_NOTIFICATION_TYPE type into an event.
 MessagePort[] getJmsQueues(java.lang.String eventGroup)
          This method is used to return the array of MessagePort objects that are associated with an event group.
 MessagePort getJmsTopic(java.lang.String eventGroup)
          This method is used to return the MessagePort object that is associated with an event group.
 ComponentMetaData getMetaData()
          This method is used to return the component metadata of the notification helper.
 int getNotificationType(javax.jms.Message msg)
          This method is used to return the type of notification that is contained in a JMS message.
 void setEventSelector(java.lang.String eventSelector)
          This method is used to set an event selector for filtering notifications.
 

Field Detail

UNKNOWN_NOTIFICATION_TYPE

public static final int UNKNOWN_NOTIFICATION_TYPE
This field is used as a return type for the getNotificationType(javax.jms.Message) method. It means that the passed notification is of an unknown type.

CREATE_EVENT_NOTIFICATION_TYPE

public static final int CREATE_EVENT_NOTIFICATION_TYPE
This field is used as a return type for the getNotificationType(javax.jms.Message) method. It means that the passed notification is a create event notification type.
Method Detail

getCreatedEvent

public org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCreatedEvent(javax.jms.Message msg)
                                                                      throws EventsException
This method is used to change a JMS message that contains a CREATE_EVENT_NOTIFICATION_TYPE type into an event. If the event matches the event selector for this notification helper, the event is returned to the caller. If the event does not match, then null is returned to the caller.
Parameters:
msg - The JMS message that contains a create event notification type.
Returns:
The event that was contained in the JMS message or null if the event is filtered out by the event selector.
Throws:
InvalidNotificationTypeException - If the JMS message does not contain a notification of type CREATE_EVENT_NOTIFICATION_TYPE.
EventsException - If the event selector that is set on the notification helper is not valid for filtering events.

setEventSelector

public void setEventSelector(java.lang.String eventSelector)
                      throws EventsException
This method is used to set an event selector for filtering notifications.
Parameters:
eventSelector - The XPath expression that is used to filter event notifications.
Throws:
InvalidEventSelectorException - If the event selector is not a valid XPath expression or if it is not a location path that starts with CommonBaseEvent.

getJmsQueues

public MessagePort[] getJmsQueues(java.lang.String eventGroup)
                           throws EventsException
This method is used to return the array of MessagePort objects that are associated with an event group.
Parameters:
eventGroup - The name of the event group in the configuration.
Returns:
An array of MessagePort objects that are wrapping the queue destinations and queue connection factories.
Throws:
EventGroupNotDefinedException - If the event group is not defined in the configuration.

getJmsTopic

public MessagePort getJmsTopic(java.lang.String eventGroup)
                        throws EventsException
This method is used to return the MessagePort object that is associated with an event group.
Parameters:
eventGroup - The name of the event group in the configuration.
Returns:
A MessagePort object that are wrapping the topic destination and topic connection factory.
Throws:
EventGroupNotDefinedException - If the event group is not defined in the configuration.

getMetaData

public ComponentMetaData getMetaData()
                              throws EventsException
This method is used to return the component metadata of the notification helper.
Returns:
The component metadata for the notification helper.
Throws:
EventsException - If an error occurs when loading the metadata.

getNotificationType

public int getNotificationType(javax.jms.Message msg)
                        throws EventsException
This method is used to return the type of notification that is contained in a JMS message.
Parameters:
msg - The JMS message that contains an event notification.
Returns:
An integer representation of the notification type. Constants are defined in the notification helper interface.
Throws:
EventsException - If the notification type cannot be determined.