Package org.rhq.core.domain.criteria

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


            subject = subjectManager.loginUnauthenticated(RHQADMIN);
        } catch (Exception e) {
            assert false : "There must be at least rhqadmin user";
        }

        SubjectCriteria c = new SubjectCriteria();
        c.addFilterFsystem(false);
        c.addSortName(PageOrdering.ASC);
        PageList<Subject> all_subjects = subjectManager.findSubjectsByCriteria(subject, c);

        assert all_subjects.size() >= 1 : "There must be at least rhqadmin user";
        assert !all_subjects.contains(superuser) : "The superuser should not have been returned in the list";
        assert all_subjects.contains(rhqadmin) : "Missing user [" + rhqadmin + "] from: " + all_subjects;
View Full Code Here


            Subject anotherSubject = new Subject("subject" + UUID.randomUUID(), true, false);
            anotherSubject = subjectManager.createSubject(overlord, anotherSubject, "password");

            PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(subjectWithViewUsersRole,
                new SubjectCriteria());
            Set<Subject> subjectSet = new HashSet<Subject>(subjects);
            assertTrue(subjectSet.contains(subjectWithViewUsersRole));
            assertTrue(subjectSet.contains(anotherSubject));
            assertTrue(subjectSet.contains(rhqadmin));
        } finally {
View Full Code Here

            rhqadmin = subjectManager.loginUnauthenticated(rhqadmin.getName());

            Subject anotherSubject = new Subject("subject" + UUID.randomUUID(), true, false);
            anotherSubject = subjectManager.createSubject(overlord, anotherSubject, "password");

            PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(rhqadmin, new SubjectCriteria());
            Set<Subject> subjectSet = new HashSet<Subject>(subjects);
            assertTrue(subjectSet.contains(anotherSubject));
            assertTrue(subjectSet.contains(rhqadmin));
        } finally {
            getTransactionManager().rollback();
View Full Code Here

            Subject anotherSubject = new Subject("subject" + UUID.randomUUID(), true, false);
            anotherSubject = subjectManager.createSubject(overlord, anotherSubject, "password");

            PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(subjectWithNonViewUsersRole,
                new SubjectCriteria());
            Set<Subject> subjectSet = new HashSet<Subject>(subjects);
            assertEquals(1, subjectSet.size());
            assertTrue(subjectSet.contains(subjectWithNonViewUsersRole));
        } finally {
            getTransactionManager().rollback();
View Full Code Here

            Subject anotherSubject = new Subject("subject" + UUID.randomUUID(), true, false);
            anotherSubject = subjectManager.createSubject(overlord, anotherSubject, "password");

            PageList<Subject> subjects = subjectManager.findSubjectsByCriteria(subjectWithNoRoles,
                new SubjectCriteria());
            Set<Subject> subjectSet = new HashSet<Subject>(subjects);
            assertEquals(1, subjectSet.size());
            assertTrue(subjectSet.contains(subjectWithNoRoles));
        } finally {
            getTransactionManager().rollback();
View Full Code Here

* An Action that retrieves all users from the BizApp.
*/
public class ListAction extends TilesAction {
    public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
        SubjectCriteria c = new SubjectCriteria();
        c.addFilterFsystem(false);
        c.addSortName(PageOrdering.ASC);
        PageList<Subject> users = LookupUtil.getSubjectManager().findSubjectsByCriteria(
            RequestUtils.getSubject(request), c);
        request.setAttribute(Constants.ALL_USERS_ATTR, users);

        return null;
View Full Code Here

        /* pending users are those on the right side of the "add
         * to list" widget- awaiting association with the rolewhen the form's "ok" button is clicked. */
        Integer[] pendingUserIds = SessionUtils.getList(request.getSession(), Constants.PENDING_USERS_SES_ATTR);

        log.trace("getting pending users for role [" + roleId + "]");
        SubjectCriteria c = new SubjectCriteria();
        c.addFilterIds(pendingUserIds);
        c.addFilterFsystem(false);
        c.addFilterFactive(true);
        c.fetchRoles(true);
        c.addSortName(PageOrdering.ASC);
        PageList<Subject> pendingUsers = subjectManager.findSubjectsByCriteria(RequestUtils.getSubject(request), c);
        request.setAttribute(Constants.PENDING_USERS_ATTR, pendingUsers);

        /*
         * available users are all users in the system that are /not/ associated with the role and are not pending
View Full Code Here

TOP

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

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.