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.2 11/10/05
    • Field Detail

      • UNKNOWN_NOTIFICATION_TYPE

        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

        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

        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

        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

        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

        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.

        • If the JMS message contains an update notification and the event does not match the selector then a remove notification will be returned.
        • If this JMS message contains a create notification and the event does not match the selector then the event will not be returned.

        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

        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

        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

        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

        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

        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.
IBM Business Process ManagerTM
Release 8