IBM WebSphere Application ServerTM
Release 8

com.ibm.events.datastore
Interface DataStoreLocal

All Superinterfaces:
javax.ejb.EJBLocalObject

public interface DataStoreLocal
extends javax.ejb.EJBLocalObject

Local interface for the data store enterprise bean.

This interface defines the methods that are used to store and access events in the data store. A default data store is provided that implements this interface. An application must implement this interface to provide its own data store.

This interface uses the following security roles:

Since:
5.1.0
Version:
1.2 10/6/13

Method Summary
 void createEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
          Creates a new event in the data store.
 void createEvents(EventCreationRequest[] events)
          Creates an array of new event in the data store.
 boolean eventExists(java.lang.String eventSelector)
          Determines if events exist that belong to the specified event selector.
 com.ibm.events.ComponentMetaData getMetaData()
          Returns the component metadata of the data store enterprise bean
 void purgeEvents(java.lang.String[] globalInstanceIds)
          Deletes events from the data store.
 int purgeEvents(java.lang.String eventSelector, int transactionSize)
          Deletes events from the data store in a single call.
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent queryEventByGlobalInstanceId(java.lang.String globalInstanceId)
          Retrieves an event by the globalInstanceId.
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEvents(java.lang.String eventSelector, boolean ascendingOrder)
          Retrieves events that belong to the specified event selector.
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEvents(java.lang.String eventSelector, boolean ascendingOrder, int maximumNumber)
          Retrieves events that belong to the specified event selector.
 org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEventsByAssociation(java.lang.String associationType, java.lang.String globalInstanceId)
          Retrieve events that are related to specific global instance ID.
 java.lang.String[] queryGlobalInstanceIds(java.lang.String eventSelector, int maximumNumber)
          Retrieves the global instance IDs of events that belong to the specified event selector.
 EventUpdateResponse[] updateEvents(EventUpdateRequest[] eventUpdateRequests)
          Updates events that are persisted in the data store.
 
Methods inherited from interface javax.ejb.EJBLocalObject
getEJBLocalHome, getPrimaryKey, isIdentical, remove
 

Method Detail

getMetaData

com.ibm.events.ComponentMetaData getMetaData()
                                             throws DataStoreException
Returns the component metadata of the data store enterprise bean

Returns:
The component metadata for the data store.
Throws:
DataStoreException - If the data store fails to perform the requested action.

createEvent

void createEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
                 throws DuplicateGlobalInstanceIdException,
                        DataStoreException
Creates a new event in the data store.

It is recommended that the call be configured for REQUIRES transaction.

The eventCreator or the eventAdminstrator security role is required for this method.

Parameters:
event - The event to add to the data store.
Throws:
DuplicateGlobalInstanceIdException - If an event already exists in the data store that contains the same global instance ID as the passed event.
DataStoreException - If the data store fails to perform the requested action.

createEvents

void createEvents(EventCreationRequest[] events)
                  throws DuplicateGlobalInstanceIdException,
                         DataStoreException
Creates an array of new event in the data store.

It is recommended that the call be configured for REQUIRES transaction.

The eventCreator or the eventAdminstrator security role is required for this method.

Parameters:
events - The array of events to add to the data store.
Throws:
DuplicateGlobalInstanceIdException - If an event already exists in the data store that contains the same global instance ID as the passed event.
DataStoreException - If the data store fails to perform the requested action.

eventExists

boolean eventExists(java.lang.String eventSelector)
                    throws DataStoreException
Determines if events exist that belong to the specified event selector.

It is recommended that the call be configured for REQUIRES transaction.

The eventUpdater, eventConsumer, or eventAdminstrator security role is required for this method.

Parameters:
eventSelector - The XPath representation of the event selector. This value cannot be null.
Returns:
true if an event exists that matches the event selector. false otherwise.
Throws:
DataStoreException - If the data store fails to perform the requested action.

purgeEvents

void purgeEvents(java.lang.String[] globalInstanceIds)
                 throws DataStoreException
Deletes events from the data store.

It is recommended that the call be configured for REQUIRESNEW transaction.

The eventAdminstrator security role is required for this method.

Parameters:
globalInstanceIds - An array of global instance IDs of the events that are to be purged from the data store.
Throws:
DataStoreException - If the data store fails to perform the requested action.

purgeEvents

int purgeEvents(java.lang.String eventSelector,
                int transactionSize)
                throws DataStoreException
Deletes events from the data store in a single call.

It is recommended that the call be configured for REQUIRESNEW transaction.

