org.rhq.enterprise.server.event
Class EventManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.event.EventManagerBean
All Implemented Interfaces:
EventManagerLocal, EventManagerRemote

public class EventManagerBean
extends Object
implements EventManagerLocal, EventManagerRemote

Manager for Handling of Events.

Author:
Heiko W. Rupp, Ian Springer, Joseph Marques

Constructor Summary
EventManagerBean()
           
 
Method Summary
 void addEventData(Map<org.rhq.core.domain.event.EventSource,Set<org.rhq.core.domain.event.Event>> events)
          Add the passed events to the database
 int deleteEventsForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, List<Integer> eventIds)
           
 void deleteEventSourcesForDefinition(org.rhq.core.domain.event.EventDefinition def)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.composite.EventComposite> findEventComposites(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, long begin, long end, org.rhq.core.domain.event.EventSeverity[] severities, String source, String detail, org.rhq.core.domain.util.PageControl pc)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.composite.EventComposite> findEventCompositesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.EventCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.Event> findEventsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.EventCriteria criteria)
           
 int[] getEventCounts(org.rhq.core.domain.auth.Subject subject, int resourceId, long begin, long end, int numBuckets)
          Retrieve the count of events for the given resource in the time between begin and end, nicely separated in numBuckets.
 Map<org.rhq.core.domain.event.EventSeverity,Integer> getEventCountsBySeverity(org.rhq.core.domain.auth.Subject subject, int resourceId, long startDate, long endDate)
           
 Map<org.rhq.core.domain.event.EventSeverity,Integer> getEventCountsBySeverityForGroup(org.rhq.core.domain.auth.Subject subject, int groupId, long startDate, long endDate)
           
 org.rhq.core.domain.event.composite.EventComposite getEventDetailForEventId(org.rhq.core.domain.auth.Subject subject, int eventId)
          Obtain detail information about the passed event
 org.rhq.core.domain.event.EventSeverity[] getSeverityBuckets(org.rhq.core.domain.auth.Subject subject, int resourceId, long begin, long end, int numBuckets)
           
 org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsByContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, long begin, long end, int bucketCount)
           
 org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int resourceTypeId, long begin, long end, int numBuckets)
           
 org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsForCompGroup(org.rhq.core.domain.auth.Subject subject, int resourceGroupId, long begin, long end, int numBuckets)
           
 int purgeEventData(Date deleteUpToTime)
          Deletes event data older than the specified time.
 int purgeEventsForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventManagerBean

public EventManagerBean()
Method Detail

addEventData

public void addEventData(Map<org.rhq.core.domain.event.EventSource,Set<org.rhq.core.domain.event.Event>> events)
Description copied from interface: EventManagerLocal
Add the passed events to the database

Specified by:
addEventData in interface EventManagerLocal
Parameters:
events - a set of events.

purgeEventData

public int purgeEventData(Date deleteUpToTime)
                   throws SQLException
Description copied from interface: EventManagerLocal
Deletes event data older than the specified time.

Specified by:
purgeEventData in interface EventManagerLocal
Parameters:
deleteUpToTime - event data older than this time will be deleted
Returns:
number of deleted Events
Throws:
SQLException

getEventCounts

public int[] getEventCounts(org.rhq.core.domain.auth.Subject subject,
                            int resourceId,
                            long begin,
                            long end,
                            int numBuckets)
Description copied from interface: EventManagerLocal
Retrieve the count of events for the given resource in the time between begin and end, nicely separated in numBuckets.

Specified by:
getEventCounts in interface EventManagerLocal
Parameters:
subject - Subject of the caller
resourceId - Id of the resource we want to know the data
begin - Begin date
end - End date
numBuckets - Number of buckets to distribute into.
Returns:

getEventDetailForEventId

public org.rhq.core.domain.event.composite.EventComposite getEventDetailForEventId(org.rhq.core.domain.auth.Subject subject,
                                                                                   int eventId)
                                                                            throws EventException
Description copied from interface: EventManagerLocal
Obtain detail information about the passed event

