Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.galerts.server.session
Class GalertManagerEJBImpl

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

public class GalertManagerEJBImpl
extends java.lang.Object
implements javax.ejb.SessionBean

See Also:
Serialized Form

Constructor Summary
GalertManagerEJBImpl()
           
 
Method Summary
 ExecutionStrategyInfo addPartition(GalertDef def, GalertDefPartition partition, ExecutionStrategyTypeInfo stratType, ConfigResponse stratConfig)
           
 void configureTriggers(GalertDef def, GalertDefPartition partition, java.util.List triggerInfos, java.util.List configs)
          Configure triggers for a given partition.
 void createActionLog(GalertLog alert, java.lang.String detail, Action action, AuthzSubject subject)
           
 GalertDef createAlertDef(AuthzSubject subject, java.lang.String name, java.lang.String description, AlertSeverity severity, boolean enabled, ResourceGroup group)
           
 GalertLog createAlertLog(GalertDef def, ExecutionReason reason)
          Save the alert log and associated auxillary log information to the DB.
 void deleteAlertLog(GalertLog log)
           
 void deleteAlertLogs(ResourceGroup group)
           
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 void enable(GalertDef def, boolean enable)
          Enable/disable an alert def
 int[] fillAlertCount(AuthzSubject subj, AppdefEntityID[] ids, int[] counts)
          Get the number of alerts for the given array of AppdefEntityID's
 java.util.List findAlertDefs(AuthzSubject subj, AlertSeverity minSeverity, java.lang.Boolean enabled, PageInfo pInfo)
          Find all group alert definitions.
 PageList findAlertDefs(ResourceGroup g, PageControl pc)
          Find all alert definitions for the specified group
 GalertLog findAlertLog(java.lang.Integer id)
           
 java.util.List findAlertLogs(GalertDef def)
           
 java.util.List findAlertLogs(ResourceGroup group)
           
 PageList findAlertLogsByTimeWindow(ResourceGroup group, long begin, long end, PageControl pc)
           
 java.util.List findAlerts(AuthzSubject subj, AlertSeverity severity, long timeRange, long endTime, boolean inEsc, boolean notFixed, java.lang.Integer groupId, java.lang.Integer galertDefId, PageInfo pInfo)
           
 java.util.List findAlerts(AuthzSubject subj, AlertSeverity severity, long timeRange, long endTime, boolean inEsc, boolean notFixed, java.lang.Integer groupId, PageInfo pInfo)
           
 java.util.List findAlerts(AuthzSubject subj, int count, int priority, long timeRange, long endTime, java.util.List includes)
          Find group alerts based on a set of criteria
 java.util.Collection findAllStrategyTypes()
           
 GalertAuxLog findAuxLogById(java.lang.Integer id)
           
 GalertDef findById(java.lang.Integer id)
           
 Escalatable findEscalatableAlert(java.lang.Integer id)
           
 java.util.List findEscalatables(AuthzSubject subj, int count, int priority, long timeRange, long endTime, java.util.List includes)
           
 GalertLog findLastFixedByDef(GalertDef def)
           
 ExecutionStrategyTypeInfo findStrategyType(ExecutionStrategyType t)
           
 ExecutionStrategyTypeInfo findStrategyType(java.lang.Integer id)
           
 java.util.List findUnfixedAlertLogsByTimeWindow(ResourceGroup group, long begin, long end)
           
 void fixAlert(GalertLog alert)
          Simply sets the 'fixed' flag on an alert
 GalertLog getAlertLog(java.lang.Integer id)
           
