Package org.rhq.core.domain.criteria

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria


        this.resourceGroup = group;
    }

    @Override
    protected AlertDefinitionCriteria getFetchCriteria(DSRequest request) {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();

        Criteria requestCriteria = request.getCriteria();
        if (requestCriteria != null) {
            Map values = requestCriteria.getValues();
            for (Object key : values.keySet()) {
                String fieldName = (String) key;
                if (fieldName.equals(GroupAlertDefinitionsView.CRITERIA_GROUP_ID)) {
                    Integer resourceId = (Integer) values.get(fieldName);
                    criteria.addFilterResourceGroupIds(resourceId);
                }
            }
        }

        return criteria;
View Full Code Here


        return criteria;
    }

    @Override
    protected AlertDefinitionCriteria getSimpleCriteriaForAll() {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterResourceGroupIds(Integer.valueOf(this.resourceGroup.getId()));
        criteria.setPageControl(PageControl.getUnlimitedInstance());
        return criteria;
    }
View Full Code Here

        this.resourceType = rt;
    }

    @Override
    protected AlertDefinitionCriteria getFetchCriteria(DSRequest request) {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();

        Criteria requestCriteria = request.getCriteria();
        criteria.addFilterAlertTemplateOnly(true);

        if (requestCriteria != null) {
            Map values = requestCriteria.getValues();
            for (Object key : values.keySet()) {
                String fieldName = (String) key;
                if (fieldName.equals(TemplateAlertDefinitionsView.CRITERIA_RESOURCE_TYPE_ID)) {
                    Integer resourceTypeId = (Integer) values.get(fieldName);
                    criteria.addFilterAlertTemplateResourceTypeId(resourceTypeId);
                }
            }
        }

        return criteria;
View Full Code Here

        return criteria;
    }

    @Override
    protected AlertDefinitionCriteria getSimpleCriteriaForAll() {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterAlertTemplateResourceTypeId(Integer.valueOf(this.resourceType.getId()));
        criteria.setPageControl(PageControl.getUnlimitedInstance());
        return criteria;
    }
View Full Code Here

            }
        });
    }

    private void fetchDefinitionWithGroupAndTemplate(final Alert alert) {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterAlertId(alert.getId());
        criteria.fetchGroupAlertDefinition(true);
        criteria.fetchResourceType(true);
        GWTServiceLookup.getAlertDefinitionService().findAlertDefinitionsByCriteria(criteria, new AsyncCallback<PageList<AlertDefinition>>() {
            public void onSuccess(PageList<AlertDefinition> result) {
                alert.getAlertDefinition().setGroupAlertDefinition(result.get(0).getGroupAlertDefinition());
                alert.getAlertDefinition().setResourceType(result.get(0).getResourceType());
                show(alert);
View Full Code Here

                });
        }
    }

    protected AlertDefinitionCriteria getDetailCriteria() {
        AlertDefinitionCriteria criteria = super.getDetailCriteria();
        criteria.addFilterAlertTemplateOnly(true);
        return criteria;
    }
View Full Code Here

        return fields;
    }

    @Override
    protected AlertDefinitionCriteria getFetchCriteria(DSRequest request) {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();

        criteria.fetchGroupAlertDefinition(true);
        criteria.fetchConditions(true);
        criteria.fetchAlertNotifications(true);

        Criteria requestCriteria = request.getCriteria();
        if (requestCriteria != null) {
            Map values = requestCriteria.getValues();
            for (Object key : values.keySet()) {
                String fieldName = (String) key;
                if (fieldName.equals(ResourceAlertDefinitionsView.CRITERIA_RESOURCE_ID)) {
                    Integer resourceId = (Integer) values.get(fieldName);
                    criteria.addFilterResourceIds(resourceId);
                }
            }
        }

        return criteria;
View Full Code Here

        return super.getSortFieldForColumn(columnName);
    }

    @Override
    protected AlertDefinitionCriteria getSimpleCriteriaForAll() {
        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterResourceIds(Integer.valueOf(this.resource.getId()));
        criteria.setPageControl(PageControl.getUnlimitedInstance());
        return criteria;
    }
View Full Code Here

    public int removeAlertDefinitions(Subject subject, int[] alertDefinitionIds) {
        if (null == alertDefinitionIds || alertDefinitionIds.length == 0) {
            return 0;
        }

        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterIds(ArrayUtils.wrapInArray(alertDefinitionIds));
        criteria.addFilterDeleted(false);
        criteria.clearPaging();
        List<AlertDefinition> defs = alertDefinitionManager.findAlertDefinitionsByCriteria(subject, criteria);

        if (defs.isEmpty()) {
            return 0;
        }
View Full Code Here

    public int enableAlertDefinitions(Subject subject, int[] alertDefinitionIds) {
        if (null == alertDefinitionIds || alertDefinitionIds.length == 0) {
            return 0;
        }

        AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
        criteria.addFilterIds(ArrayUtils.wrapInArray(alertDefinitionIds));
        criteria.addFilterEnabled(false);
        criteria.addFilterDeleted(false);
        criteria.clearPaging();
        List<AlertDefinition> defs = alertDefinitionManager.findAlertDefinitionsByCriteria(subject, criteria);

        if (defs.isEmpty()) {
            return 0;
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.criteria.AlertDefinitionCriteria

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.