Specified by:
getEventDetailForEventId in interface EventManagerLocal
Parameters:
subject - Subject of the caller
eventId - ID of the desired event.
Returns:
Throws:
EventException

deleteEventSourcesForDefinition

public void deleteEventSourcesForDefinition(org.rhq.core.domain.event.EventDefinition def)
Specified by:
deleteEventSourcesForDefinition in interface EventManagerLocal

deleteEventsForContext

public int deleteEventsForContext(org.rhq.core.domain.auth.Subject subject,
                                  org.rhq.core.domain.common.EntityContext context,
                                  List<Integer> eventIds)
Specified by:
deleteEventsForContext in interface EventManagerLocal

purgeEventsForContext

public int purgeEventsForContext(org.rhq.core.domain.auth.Subject subject,
                                 org.rhq.core.domain.common.EntityContext context)
Specified by:
purgeEventsForContext in interface EventManagerLocal

getEventCountsBySeverity

public Map<org.rhq.core.domain.event.EventSeverity,Integer> getEventCountsBySeverity(org.rhq.core.domain.auth.Subject subject,
                                                                                     int resourceId,
                                                                                     long startDate,
                                                                                     long endDate)
Specified by:
getEventCountsBySeverity in interface EventManagerLocal

getEventCountsBySeverityForGroup

public Map<org.rhq.core.domain.event.EventSeverity,Integer> getEventCountsBySeverityForGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                             int groupId,
                                                                                             long startDate,
                                                                                             long endDate)
Specified by:
getEventCountsBySeverityForGroup in interface EventManagerLocal

getSeverityBucketsByContext

public org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsByContext(org.rhq.core.domain.auth.Subject subject,
                                                                             org.rhq.core.domain.common.EntityContext context,
                                                                             long begin,
                                                                             long end,
                                                                             int bucketCount)
Specified by:
getSeverityBucketsByContext in interface EventManagerLocal

findEventComposites

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.composite.EventComposite> findEventComposites(org.rhq.core.domain.auth.Subject subject,
                                                                                                                 org.rhq.core.domain.common.EntityContext context,
                                                                                                                 long begin,
                                                                                                                 long end,
                                                                                                                 org.rhq.core.domain.event.EventSeverity[] severities,
                                                                                                                 String source,
                                                                                                                 String detail,
                                                                                                                 org.rhq.core.domain.util.PageControl pc)
Specified by:
findEventComposites in interface EventManagerLocal

findEventCompositesByCriteria

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.composite.EventComposite> findEventCompositesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                           org.rhq.core.domain.criteria.EventCriteria criteria)
Specified by:
findEventCompositesByCriteria in interface EventManagerLocal

findEventsByCriteria

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.event.Event> findEventsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                               org.rhq.core.domain.criteria.EventCriteria criteria)
Specified by:
findEventsByCriteria in interface EventManagerLocal
Specified by:
findEventsByCriteria in interface EventManagerRemote

getSeverityBuckets

public org.rhq.core.domain.event.EventSeverity[] getSeverityBuckets(org.rhq.core.domain.auth.Subject subject,
                                                                    int resourceId,
                                                                    long begin,
                                                                    long end,
                                                                    int numBuckets)
Specified by:
getSeverityBuckets in interface EventManagerLocal
Specified by:
getSeverityBuckets in interface EventManagerRemote

getSeverityBucketsForAutoGroup

public org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                int parentResourceId,
                                                                                int resourceTypeId,
                                                                                long begin,
                                                                                long end,
                                                                                int numBuckets)
Specified by:
getSeverityBucketsForAutoGroup in interface EventManagerLocal
Specified by:
getSeverityBucketsForAutoGroup in interface EventManagerRemote

getSeverityBucketsForCompGroup

public org.rhq.core.domain.event.EventSeverity[] getSeverityBucketsForCompGroup(org.rhq.core.domain.auth.Subject subject,
                                                                                int resourceGroupId,
                                                                                long begin,
                                                                                long end,
                                                                                int numBuckets)
Specified by:
getSeverityBucketsForCompGroup in interface EventManagerLocal
Specified by:
getSeverityBucketsForCompGroup in interface EventManagerRemote


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.