Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.events.server.session
Class AlertManagerEJBImpl

java.lang.Object
  extended by org.hyperic.hq.events.server.session.SessionBase
      extended by org.hyperic.hq.events.server.session.AlertManagerEJBImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class AlertManagerEJBImpl
extends SessionBase
implements javax.ejb.SessionBean

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hyperic.hq.events.server.session.SessionBase
DATASOURCE, log, SEQUENCE_INTERVAL
 
Constructor Summary
AlertManagerEJBImpl()
           
 
Method Summary
 void addConditionLogs(Alert alert, AlertConditionLogValue[] logs)
           
 Alert createAlert(AlertDefinition def, long ctime)
          Create a new alert.
 int deleteAlerts(AuthzSubject subj, AlertDefinition ad)
          Remove alerts for an alert definition
 int deleteAlerts(AuthzSubject subj, AppdefEntityID id)
          Remove alerts for an appdef entity
 void deleteAlerts(java.lang.Integer[] ids)
          Remove alerts
 int deleteAlerts(long begin, long end)
          Remove alerts for a range of time
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 Alert findAlertById(java.lang.Integer id)
          Find an alert pojo by ID
 PageList findAlerts(AuthzSubject subj, AppdefEntityID id, long begin, long end, PageControl pc)
          Get a collection of alerts for an AppdefEntityID and time range
 PageList findAlerts(AuthzSubject subj, AppdefEntityID id, PageControl pc)
          Get a collection of alerts for an AppdefEntityID
 java.util.List findAlerts(AuthzSubject subj, int count, int priority, long timeRange, long endTime, java.util.List includes)
          Search alerts given a set of criteria
 java.util.List findAlerts(java.lang.Integer subj, int priority, long timeRange, long endTime, boolean inEsc, boolean notFixed, java.lang.Integer groupId, java.lang.Integer alertDefId, PageInfo pageInfo)
          A more optimized look up which includes the permission checking
 java.util.List findAlerts(java.lang.Integer subj, int priority, long timeRange, long endTime, boolean inEsc, boolean notFixed, java.lang.Integer groupId, PageInfo pageInfo)
          A more optimized look up which includes the permission checking
 PageList findAllAlerts()
          Get a collection of all alerts
 java.util.Map findAllLastUnfixed()
          Find all last unfixed alerts
 java.util.List findEscalatables(AuthzSubject subj, int count, int priority, long timeRange, long endTime, java.util.List includes)
          Find escalatables for a resource in a given time range.
 Alert findLastByDefinition(java.lang.Integer id)
          Find the last alert by definition ID
 java.util.Map findLastByResource(AuthzSubject subj, Resource r, boolean includeDescendants, boolean fixed)
          Find the last alerts for the given resource
 Alert findLastFixedByDefinition(AlertDefinition def)
          Find the last alert by definition ID
 Alert findLastUnfixedByDefinition(AuthzSubject subj, java.lang.Integer id)
          Find the last unfixed alert by definition ID
 void fireAlert(AlertConditionsSatisfiedZEvent event)
          Processes AlertConditionSatisfiedZEvent that indicate that an alert should be created To minimize StaleStateExceptions, this method should only be called once in one transaction.
 Alert getAlertById(java.lang.Integer id)
           
 java.lang.Number getAlertCount()
          Get the # of alerts within HQ inventory
 int[] getAlertCount(AppdefEntityID[] ids)
          Get the number of alerts for the given array of AppdefEntityID's
 AlertValue getById(java.lang.Integer id)
          Find an alert by ID
 java.lang.String getLongReason(Alert alert)
          Get the long reason for an alert
static org.hyperic.hq.events.shared.AlertManagerLocal getOne()
           
 java.lang.String getShortReason(Alert alert)
          Get the long reason for an alert
 int getUnfixedCount(java.lang.Integer subj, long timeRange, long endTime, java.lang.Integer groupId)
          A more optimized look up which includes the permission checking
 void handleSubjectRemoval(AuthzSubject subject)
           
 void logActionDetail(Alert alert, Action action, java.lang.String detail, AuthzSubject subject)
          Log the details of an action's execution
 void setAlertFixed(Alert alert)
          Simply mark an alert object as fixed
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 
Methods inherited from class org.hyperic.hq.events.server.session.SessionBase
canCreateAlertDefinition, canCreateEscalation, canCreateResourceTypeAlertDefinitionTemplate, canDeleteAlertDefinition, canDeleteResourceTypeAlertDefinitionTemplate, canFixAcknowledgeAlerts, canFixAcknowledgeAlerts, canModifyAlertDefinition, canModifyEscalation, canModifyResourceTypeAlertDefinitionTemplate, canRemoveEscalation, canViewAlertDefinition, canViewEscalation, canViewResourceTypeAlertDefinitionTemplate, describeCondition, findResource, getAppdefEntityID, getInitialContext, getNextId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertManagerEJBImpl

public AlertManagerEJBImpl()
Method Detail

createAlert

public Alert createAlert(AlertDefinition def,
                         long ctime)
Create a new alert.

Parameters:
def - The alert definition.
ctime - The alert creation time.

setAlertFixed

public void setAlertFixed(Alert alert)
Simply mark an alert object as fixed


logActionDetail

