com.ibm.j2ca.extension.eventmanagement
Interface EventStore


public interface EventStore

The EventStore interface is used to provide a common method for the Event Manager class to interact with an Event Store. The Event Store must be implemented by the Resource Adapter and passed to the EventManager constructor. Any implementation of eventStore must provide these services. 1) Uniqueness of event IDs. We must be able to track the progress of the event as it goes through the system, and be able to recover an individual event. 2) Ordering of events: The adapter developer is responsible for putting the events in the correct order in the getEvents() call. If the delivery type is "ORDERED" we will honor that order if the delivery type is "UNORDERED", we will not honor it. 3) The ability to mark events as "IN_PROGRESS", and eventually delete them. 4) The ability to retrieve the complete object from the EIS. Usually event objects are a subset of the complete object for publication.


Method Summary
 void commitWork()
          Commits the pending transaction
 void deleteEvent(Event event)
          This method deletes the specified event from the event store.
 java.util.ArrayList getEvents(int quantity, int eventStatus, java.lang.String[] typeFilter)
          This method queries the Event Store and retrieves up to quantity events of the specified type and returns the events in an ArrayList.
 java.lang.Object getObjectForEvent(Event event)
          This method returns a DataObject that contains all the business data we intend to publish.
 Event getSpecificEvent(java.lang.String eventId)
          Returns an event given a specific event ID.
 boolean implementsFiltering()
          If the eventStore can filter events by type in the getEvents call, this should return "true".
 boolean isTransactional()
          Is the EventStore transactional? If so, this method should return "true".
 void rollbackWork()
          rolls back any uncommited work.
 void updateEventStatus(Event event, int newstatus)
          This method updates the status of the specified event.
 

Method Detail

implementsFiltering

public boolean implementsFiltering()
If the eventStore can filter events by type in the getEvents call, this should return "true". Otherwise it should return "false".

Returns:

getEvents

public java.util.ArrayList getEvents(int quantity,
                                     int eventStatus,
                                     java.lang.String[] typeFilter)
                              throws javax.resource.ResourceException,
                                     javax.resource.spi.CommException
This method queries the Event Store and retrieves up to quantity events of the specified type and returns the events in an ArrayList.

Parameters:
quantity - indicates the maximum number of events to retreive.
typeFilter - an array of types that we're interested in. If this is null, return all events.
Returns:
anArray - ArrayList of events found in the event store
Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

deleteEvent

public void deleteEvent(Event event)
                 throws javax.resource.ResourceException,
                        javax.resource.spi.CommException
This method deletes the specified event from the event store.

Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

updateEventStatus

public void updateEventStatus(Event event,
                              int newstatus)
                       throws javax.resource.ResourceException,
                              javax.resource.spi.CommException
This method updates the status of the specified event. This method is expected to update the status in the underlying Event Store, not just in the Event instance.

Parameters:
newstatus - The new status value
Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

getSpecificEvent

public Event getSpecificEvent(java.lang.String eventId)
                       throws javax.resource.ResourceException,
                              javax.resource.spi.CommException
Returns an event given a specific event ID. This must be implemented because it is used in some recovery cases.

Parameters:
eventId - the eventID that specifies the desired event
Returns:
Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

getObjectForEvent

public java.lang.Object getObjectForEvent(Event event)
                                   throws javax.resource.ResourceException,
                                          javax.resource.spi.CommException
This method returns a DataObject that contains all the business data we intend to publish. For instance, if an event represented a "customer create", this should return the entire customer object. Usually this involves a RETRIEVE step to obtain the full object from the EIS.

Parameters:
event - the event that we wish to get the full object for
Returns:
Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

isTransactional

public boolean isTransactional()
Is the EventStore transactional? If so, this method should return "true". Otherwise, it should return "false".

Returns:
the transactionality of the event store

rollbackWork

public void rollbackWork()
                  throws javax.resource.ResourceException,
                         javax.resource.spi.CommException
rolls back any uncommited work.

Throws:
javax.resource.ResourceException
javax.resource.spi.CommException

commitWork

public void commitWork()
                throws javax.resource.ResourceException,
                       javax.resource.spi.CommException
Commits the pending transaction

Throws:
javax.resource.ResourceException
javax.resource.spi.CommException