static org.hyperic.hq.galerts.shared.GalertManagerLocal getOne()
           
 java.util.List getTriggersById(java.lang.Integer id, GalertDefPartition partition)
          Retrieve the Gtriggers for a partition in the given galert def.
 java.util.Collection getUsing(Escalation e)
          Returns a list of GalertDefs using the passed escalation.
 void markDefDeleted(GalertDef def)
          Mark an alert definition as deleted.
 void nukeAlertDef(GalertDef def)
          Delete an alert definition along with all logs which are tied to it.
 void processGroupDeletion(ResourceGroup g)
          Remove all the galert defs associated with this resource group.
 ExecutionStrategyTypeInfo registerExecutionStrategy(ExecutionStrategyType stratType)
          Register an execution strategy.
 void reloadAlertDef(GalertDef def)
          Reload an alert definition.
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 void startEscalation(GalertDef def, ExecutionReason reason)
          Start an escalation for a group alert definition.
 void startup()
           
 void unregisterExecutionStrategy(ExecutionStrategyType sType)
          Unregister an execution strategy.
 void update(GalertDef def, Escalation escalation)
          Update the escalation of an alert def
 void update(GalertDef def, java.lang.String name, java.lang.String desc, AlertSeverity severity, java.lang.Boolean enabled)
          Update basic properties of an alert definition If any of the passed params are non-null, they will be updated with the new value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GalertManagerEJBImpl

public GalertManagerEJBImpl()
Method Detail

update

public void update(GalertDef def,
                   java.lang.String name,
                   java.lang.String desc,
                   AlertSeverity severity,
                   java.lang.Boolean enabled)
Update basic properties of an alert definition If any of the passed params are non-null, they will be updated with the new value


update

public void update(GalertDef def,
                   Escalation escalation)
Update the escalation of an alert def


enable

public void enable(GalertDef def,
                   boolean enable)
Enable/disable an alert def


findAlertDefs

public PageList findAlertDefs(ResourceGroup g,
                              PageControl pc)
Find all alert definitions for the specified group


findAlertDefs

public java.util.List findAlertDefs(AuthzSubject subj,
                                    AlertSeverity minSeverity,
                                    java.lang.Boolean enabled,
                                    PageInfo pInfo)
Find all group alert definitions.

Parameters:
minSeverity - Minimum severity for returned defs
enabled - If non-null specifies the nature of the 'enabled' flag for the results.
pInfo - Paging information. Must contain a sort field from GalertDefSortField

findAllStrategyTypes

public java.util.Collection findAllStrategyTypes()

findStrategyType

public ExecutionStrategyTypeInfo findStrategyType(java.lang.Integer id)

findStrategyType

public ExecutionStrategyTypeInfo findStrategyType(ExecutionStrategyType t)

findById

public GalertDef findById(java.lang.Integer id)

findAuxLogById

public GalertAuxLog findAuxLogById(java.lang.Integer id)

getTriggersById

public java.util.List getTriggersById(java.lang.Integer id,
                                      GalertDefPartition partition)
Retrieve the Gtriggers for a partition in the given galert def.

Parameters:
id - The galert def id.
partition - The partition.
Returns:
The list of Gtriggers.

createAlertLog

public GalertLog createAlertLog(GalertDef def,
                                ExecutionReason reason)
                         throws ResourceDeletedException
Save the alert log and associated auxillary log information to the DB. DevNote: Since the GalertAuxLog table needs to be written first (for foreign-key from the auxType tables), we first traverse all the logs and save them. Then, we perform the same traversal and save the specific logs.

Throws:
ResourceDeletedException

createActionLog

public void createActionLog(GalertLog alert,
                            java.lang.String detail,
                            Action action,
                            AuthzSubject subject)

findAlertLogs

public java.util.List findAlertLogs(GalertDef def)

findLastFixedByDef

public GalertLog findLastFixedByDef(GalertDef def)

fixAlert

public void fixAlert(GalertLog alert)
Simply sets the 'fixed' flag on an alert


findEscalatableAlert

public Escalatable findEscalatableAlert(java.lang.Integer id)

getAlertLog

public GalertLog getAlertLog(java.lang.Integer id)

findAlertLog

public GalertLog findAlertLog(java.lang.Integer id)

findAlertLogs

public java.util.List findAlertLogs(ResourceGroup group)

findAlertLogsByTimeWindow

public PageList findAlertLogsByTimeWindow(ResourceGroup group,
                                          long begin,
                                          long end,
                                          PageControl pc)

