Package org.apache.syncope.client.search

Examples of org.apache.syncope.client.search.NodeCond


    public void searchById() {
        SyncopeUserCond idLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
        idLeafCond.setSchema("id");
        idLeafCond.setExpression("2");

        NodeCond searchCondition = NodeCond.getLeafCond(idLeafCond);
        assertTrue(searchCondition.checkValidity());

        List<SyncopeUser> matchingUsers =
                searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition);

        assertNotNull(matchingUsers);
        assertEquals(1, matchingUsers.size());
        assertEquals(1L, matchingUsers.iterator().next().getId().longValue());

        idLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
        idLeafCond.setSchema("id");
        idLeafCond.setExpression("4");

        searchCondition = NodeCond.getNotLeafCond(idLeafCond);
        assertTrue(searchCondition.checkValidity());

        matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition);

        assertNotNull(matchingUsers);
        assertEquals(2, matchingUsers.size());
View Full Code Here


        ws2.setResourceName("ws-target-resource-2");

        final ResourceCond ws1 = new ResourceCond();
        ws1.setResourceName("ws-target-resource-list-mappings-1");

        final NodeCond searchCondition =
                NodeCond.getAndCond(NodeCond.getNotLeafCond(ws2), NodeCond.getNotLeafCond(ws1));
        assertTrue(searchCondition.checkValidity());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition);
        assertNotNull(users);
        assertEquals(2, users.size());
View Full Code Here

    public void issue242() {
        final SyncopeUserCond cond = new SyncopeUserCond(AttributeCond.Type.LIKE);
        cond.setSchema("id");
        cond.setExpression("test%");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);
        assertTrue(searchCondition.checkValidity());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition);
        assertNotNull(users);
        assertTrue(users.isEmpty());
View Full Code Here

    public void issueSYNCOPE46() {
        final SyncopeUserCond cond = new SyncopeUserCond(AttributeCond.Type.LIKE);
        cond.setSchema("username");
        cond.setExpression("%user%");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);
        assertTrue(searchCondition.checkValidity());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition);
        assertNotNull(users);
        assertEquals(5, users.size());
View Full Code Here

        final AttributeCond coolLeafCond = new AttributeCond(AttributeCond.Type.EQ);
        coolLeafCond.setSchema("cool");
        coolLeafCond.setExpression("true");

        final NodeCond cond = NodeCond.getLeafCond(coolLeafCond);
        assertTrue(cond.checkValidity());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
        assertNotNull(users);
        assertEquals(1, users.size());
View Full Code Here

        AttributeCond loginDateCond = new AttributeCond(AttributeCond.Type.EQ);
        loginDateCond.setSchema("loginDate");
        loginDateCond.setExpression("2009-05-26");

        NodeCond subCond = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond), NodeCond.getLeafCond(
                membershipCond));

        assertTrue(subCond.checkValidity());

        NodeCond cond = NodeCond.getAndCond(subCond, NodeCond.getLeafCond(loginDateCond));

        assertTrue(cond.checkValidity());

        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
        assertNotNull(users);
        assertEquals(1, users.size());
    }
View Full Code Here

    public void searchWithNotCondition() {
        final AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.EQ);
        fullnameLeafCond.setSchema("fullname");
        fullnameLeafCond.setExpression("fabio.martelli");

        final NodeCond cond = NodeCond.getNotLeafCond(fullnameLeafCond);
        assertTrue(cond.checkValidity());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), cond);
        assertNotNull(users);
        assertEquals(2, users.size());
View Full Code Here

                    private static final long serialVersionUID = -958724007591692537L;

                    @Override
                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
                        final NodeCond searchCond = searchPanel.buildSearchCond();
                        LOG.debug("Node condition " + searchCond);

                        doSearch(target, searchCond, searchResult);

                        Session.get().getFeedbackMessages().clear();
View Full Code Here

    public Long getId() {
        return id;
    }

    public NodeCond getAbout() {
        NodeCond result = XMLSerializer.<NodeCond>deserialize(xmlAbout);
        if (result == null) {
            result = new NodeCond();
        }
        return result;
    }
View Full Code Here

        return result;
    }

    public void setAbout(NodeCond about) {
        if (about == null) {
            about = new NodeCond();
        }

        xmlAbout = XMLSerializer.serialize(about);
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.client.search.NodeCond

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.