Package org.apache.syncope.common.search

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


        final AttributableCond idRightCond = new AttributableCond(AttributableCond.Type.LT);
        idRightCond.setSchema("id");
        idRightCond.setExpression("2");

        final NodeCond searchCondition = NodeCond.getOrCond(NodeCond.getLeafCond(usernameLeafCond),
                NodeCond.getLeafCond(idRightCond));

        final List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition, AttributableUtil.getInstance(AttributableType.USER));
View Full Code Here


        final AttributableCond idRightCond = new AttributableCond(AttributableCond.Type.LT);
        idRightCond.setSchema("id");
        idRightCond.setExpression("2");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(rolenameLeafCond),
                NodeCond.getLeafCond(idRightCond));

        assertTrue(searchCondition.isValid());

        final List<SyncopeRole> matchingRoles = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition, AttributableUtil.getInstance(AttributableType.ROLE));

        assertNotNull(matchingRoles);
View Full Code Here

        final AttributeCond idRightCond = new AttributeCond(AttributeCond.Type.LIKE);
        idRightCond.setSchema("fullname");
        idRightCond.setExpression("Giuseppe V%");

        final NodeCond searchCondition = NodeCond.getOrCond(NodeCond.getLeafCond(usernameLeafCond),
                NodeCond.getLeafCond(idRightCond));

        final List<SyncopeUser> matchingUsers =
                searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition,
                        AttributableUtil.getInstance(AttributableType.USER));
View Full Code Here

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

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

        List<SyncopeUser> users =
                searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition,
                        AttributableUtil.getInstance(AttributableType.USER));

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

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

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

        users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition,
                AttributableUtil.getInstance(AttributableType.USER));

        assertNotNull(users);
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.isValid());

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

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

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

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

    public void issueSYNCOPE46() {
        AttributableCond cond = new AttributableCond(AttributeCond.Type.LIKE);
        cond.setSchema("username");
        cond.setExpression("%ossin%");

        NodeCond searchCondition = NodeCond.getLeafCond(cond);
        assertTrue(searchCondition.isValid());

        List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
                searchCondition, AttributableUtil.getInstance(AttributableType.USER));
        assertNotNull(users);
        assertEquals(1, users.size());
View Full Code Here

        AttributableCond likeCond = new AttributableCond(AttributeCond.Type.LIKE);
        likeCond.setSchema("username");
        likeCond.setExpression("%ossin%");

        NodeCond searchCond = NodeCond.getOrCond(NodeCond.getLeafCond(isNullCond), NodeCond.getLeafCond(likeCond));

        Integer count = searchDAO.count(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCond,
                AttributableUtil.getInstance(AttributableType.USER));
        assertNotNull(count);
        assertTrue(count > 0);
View Full Code Here

        UserService userService2 = setupCredentials(userService, UserService.class,
                userTO.getUsername(), "password123");

        AttributeCond isNullCond = new AttributeCond(AttributeCond.Type.ISNOTNULL);
        isNullCond.setSchema("loginDate");
        NodeCond searchCondition = NodeCond.getLeafCond(isNullCond);

        List<UserTO> matchedUsers = userService2.search(searchCondition);
        assertNotNull(matchedUsers);
        assertFalse(matchedUsers.isEmpty());
        Set<Long> userIds = new HashSet<Long>(matchedUsers.size());
View Full Code Here

        fullnameLeafCond1.setSchema("fullname");
        fullnameLeafCond1.setExpression("%o%");
        AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
        fullnameLeafCond2.setSchema("fullname");
        fullnameLeafCond2.setExpression("%i%");
        NodeCond about = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond.getLeafCond(
                fullnameLeafCond2));

        notification.setAbout(about);

        MembershipCond membCond = new MembershipCond();
        membCond.setRoleId(7L);
        NodeCond recipients = NodeCond.getLeafCond(membCond);

        notification.setRecipients(recipients);

        notification.setRecipientAttrName("email");
        notification.setRecipientAttrType(IntMappingType.UserSchema);
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.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.