The eventAdminstrator security role is required for this method.

Parameters:
eventSelector - The XPath representation of the event selector. This value cannot be null.
transactionSize - The number of events to delete in a single database transaction.
Returns:
The number of events that were purged.
Throws:
DataStoreException - If the data store fails to perform the requested action.

queryEventByGlobalInstanceId

org.eclipse.hyades.logging.events.cbe.CommonBaseEvent queryEventByGlobalInstanceId(java.lang.String globalInstanceId)
                                                                                   throws DataStoreException
Retrieves an event by the globalInstanceId.

It is recommended that the call be configured for REQUIRES transaction.

The eventConsumer, eventUpdater, or eventAdminstrator security role is required for this method.

Parameters:
globalInstanceId - The global instance ID of the event that is to be returned. This value cannot be null.
Returns:
An event instance or null if an event that contains the specified global instance ID does not exist.
Throws:
DataStoreException - If the data store fails to perform the requested action.

queryEvents

org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEvents(java.lang.String eventSelector,
                                                                    boolean ascendingOrder)
                                                                    throws DataStoreException
Retrieves events that belong to the specified event selector.

It is recommended that the call be configured for REQUIRES transaction.

The eventConsumer, eventUpdater, or eventAdminstrator security role is required for this method.

Parameters:
eventSelector - The XPath representation of the event selector. This value cannot be null.
ascendingOrder - The order (ascending or descending) in which events are arranged according to the creation time of the event.
Returns:
An array of all events that match the query. If no events match the query, an empty array is returned.
Throws:
DataStoreException - If the data store fails to perform the requested action.

queryEvents

org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEvents(java.lang.String eventSelector,
                                                                    boolean ascendingOrder,
                                                                    int maximumNumber)
                                                                    throws DataStoreException
Retrieves events that belong to the specified event selector.

It is recommended that the call be configured for REQUIRES transaction.

The eventConsumer, eventUpdater, or eventAdminstrator security role is required for this method.

Parameters:
eventSelector - The XPath representation of the event selector. This value cannot be null.
ascendingOrder - The order (ascending or descending) in which events are arranged according to the creation time of the event.
maximumNumber - The maximum number of events to be returned from the event query.
Returns:
An array of all events that match the query. If no events match the query, an empty array is returned.
Throws:
DataStoreException - If the data store fails to perform the requested action.

queryEventsByAssociation

org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] queryEventsByAssociation(java.lang.String associationType,
                                                                                 java.lang.String globalInstanceId)
                                                                                 throws DataStoreException
Retrieve events that are related to specific global instance ID.

It is recommended that the call be configured for REQUIRES transaction.

The eventConsumer, eventUpdater, or eventAdminstrator security role is required for this method.

Parameters:
associationType - The type of the association. This value cannot be null.
globalInstanceId - The global instance ID of the event that other events are associated with. This value cannot be null.
Returns:
An array of all events that match the query. If no events match the query, an empty array is returned.
Throws:
DataStoreException - If the data store fails to perform the requested action.

queryGlobalInstanceIds

java.lang.String[] queryGlobalInstanceIds(java.lang.String eventSelector,
                                          int maximumNumber)
                                          throws DataStoreException
Retrieves the global instance IDs of events that belong to the specified event selector.

It is recommended that the call be configured for REQUIRES transaction.

The eventConsumer, eventUpdater, or eventAdminstrator security role is required for this method.

Parameters:
eventSelector - The XPath representation of the event selector. This value cannot be null.
maximumNumber - The maximum number of global instance IDs to be returned from the query.
Returns:
An array of global instance IDs for all the events that match the query. If no events match the query, an empty array is returned.
Throws:
DataStoreException - If the data store fails to perform the requested action.

updateEvents

EventUpdateResponse[] updateEvents(EventUpdateRequest[] eventUpdateRequests)
                                   throws DataStoreException
Updates events that are persisted in the data store.

It is recommended that the call be configure for REQUIRES transaction.

The eventUpdater or eventAdminstrator security role is required for this method.

Parameters:
eventUpdateRequests - An array of event update requests. There will be one update request per event.
Returns:
An array of event update responses, one for each event that was update because of this method.
Throws:
EventDoesNotExistException - If any of the request specify an event that does not exist in the data store.
DataStoreException - If the data store fails to perform the requested action.
SeverityAlreadySetException - If one of the change requests tries to modify the value of severity. It is only valid to set an unset severity.
ExtendedDataElementUpdateException - If the parent extended data element does not exist

IBM WebSphere Application ServerTM
Release 8