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.26 2/10/05

Field Summary
static int CREATE_EVENT_NOTIFICATION_TYPE
          Constant for event notification types.
static int REMOVE_EVENT_NOTIFICATION_TYPE
          Constant for event notification types.
static int UNKNOWN_NOTIFICATION_TYPE
          Constant for event notification types.
static int UPDATE_EVENT_NOTIFICATION_TYPE
          Constant for event notification types.
 
Method Summary
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCreatedEvent(javax.jms.Message msg)
          Deprecated. This method is being replaced by getEventNotifications.
 EventNotification[] getEventNotifications(javax.jms.Message msg)
          This method is used to change a JMS message from the Common Event Infrastructure into an EventNotification array
 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)
          Deprecated. This method is no longer needed when using getEventNotifications.
 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
Constant for event notification types. It means that the passed notification is of an unknown type.

See Also:
Constant Field Values

CREATE_EVENT_NOTIFICATION_TYPE

public static final int CREATE_EVENT_NOTIFICATION_TYPE
Constant for event notification types. It means that the passed notification is a create event notification type.

See Also:
Constant Field Values

UPDATE_EVENT_NOTIFICATION_TYPE

public static final int UPDATE_EVENT_NOTIFICATION_TYPE
Constant for event notification types. It means that the passed notification is an update event notification type.

See Also:
Constant Field Values

REMOVE_EVENT_NOTIFICATION_TYPE

public static final int REMOVE_EVENT_NOTIFICATION_TYPE
Constant for event notification types. It means that the passed notification is a remove event notification type.

See Also:
Constant Field Values
Method Detail

getCreatedEvent

public org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCreatedEvent(javax.jms.Message msg)
                                                                      throws EventsException
Deprecated. This method is being replaced by getEventNotifications.

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.

getEventNotifications

public EventNotification[] getEventNotifications(javax.jms.Message msg)
                                          throws EventsException
This method is used to change a JMS message from the Common Event Infrastructure into an EventNotification array

If the JMS message is a create or update notification, the contained event will be evaluated against an event selector if set.

Parameters:
msg - The JMS message that contains a event notification.
Returns:
An array of event notification objects, each containing the type of notification and either the global instance ID of the event or the event itself depending on the type of notification.
Throws:
EventsException - If notification helper fails to decode the JMS message.

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.
EventsException

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.
EventsException

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.
EventsException

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
Deprecated. This method is no longer needed when using getEventNotifications.

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.