findUnfixedAlertLogsByTimeWindow

public java.util.List findUnfixedAlertLogsByTimeWindow(ResourceGroup group,
                                                       long begin,
                                                       long end)

findEscalatables

public java.util.List findEscalatables(AuthzSubject subj,
                                       int count,
                                       int priority,
                                       long timeRange,
                                       long endTime,
                                       java.util.List includes)
                                throws PermissionException
Returns:
a list of Escalatables
Throws:
PermissionException
See Also:
findAlerts

findAlerts

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

Parameters:
subj - Subject doing the finding
count - Max # of alerts to return
priority - A value from EventConstants
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)
includes - A list of entity IDs to include in the result. If null then ignore and return all.
Returns:
a list of GalertLogs
Throws:
PermissionException

findAlerts

public java.util.List findAlerts(AuthzSubject subj,
                                 AlertSeverity severity,
                                 long timeRange,
                                 long endTime,
                                 boolean inEsc,
                                 boolean notFixed,
                                 java.lang.Integer groupId,
                                 PageInfo pInfo)

findAlerts

public java.util.List findAlerts(AuthzSubject subj,
                                 AlertSeverity severity,
                                 long timeRange,
                                 long endTime,
                                 boolean inEsc,
                                 boolean notFixed,
                                 java.lang.Integer groupId,
                                 java.lang.Integer galertDefId,
                                 PageInfo pInfo)

fillAlertCount

public int[] fillAlertCount(AuthzSubject subj,
                            AppdefEntityID[] ids,
                            int[] counts)
                     throws PermissionException,
                            javax.ejb.FinderException
Get the number of alerts for the given array of AppdefEntityID's

Throws:
PermissionException
javax.ejb.FinderException

deleteAlertLog

public void deleteAlertLog(GalertLog log)

deleteAlertLogs

public void deleteAlertLogs(ResourceGroup group)

registerExecutionStrategy

public ExecutionStrategyTypeInfo registerExecutionStrategy(ExecutionStrategyType stratType)
Register an execution strategy.


unregisterExecutionStrategy

public void unregisterExecutionStrategy(ExecutionStrategyType sType)
Unregister an execution strategy. This will fail if any alert definitions are currently using the strategy


configureTriggers

public void configureTriggers(GalertDef def,
                              GalertDefPartition partition,
                              java.util.List triggerInfos,
                              java.util.List configs)
Configure triggers for a given partition.

Parameters:
triggerInfos - A list of GtriggerTypeInfos
configs - A list of ConfigResponses, one for each trigger info

addPartition

public ExecutionStrategyInfo addPartition(GalertDef def,
                                          GalertDefPartition partition,
                                          ExecutionStrategyTypeInfo stratType,
                                          ConfigResponse stratConfig)

createAlertDef

public GalertDef createAlertDef(AuthzSubject subject,
                                java.lang.String name,
                                java.lang.String description,
                                AlertSeverity severity,
                                boolean enabled,
                                ResourceGroup group)

reloadAlertDef

public void reloadAlertDef(GalertDef def)
Reload an alert definition. Probably should only be called internally here.


markDefDeleted

public void markDefDeleted(GalertDef def)
Mark an alert definition as deleted. This will remove it from all dialogues, but will leave all the data (specific alerts) in place.


nukeAlertDef

public void nukeAlertDef(GalertDef def)
Delete an alert definition along with all logs which are tied to it.


getUsing

public java.util.Collection getUsing(Escalation e)
Returns a list of GalertDefs using the passed escalation.


startEscalation

public void startEscalation(GalertDef def,
                            ExecutionReason reason)
Start an escalation for a group alert definition.


processGroupDeletion

public void processGroupDeletion(ResourceGroup g)
Remove all the galert defs associated with this resource group.


startup

public void startup()

getOne

public static org.hyperic.hq.galerts.shared.GalertManagerLocal getOne()

ejbCreate

public void ejbCreate()

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.