Package org.apache.syncope.common.search

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


                // AttributeCond or SyncopeUserCond
                final String schema = searchConditionWrapper.getFilterName();

                final AttributeCond attributeCond;
                if (dnames.getObject().contains(schema)) {
                    attributeCond = new AttributableCond();
                    nodeCond = searchConditionWrapper.isNotOperator()
                            ? NodeCond.getNotLeafCond((AttributableCond) attributeCond)
                            : NodeCond.getLeafCond((AttributableCond) attributeCond);
                } else {
                    attributeCond = new AttributeCond();
View Full Code Here


            // users: just id or username can be selected to be used
            // roles: just id or name can be selected to be used
            if ("id".equalsIgnoreCase(schema) || "username".equalsIgnoreCase(schema)
                    || "name".equalsIgnoreCase(schema)) {

                AttributableCond cond = new AttributableCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            } else {
                AttributeCond cond = new AttributeCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            }

            searchCond = searchCond == null
View Full Code Here

            // users: just id or username can be selected to be used
            // roles: just id or name can be selected to be used
            if ("id".equalsIgnoreCase(schema) || "username".equalsIgnoreCase(schema)
                    || "name".equalsIgnoreCase(schema)) {

                AttributableCond cond = new AttributableCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            } else {
                AttributeCond cond = new AttributeCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            }

            searchCond = searchCond == null
View Full Code Here

        assertTrue(userIds.contains(3L));
    }

    @Test
    public void searchByUsernameAndId() throws InvalidSearchConditionException {
        final AttributableCond usernameLeafCond = new AttributableCond(AttributableCond.Type.EQ);
        usernameLeafCond.setSchema("username");
        usernameLeafCond.setExpression("rossini");

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

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

        assertTrue(searchCondition.isValid());
View Full Code Here

        assertEquals(1L, matchingUsers.iterator().next().getId());
    }

    @Test
    public void searchByRolenameAndId() throws InvalidSearchConditionException {
        final AttributableCond rolenameLeafCond = new AttributableCond(AttributableCond.Type.EQ);
        rolenameLeafCond.setSchema("name");
        rolenameLeafCond.setExpression("root");

        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());
View Full Code Here

        assertTrue(count > 0);
    }

    @Test
    public void searchByBooleanAttributableCond() throws InvalidSearchConditionException {
        final AttributableCond cond = new AttributableCond(AttributableCond.Type.EQ);
        cond.setSchema("inheritAttributes");
        cond.setExpression("true");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);

        final List<RoleTO> matchingRoles = roleService.search(searchCondition);
        assertNotNull(matchingRoles);
View Full Code Here

        assertFalse(matchingRoles.isEmpty());
    }

    @Test
    public void searchByRelationshipAttributableCond() throws InvalidSearchConditionException {
        final AttributableCond userOwnerCond = new AttributableCond(AttributableCond.Type.EQ);
        userOwnerCond.setSchema("userOwner");
        userOwnerCond.setExpression("5");

        final AttributableCond ppolicyCond = new AttributableCond(AttributableCond.Type.ISNOTNULL);
        ppolicyCond.setSchema("passwordPolicy");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(userOwnerCond),
                NodeCond.getLeafCond(ppolicyCond));

        assertTrue(searchCondition.isValid());
View Full Code Here

            // users: just id or username can be selected to be used
            // roles: just id or name can be selected to be used
            if ("id".equalsIgnoreCase(schema) || "username".equalsIgnoreCase(schema)
                    || "name".equalsIgnoreCase(schema)) {

                AttributableCond cond = new AttributableCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            } else {
                AttributeCond cond = new AttributeCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            }

            searchCond = searchCond == null
View Full Code Here

        final String status = execution.getStatus();
        assertNotNull(status);
        assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());

        // 2. verify that synchronized role is found, with expected attributes
        final AttributableCond rolenameLeafCond = new AttributableCond(AttributableCond.Type.EQ);
        rolenameLeafCond.setSchema("name");
        rolenameLeafCond.setExpression("testLDAPGroup");
        final List<RoleTO> matchingRoles = roleService.search(NodeCond.getLeafCond(rolenameLeafCond));
        assertNotNull(matchingRoles);
        assertEquals(1, matchingRoles.size());

        final AttributableCond usernameLeafCond = new AttributableCond(AttributeCond.Type.EQ);
        usernameLeafCond.setSchema("username");
        usernameLeafCond.setExpression("syncFromLDAP");
        final List<UserTO> matchingUsers = userService.search(NodeCond.getLeafCond(usernameLeafCond));
        assertNotNull(matchingUsers);
        assertEquals(1, matchingUsers.size());
        // Check for SYNCOPE-436
        assertEquals("syncFromLDAP", matchingUsers.get(0).
View Full Code Here

        assertTrue(userIds.contains(3L));
    }

    @Test
    public void searchByUsernameAndId() throws InvalidSearchConditionException {
        final AttributableCond usernameLeafCond = new AttributableCond(AttributableCond.Type.EQ);
        usernameLeafCond.setSchema("username");
        usernameLeafCond.setExpression("rossini");

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

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

        assertTrue(searchCondition.isValid());
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.search.AttributableCond

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.