Package org.apache.jetspeed.security.mapping.model

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


    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

        }
        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

        }
    }
   
    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

    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

    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

        }
        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

        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

TOP

Related Classes of org.apache.jetspeed.security.mapping.model.SecurityEntityRelationType

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.