Package org.rhq.enterprise.server.alert

Examples of org.rhq.enterprise.server.alert.GroupAlertDefinitionManagerLocal


                AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
                AlertDefinition alertDefinition = alertDefinitionManager.createAlertDefinitionInNewTransaction(subject,
                    alertDef, defForm.getId(), true);
                alertDefinitionId = alertDefinition.getId();
            } else if (context == FormContext.Group) {
                GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil
                    .getGroupAlertDefinitionManager();
                alertDefinitionId = groupAlertDefinitionManager.createGroupAlertDefinitions(subject, alertDef,
                    defForm.getGroupId());
            } else {
                throw new IllegalArgumentException("Unsupported context: " + context);
            }
        } catch (InvalidAlertDefinitionException iade) {
View Full Code Here


                AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
                // this will disallow updates if the alert definition has been deleted
                alertDef.setReadOnly(defForm.isReadOnly());
                alertDefinitionManager.updateAlertDefinition(subject, alertDef.getId(), alertDef, false);
            } else if (context == FormContext.Group) {
                GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil
                    .getGroupAlertDefinitionManager();
                groupAlertDefinitionManager.updateGroupAlertDefinitions(subject, alertDef, false);
            } else {
                throw new IllegalArgumentException("Unsupported context: " + context);
            }
        } catch (AlertDefinitionException iade) {
            log.debug("alert definition update failed:", iade);
View Full Code Here

        String selectedOperation = operationsForm.getControlAction();

        OperationManagerLocal operationManager = LookupUtil.getOperationManager();
        AlertTemplateManagerLocal alertTemplateManager = LookupUtil.getAlertTemplateManager();
        AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
        GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil.getGroupAlertDefinitionManager();

        Subject subject = RequestUtils.getSubject(request);
        AlertDefinition alertDefinition = AlertDefUtil.getAlertDefinition(request);

        OperationDefinition operationDefinition = null;

        if (selectedOperation.equals(EventConstants.CONTROL_ACTION_NONE) == false) {
            Integer operationId = Integer.parseInt(selectedOperation);

            operationDefinition = operationManager.getOperationDefinition(subject, operationId);
        }

        try {
            if (context == FormContext.Type) {
                alertTemplateManager.updateAlertTemplate(subject, alertDefinition, false);
            } else if (context == FormContext.Group) {
                groupAlertDefinitionManager.updateGroupAlertDefinitions(subject, alertDefinition, false);
            } else if (context == FormContext.Resource) {
                alertDefinitionManager.updateAlertDefinition(subject, alertDefinition.getId(), alertDefinition, false);
            } else {
                throw new IllegalArgumentException("Unsupported form context: " + context);
            }
View Full Code Here

                Integer resourceTypeId = RequestUtils.getResourceTypeId(request);

                alertDefinitions = alertTemplateManager.getAlertTemplates(subject, resourceTypeId, PageControl
                    .getUnlimitedInstance());
            } else {
                GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil
                    .getGroupAlertDefinitionManager();
                Integer groupId = RequestUtils.getGroupId(request);

                alertDefinitions = groupAlertDefinitionManager.findGroupAlertDefinitions(subject, groupId, PageControl
                    .getUnlimitedInstance());
            }

            Map<String, Integer> alertDefinitionNameToIdMap = new HashMap<String, Integer>(alertDefinitions.size());
            for (AlertDefinition alertDefinition : alertDefinitions) {
View Full Code Here

                alertTemplateManager.updateAlertTemplate(subject, alertDef, true);
            } else if (context == FormContext.Resource) {
                AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
                alertDefinitionManager.updateAlertDefinition(subject, alertDef.getId(), alertDef, true);
            } else if (context == FormContext.Group) {
                GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil
                    .getGroupAlertDefinitionManager();
                groupAlertDefinitionManager.updateGroupAlertDefinitions(subject, alertDef, true);
            } else {
                throw new IllegalArgumentException("Unsupported context: " + context);
            }
        } catch (AlertDefinitionException iade) {
            log.debug("alert definition update failed:", iade);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.alert.GroupAlertDefinitionManagerLocal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.