public void logActionDetail(Alert alert,
                            Action action,
                            java.lang.String detail,
                            AuthzSubject subject)
Log the details of an action's execution


addConditionLogs

public void addConditionLogs(Alert alert,
                             AlertConditionLogValue[] logs)

deleteAlerts

public void deleteAlerts(java.lang.Integer[] ids)
Remove alerts


deleteAlerts

public int deleteAlerts(AuthzSubject subj,
                        AppdefEntityID id)
                 throws PermissionException
Remove alerts for an appdef entity

Throws:
PermissionException

deleteAlerts

public int deleteAlerts(AuthzSubject subj,
                        AlertDefinition ad)
                 throws javax.ejb.RemoveException,
                        PermissionException
Remove alerts for an alert definition

Throws:
PermissionException
javax.ejb.RemoveException

deleteAlerts

public int deleteAlerts(long begin,
                        long end)
Remove alerts for a range of time


getById

public AlertValue getById(java.lang.Integer id)
Find an alert by ID


getAlertById

public Alert getAlertById(java.lang.Integer id)

findAlertById

public Alert findAlertById(java.lang.Integer id)
Find an alert pojo by ID


findLastUnfixedByDefinition

public Alert findLastUnfixedByDefinition(AuthzSubject subj,
                                         java.lang.Integer id)
Find the last unfixed alert by definition ID


findAllLastUnfixed

public java.util.Map findAllLastUnfixed()
Find all last unfixed alerts


findLastByResource

public java.util.Map findLastByResource(AuthzSubject subj,
                                        Resource r,
                                        boolean includeDescendants,
                                        boolean fixed)
Find the last alerts for the given resource


findLastByDefinition

public Alert findLastByDefinition(java.lang.Integer id)
Find the last alert by definition ID

Throws:
PermissionException

findLastFixedByDefinition

public Alert findLastFixedByDefinition(AlertDefinition def)
Find the last alert by definition ID

Throws:
PermissionException

getAlertCount

public java.lang.Number getAlertCount()
Get the # of alerts within HQ inventory


getAlertCount

public int[] getAlertCount(AppdefEntityID[] ids)
Get the number of alerts for the given array of AppdefEntityID's


fireAlert

public void fireAlert(AlertConditionsSatisfiedZEvent event)
Processes AlertConditionSatisfiedZEvent that indicate that an alert should be created To minimize StaleStateExceptions, this method should only be called once in one transaction.


findAllAlerts

public PageList findAllAlerts()
Get a collection of all alerts


findAlerts

public PageList findAlerts(AuthzSubject subj,
                           AppdefEntityID id,
                           PageControl pc)
                    throws PermissionException
Get a collection of alerts for an AppdefEntityID

Throws:
PermissionException

findAlerts

public PageList findAlerts(AuthzSubject subj,
                           AppdefEntityID id,
                           long begin,
                           long end,
                           PageControl pc)
                    throws PermissionException
Get a collection of alerts for an AppdefEntityID and time range

Throws:
PermissionException

findAlerts

public java.util.List findAlerts(java.lang.Integer subj,
                                 int priority,
                                 long timeRange,
                                 long endTime,
                                 boolean inEsc,
                                 boolean notFixed,
                                 java.lang.Integer groupId,
                                 PageInfo pageInfo)
                          throws PermissionException
A more optimized look up which includes the permission checking

Throws:
PermissionException

findAlerts

public java.util.List findAlerts(java.lang.Integer subj,
                                 int priority,
                                 long timeRange,
                                 long endTime,
                                 boolean inEsc,
                                 boolean notFixed,
                                 java.lang.Integer groupId,
                                 java.lang.Integer alertDefId,
                                 PageInfo pageInfo)
                          throws PermissionException
A more optimized look up which includes the permission checking

Returns:
List of Alerts
Throws:
PermissionException

findAlerts

public java.util.List findAlerts(AuthzSubject subj,
                                 int count,
                                 int priority,
                                 long timeRange,
                                 long endTime,
                                 java.util.List includes)
                          throws PermissionException
Search alerts given a set of criteria

Parameters:
timeRange - the amount of milliseconds prior to current that the alerts will be contained in. e.g. the beginning of the time range will be (current - timeRante)
page - TODO
includes - List of AppdefEntityIDs to filter, may be null for all.
Throws:
PermissionException

findEscalatables

public java.util.List findEscalatables(AuthzSubject subj,
                                       int count,
                                       int priority,
                                       long timeRange,
                                       long endTime,
                                       java.util.List includes)
                                throws PermissionException
Find escalatables for a resource in a given time range.

Throws:
PermissionException
See Also:
findAlerts(AuthzSubject, int, int, long, long, List)

getUnfixedCount

public int getUnfixedCount(java.lang.Integer subj,
                           long timeRange,
                           long endTime,
                           java.lang.Integer groupId)
                    throws PermissionException
A more optimized look up which includes the permission checking

Throws:
PermissionException

getShortReason

public java.lang.String getShortReason(Alert alert)
Get the long reason for an alert


getLongReason

public java.lang.String getLongReason(Alert alert)
Get the long reason for an alert


handleSubjectRemoval

public void handleSubjectRemoval(AuthzSubject subject)

getOne

public static org.hyperic.hq.events.shared.AlertManagerLocal getOne()

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.