Examples of SecurityEntityRelationType


Examples of org.apache.jetspeed.security.mapping.SecurityEntityRelationType

        {
            EntityFactory entityFactory = ldapEntityManager.getEntityFactory(from.getType().getName());
            EntityFactory relatedFactory = ldapEntityManager.getEntityFactory(to.getType().getName());
            Entity fromEntity = entityFactory.createEntity(from);
            Entity toEntity = relatedFactory.createEntity(to);
            SecurityEntityRelationType relationType = new SecurityEntityRelationTypeImpl(associationName, fromEntity.getType(), toEntity.getType());
            ldapEntityManager.addRelation(fromEntity, toEntity, relationType);
        }
        databaseStorageManager.addAssociation(from, to, associationName);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.SecurityEntityRelationType

        {
            EntityFactory entityFactory = ldapEntityManager.getEntityFactory(from.getType().getName());
            EntityFactory relatedFactory = ldapEntityManager.getEntityFactory(to.getType().getName());
            Entity fromEntity = entityFactory.createEntity(from);
            Entity toEntity = relatedFactory.createEntity(to);
            SecurityEntityRelationType relationType = new SecurityEntityRelationTypeImpl(associationName, fromEntity.getType(), toEntity.getType());
            ldapEntityManager.removeRelation(fromEntity, toEntity, relationType);
            databaseStorageManager.removeAssociation(from, to, associationName);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.SecurityEntityRelationType

        public boolean equals(Object obj)
        {
            if (this == obj) return true;
            if (obj == null) return false;
            if (getClass() != obj.getClass()) return false;
            SecurityEntityRelationType other = (SecurityEntityRelationType) obj;
            if (relationType == null)
            {
                if (other.getRelationType() != null) return false;
            } else if (!relationType.equals(other.getRelationType())) return false;
            if (sourceEntityType == null)
            {
                if (other.getFromEntityType() != null) return false;
            } else if (!sourceEntityType.equals(other.getFromEntityType()))
                return false;
            if (targetEntityType == null)
            {
                if (other.getToEntityType() != null) return false;
            } else if (!targetEntityType.equals(other.getToEntityType()))
                return false;
            return true;
        }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            SecurityEntityRelationType relationType = ldapEntityManager.getSupportedEntityRelationType(associationName, from.getType().getName(), to.getType().getName());
            if (relationType != null)
            {
                ldapEntityManager.addRelation(from.getName(), to.getName(), relationType);
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            SecurityEntityRelationType relationType = ldapEntityManager.getSupportedEntityRelationType(associationName, from.getType().getName(), to.getType().getName());
            if (relationType != null)
            {
                ldapEntityManager.removeRelation(from.getName(), to.getName(), relationType);
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

        }
        if (entityRelationDAOs != null)
        {
            for (EntityRelationDAO entityRelationDAO: entityRelationDAOs)
            {
                SecurityEntityRelationType relationType = entityRelationDAO.getRelationType();
                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.model.SecurityEntityRelationType

        }
    }
   
    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.model.SecurityEntityRelationType

    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing() && !ldapEntityManager.isReadOnly())
        {
            SecurityEntityRelationType relationType = ldapEntityManager.getSupportedEntityRelationType(associationName, from.getType().getName(), to.getType().getName());
            if (relationType != null && relationType.isCreateAllowed())
            {
                ldapEntityManager.addRelation(from.getName(), to.getName(), relationType);
            }
        }
        databaseStorageManager.addAssociation(from, to, associationName);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing() && !ldapEntityManager.isReadOnly())
        {
            SecurityEntityRelationType relationType = ldapEntityManager.getSupportedEntityRelationType(associationName, from.getType().getName(), to.getType().getName());
            if (relationType != null && relationType.isRemoveAllowed())
            {
                ldapEntityManager.removeRelation(from.getName(), to.getName(), relationType);
            }
        }
        databaseStorageManager.removeAssociation(from, to, associationName);
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

        }
        if (entityRelationDAOs != null)
        {
            for (EntityRelationDAO entityRelationDAO: entityRelationDAOs)
            {
                SecurityEntityRelationType relationType = entityRelationDAO.getRelationType();
                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
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.