Examples of UVirAttr


Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertEquals("did not get expected number of derived attributes ", 1, list.size());
    }

    @Test
    public void findById() {
        UVirAttr attribute = virAttrDAO.find(1000L, UVirAttr.class);
        assertNotNull("did not find expected attribute schema", attribute);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertNotNull(virtualSchema);

        SyncopeUser owner = userDAO.find(3L);
        assertNotNull("did not get expected user", owner);

        UVirAttr virtualAttribute = new UVirAttr();
        virtualAttribute.setOwner(owner);
        virtualAttribute.setVirtualSchema(virtualSchema);

        virtualAttribute = virAttrDAO.save(virtualAttribute);

        UVirAttr actual = virAttrDAO.find(virtualAttribute.getId(), UVirAttr.class);
        assertNotNull("expected save to work", actual);
        assertEquals(virtualAttribute, actual);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertEquals(virtualAttribute, actual);
    }

    @Test
    public void delete() {
        UVirAttr attribute = virAttrDAO.find(1000L, UVirAttr.class);
        String attributeSchemaName = attribute.getVirtualSchema().getName();

        virAttrDAO.delete(attribute.getId(), UVirAttr.class);

        UVirAttr actual = virAttrDAO.find(1000L, UVirAttr.class);
        assertNull("delete did not work", actual);

        UVirSchema attributeSchema = virSchemaDAO.find(attributeSchemaName, UVirSchema.class);

        assertNotNull("user virtual attribute schema deleted " + "when deleting values", attributeSchema);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

                    email = attr.getValuesAsStrings().get(0);
                }
                break;

            case UserVirtualSchema:
                UVirAttr virAttr = user.getVirtualAttribute(recipientAttrName);
                if (virAttr != null && !virAttr.getValues().isEmpty()) {
                    email = virAttr.getValues().get(0);
                }
                break;

            case UserDerivedSchema:
                UDerAttr derAttr = user.getDerivedAttribute(recipientAttrName);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

            case UserSchema:
                UAttr attr = user.getAttribute(recipientAttrName);
                email = attr == null || attr.getValuesAsStrings().isEmpty() ? null : attr.getValuesAsStrings().get(0);
                break;
            case UserVirtualSchema:
                UVirAttr virAttr = user.getVirtualAttribute(recipientAttrName);
                email = virAttr == null || virAttr.getValues().isEmpty() ? null : virAttr.getValues().get(0);
                break;
            case UserDerivedSchema:
                UDerAttr derAttr = user.getDerivedAttribute(recipientAttrName);
                email = derAttr == null ? null : derAttr.getValue(user.getAttributes());
                break;
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

    public <T extends AbstractVirAttr> T newVirtualAttribute() {
        T result = null;

        switch (type) {
            case USER:
                result = (T) new UVirAttr();
                break;
            case ROLE:
                result = (T) new RVirAttr();
                break;
            case MEMBERSHIP:
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertEquals("did not get expected number of derived attributes ", 1, list.size());
    }

    @Test
    public void findById() {
        UVirAttr attribute = virAttrDAO.find(100L, UVirAttr.class);
        assertNotNull("did not find expected attribute schema", attribute);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertNotNull(virtualSchema);

        SyncopeUser owner = userDAO.find(3L);
        assertNotNull("did not get expected user", owner);

        UVirAttr virtualAttribute = new UVirAttr();
        virtualAttribute.setOwner(owner);
        virtualAttribute.setVirtualSchema(virtualSchema);

        virtualAttribute = virAttrDAO.save(virtualAttribute);

        UVirAttr actual = virAttrDAO.find(virtualAttribute.getId(), UVirAttr.class);
        assertNotNull("expected save to work", actual);
        assertEquals(virtualAttribute, actual);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

        assertEquals(virtualAttribute, actual);
    }

    @Test
    public void delete() {
        UVirAttr attribute = virAttrDAO.find(100L, UVirAttr.class);
        String attributeSchemaName = attribute.getVirtualSchema().getName();

        virAttrDAO.delete(attribute.getId(), UVirAttr.class);

        UVirAttr actual = virAttrDAO.find(100L, UVirAttr.class);
        assertNull("delete did not work", actual);

        UVirSchema attributeSchema = virSchemaDAO.find(attributeSchemaName, UVirSchema.class);

        assertNotNull("user virtual attribute schema deleted " + "when deleting values", attributeSchema);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.UVirAttr

            case UserSchema:
                UAttr attr = user.getAttribute(recipientAttrName);
                email = attr == null || attr.getValuesAsStrings().isEmpty() ? null : attr.getValuesAsStrings().get(0);
                break;
            case UserVirtualSchema:
                UVirAttr virAttr = user.getVirtualAttribute(recipientAttrName);
                email = virAttr == null || virAttr.getValues().isEmpty() ? null : virAttr.getValues().get(0);
                break;
            case UserDerivedSchema:
                UDerAttr derAttr = user.getDerivedAttribute(recipientAttrName);
                email = derAttr == null ? null : derAttr.getValue(user.getAttributes());
                break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.