Package org.rhq.core.domain.criteria

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


                    }
                }
            }

            // Delete searches saved by this user
            SavedSearchCriteria savedSearchCriteria = new SavedSearchCriteria();
            savedSearchCriteria.addFilterSubjectId(doomedSubjectId);
            savedSearchCriteria.clearPaging();
            PageList<SavedSearch> savedSearches = savedSearchManager.findSavedSearchesByCriteria(subject,
                savedSearchCriteria);
            for (SavedSearch savedSearch : savedSearches) {
                savedSearchManager.deleteSavedSearch(subject, savedSearch.getId());
            }
View Full Code Here


                        "fake saved search " + iStr, "pipo " + iStr, subject1));
                    savedSearchManager.createSavedSearch(subject2, new SavedSearch(SearchSubsystem.GROUP,
                        "fake saved search " + iStr, "molo " + iStr, subject2));
                }

                SavedSearchCriteria criteria = new SavedSearchCriteria();
                criteria.addFilterName("fake saved search");
                criteria.clearPaging();

                PageList<SavedSearch> foundEntities = savedSearchManager
                    .findSavedSearchesByCriteria(subject2, criteria);
                assertTrue("User with manage inventory should see all saved searches", 2000 == foundEntities.size());
View Full Code Here

            throw getExceptionToThrowToClient(t);
        }
    }

    private SavedSearch getSubjectSavedSearch(int savedSearchId) {
        SavedSearchCriteria criteria = new SavedSearchCriteria();
        criteria.addFilterSubjectId(getSessionSubject().getId()); // ensure user can only fetch his/her own
        criteria.addFilterId(savedSearchId);
        List<SavedSearch> results = findSavedSearchesByCriteria(criteria);
        if (results.isEmpty()) {
            return null;
        } else {
            return results.get(0);
View Full Code Here

        if (0 == subject.getId()) {
            return new ArrayList();
        }

        if (savedSearches == null) {
            SavedSearchCriteria criteria = new SavedSearchCriteria();
            criteria.addFilterSubjectId(subject.getId());
            criteria.addFilterGlobal(false);
            criteria.addSortName(PageOrdering.ASC); // each sublist is alphabetical

            savedSearches = savedSearchManager.findSavedSearchesByCriteria(subject, criteria);
        }
        return savedSearches;
    }
View Full Code Here

    }

    private List<SavedSearch> getSavedSearchesNeedingRecomputation() {
        long fiveMinutesAgo = System.currentTimeMillis() - (5 * 60 * 1000);

        SavedSearchCriteria criteria = new SavedSearchCriteria();
        criteria.addFilterLastComputeTimeMax(fiveMinutesAgo);
        criteria.addFilterGlobal(false); // don't support CRUD global yet, don't bother recalculating these

        List<SavedSearch> results = savedSearchManager.findSavedSearchesByCriteria(overlord, criteria);
        if (LOG.isTraceEnabled()) {
            for (SavedSearch nextSavedSearch : results) {
                LOG.trace(nextSavedSearch + " needs recomputation");
View Full Code Here

            return new ArrayList<SearchSuggestion>();
        }

        expression = expression.trim().toLowerCase().replaceAll("\\s+", " ");

        SavedSearchCriteria criteria = new SavedSearchCriteria();
        criteria.addFilterSubjectId(subject.getId());
        criteria.addFilterSearchSubsystem(searchSubsystem);
        if (expression.equals("") == false) {
            criteria.addFilterName(expression);
        }

        criteria.setCaseSensitive(false);
        criteria.addSortName(PageOrdering.ASC);

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

    }

    public List<SearchSuggestion> getGlobalSavedSearchSuggestions(String expression) {
        expression = expression.trim().toLowerCase().replaceAll("\\s+", " ");

        SavedSearchCriteria criteria = new SavedSearchCriteria();
        criteria.addFilterGlobal(true);
        criteria.addFilterSearchSubsystem(searchSubsystem);
        if (expression.equals("") == false) {
            criteria.addFilterName(expression);
        }

        criteria.setCaseSensitive(false);
        criteria.addSortName(PageOrdering.ASC);

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

    public void testSavedSearchResultCountRecalculation() throws Exception {
        runJobSynchronously();
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                SavedSearchCriteria criteria = new SavedSearchCriteria();
                criteria.clearPaging();
                criteria.addFilterSubjectId(testData.getSearchesOwner().getId());
                PageList<SavedSearch> foundSavedSearches = savedSearchManager.findSavedSearchesByCriteria(
                    testData.getSearchesOwner(), criteria);
                assertEquals(testData.getSavedSearches().size(), foundSavedSearches.size());
                for (SavedSearch savedSearch : foundSavedSearches) {
                    assertTrue(savedSearch.toString() + " should have been computed",
View Full Code Here

        if (isSearchInProgress) {
            return;
        }

        Log.debug("Search Saved Searches");
        SavedSearchCriteria savedSearchCriteria = new SavedSearchCriteria();
        Subject subject = UserSessionManager.getSessionSubject();
        savedSearchCriteria.addFilterSubjectId(subject.getId());
        savedSearchCriteria.setStrict(true);
        final long startTime = System.currentTimeMillis();
        searchBar.getPickListGrid().setData(new ListGridRecord[] {});

        isSearchInProgress = true;
View Full Code Here

TOP

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

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.