Package org.rhq.core.domain.criteria

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


        templateCriteria.setPageControl(PageControl.getSingleRowInstance());

        PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(subject, templateCriteria);
        DriftDefinitionTemplate template = templates.get(0);

        DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
        criteria.addFilterTemplateId(templateId);
        criteria.fetchConfiguration(true);
        criteria.fetchResource(true);

        //Use CriteriaQuery to automatically chunk/page through criteria query results
        CriteriaQueryExecutor<DriftDefinition, DriftDefinitionCriteria> queryExecutor = new CriteriaQueryExecutor<DriftDefinition, DriftDefinitionCriteria>() {
            @Override
            public PageList<DriftDefinition> execute(DriftDefinitionCriteria criteria) {
View Full Code Here


    @Override
    public void processRepeatChangeSet(int resourceId, String driftDefName, int version) {
        Subject overlord = subjectManager.getOverlord();

        DriftDefinitionCriteria driftDefCriteria = new DriftDefinitionCriteria();
        driftDefCriteria.setStrict(true);
        driftDefCriteria.addFilterResourceIds(resourceId);
        driftDefCriteria.addFilterName(driftDefName);

        PageList<DriftDefinition> defs = findDriftDefinitionsByCriteria(overlord, driftDefCriteria);
        if (defs.isEmpty()) {
            log.warn("Cannot process repeat change set. No drift definition found for [resourceId: " + resourceId
                + ", driftDefinitionName: " + driftDefName + "]");
View Full Code Here

    public void deleteDriftDefinition(Subject subject, EntityContext entityContext, String driftDefName) {
        switch (entityContext.getType()) {
        case Resource:
            authorizeOrFail(subject, entityContext, "Can not delete drifts");
            int resourceId = entityContext.getResourceId();
            DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
            criteria.addFilterName(driftDefName);
            criteria.addFilterResourceIds(resourceId);
            criteria.setStrict(true);
            criteria.clearPaging();//disable paging as the code assumes all the results will be returned.

            PageList<DriftDefinition> results = driftManager.findDriftDefinitionsByCriteria(subject, criteria);
            DriftDefinition doomedDriftDef = null;
            if (results != null && results.size() == 1) {
                doomedDriftDef = results.get(0);
View Full Code Here

        if (DriftHandlingMode.plannedChanges != summary.getDriftHandlingMode()) {
            notifyAlertConditionCacheManager("saveChangeSet", summary);
        }

        DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
        criteria.setStrict(true);
        criteria.addFilterName(summary.getDriftDefinitionName());
        criteria.addFilterResourceIds(resourceId);
        criteria.clearPaging();//disable paging as the code assumes all the results will be returned.

        PageList<DriftDefinition> definitions = findDriftDefinitionsByCriteria(subject, criteria);

        if (definitions.isEmpty()) {
            log.warn("Could not find drift definition for [resourceId: " + resourceId + ", driftDefinitionName: "
View Full Code Here

TOP

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

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.