Examples of SecurityEntityRelationTypeImpl


Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        // use attribute on from entity (of "user" type); user IDs are stored
        // in the "j2-role" attribute
        hasRoleDAO = new AttributeBasedRelationDAO();
        hasRoleDAO.setRelationAttribute("uniqueMember");
        hasRoleDAO.setUseFromEntityAttribute(false);
        hasRoleDAO.setRelationType(new SecurityEntityRelationTypeImpl("hasRole","user","role"));
        hasRoleDAO.setAttributeContainsInternalId(true);
        relationDaos.add(hasRoleDAO);

        entityManager.setEntityRelationDAOs(relationDaos);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        hasRoleDAO = new AttributeBasedRelationDAO();
        hasRoleDAO.setRelationAttribute("uniqueMember");
        // use attribute on target entity (of "role" type); user IDs are stored
        // in a multi-valued attribute on roles.
        hasRoleDAO.setUseFromEntityAttribute(false);
        hasRoleDAO.setRelationType(new SecurityEntityRelationTypeImpl("hasRole","user","role"));
        hasRoleDAO.setAttributeContainsInternalId(true);
        relationDaos.add(hasRoleDAO);

        entityManager.setEntityRelationDAOs(relationDaos);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        userDao.addEntity(group_programmers);
        userDao.addEntity(group_board);
        userDao.addEntity(group_random);
        userDao.addEntity(group_yetAnother);

        StubEntityRelationDAO userToRole = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_MEMBER_OF,
                JetspeedPrincipalType.USER,
                JetspeedPrincipalType.ROLE));
        userToRole.relate(null, null, user_jsmith, role_manager);
        userToRole.relate(null, null, user_jsmith, role_random);
        userToRole.relate(null, null, user_jdoe, role_manager);
        userToRole.relate(null, null, user_jdoe, role_random);
        userToRole.relate(null, null, user_jdoe, role_admin);

        StubEntityRelationDAO userToGroup = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_CHILD_OF,
                JetspeedPrincipalType.USER,
                JetspeedPrincipalType.GROUP));
        userToGroup.relate(null, null, user_jsmith, group_programmers);
        userToGroup.relate(null, null, user_jsmith, group_random);
        userToGroup.relate(null, null, user_jdoe, group_board);
        userToGroup.relate(null, null, user_jdoe, group_yetAnother);
        userToGroup.relate(null, null, user_jdoe, group_random);
       
        StubEntityRelationDAO groupToRole = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_CHILD_OF,
                JetspeedPrincipalType.GROUP,
                JetspeedPrincipalType.ROLE));
       
        groupToRole.relate(null, null, group_board, role_manager);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        userDao.addEntity(group_programmers);
        userDao.addEntity(group_board);
        userDao.addEntity(group_random);
        userDao.addEntity(group_yetAnother);

        StubEntityRelationDAO userToRole = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_MEMBER_OF,
                JetspeedPrincipalType.USER,
                JetspeedPrincipalType.ROLE));
        userToRole.relate(null, null, user_jsmith, role_manager);
        userToRole.relate(null, null, user_jsmith, role_random);
        userToRole.relate(null, null, user_jdoe, role_manager);
        userToRole.relate(null, null, user_jdoe, role_random);
        userToRole.relate(null, null, user_jdoe, role_admin);

        StubEntityRelationDAO userToGroup = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_CHILD_OF,
                JetspeedPrincipalType.USER,
                JetspeedPrincipalType.GROUP));
        userToGroup.relate(null, null, user_jsmith, group_programmers);
        userToGroup.relate(null, null, user_jsmith, group_random);
        userToGroup.relate(null, null, user_jdoe, group_board);
        userToGroup.relate(null, null, user_jdoe, group_yetAnother);
        userToGroup.relate(null, null, user_jdoe, group_random);
       
        StubEntityRelationDAO groupToRole = new StubEntityRelationDAO(new SecurityEntityRelationTypeImpl(
                JetspeedPrincipalAssociationType.IS_CHILD_OF,
                JetspeedPrincipalType.GROUP,
                JetspeedPrincipalType.ROLE));
       
        groupToRole.relate(null, null, group_board, role_manager);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

                if (this.entityDAOs.get(relationType.getFromEntityType()) == null || this.entityDAOs.get(relationType.getToEntityType()) == null)
                {
                    throw new IllegalArgumentException("Missing EntityDAO for EntityRelationDAO fromEntityType: "+relationType.getFromEntityType() +
                                                       " and/or toEntityType: "+relationType.getToEntityType());
                }
                this.entityRelationDAOs.put(new SecurityEntityRelationTypeImpl(relationType.getRelationType(), relationType.getFromEntityType(), relationType.getToEntityType()),
                                            entityRelationDAO);
                this.entityRelationTypes.get(relationType.getFromEntityType()).add(relationType);
                this.entityRelationTypes.get(relationType.getToEntityType()).add(relationType);
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        return readOnly;
    }
   
    public SecurityEntityRelationType getSupportedEntityRelationType(String relationType, String fromEntityType, String toEntityType)
    {
        SecurityEntityRelationType key = new SecurityEntityRelationTypeImpl(relationType, fromEntityType, toEntityType);
        return entityRelationDAOs.containsKey(key) ? key : null;
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

    }
   
    public void addRelation(String fromEntityId, String toEntityId, SecurityEntityRelationType relationType) throws SecurityException
    {
        checkReadOnly("addRelation");
        EntityRelationDAO dao = entityRelationDAOs.get(relationType instanceof SecurityEntityRelationTypeImpl ? relationType : new SecurityEntityRelationTypeImpl(relationType));
        if (dao != null)
        {
            dao.addRelation(entityDAOs.get(relationType.getFromEntityType()), entityDAOs.get(relationType.getToEntityType()), fromEntityId, toEntityId);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

    }
   
    public void removeRelation(String fromEntityId, String toEntityId, SecurityEntityRelationType relationType) throws SecurityException
    {
        checkReadOnly("removeRelation");
        EntityRelationDAO dao = entityRelationDAOs.get(relationType instanceof SecurityEntityRelationTypeImpl ? relationType : new SecurityEntityRelationTypeImpl(relationType));
        if (dao != null)
        {
            dao.removeRelation(entityDAOs.get(relationType.getFromEntityType()), entityDAOs.get(relationType.getToEntityType()), fromEntityId, toEntityId);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        return dao != null ? dao.getEntity(entityId) : null;
    }

    public void getRelatedEntitiesTo(Entity toEntity, SecurityEntityRelationType relationType, EntitySearchResultHandler handler) throws SecurityException
    {
        EntityRelationDAO relationDAO = entityRelationDAOs.get(relationType instanceof SecurityEntityRelationTypeImpl ? relationType : new SecurityEntityRelationTypeImpl(relationType));
        if (relationDAO != null)
        {
            EntityDAO fromDAO = entityDAOs.get(relationType.getFromEntityType());
            EntityDAO toDAO = entityDAOs.get(relationType.getToEntityType());
            if (fromDAO != null && toDAO != null && toDAO.getEntityType().equals(toEntity.getType()))
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl

        // todo : throw exception, since combination of entity types and relation type is not configured.
    }

    public void getRelatedEntitiesFrom(Entity fromEntity, SecurityEntityRelationType relationType, EntitySearchResultHandler handler) throws SecurityException
    {
        EntityRelationDAO relationDAO = entityRelationDAOs.get(relationType instanceof SecurityEntityRelationTypeImpl ? relationType : new SecurityEntityRelationTypeImpl(relationType));
        if (relationDAO != null)
        {
            EntityDAO fromDAO = entityDAOs.get(relationType.getFromEntityType());
            EntityDAO toDAO = entityDAOs.get(relationType.getToEntityType());
            if (fromDAO != null && toDAO != null && fromDAO.getEntityType().equals(fromEntity.getType()))
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.