Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.SecurityException


        {
            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
                                                                   "revokeAllPermissions",
                                                                   pbe.getMessage());
            logger.error(msg, pbe);
            throw new SecurityException(msg, pbe);
        }
    }
View Full Code Here


   
    public void addDomain(SecurityDomain domain) throws SecurityException
    {
        if (domainExists(domain))
        {
            throw new SecurityException(SecurityException.SECURITY_DOMAIN_EXISTS.create(domain.getName()));
        }
        try
        {
            getPersistenceBrokerTemplate().store(domain);
        }
        catch (Exception pbe)
        {
            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
                                                                   "addDomain",
                                                                   pbe.getMessage());
            logger.error(msg, pbe);
            throw new SecurityException(msg, pbe);           
        }
    }
View Full Code Here

   
    public void removeDomain(SecurityDomain domain) throws SecurityException
    {
        if (!domainExists(domain))
        {
            throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.create(domain.getName()));
        }
        try
        {
            getPersistenceBrokerTemplate().delete(domain);
        }
        catch (Exception pbe)
        {
            if (pbe instanceof DataIntegrityViolationException)
            {
                logger.error(pbe.getMessage(), pbe);
                throw new SecurityException(SecurityException.SECURITY_DOMAIN_NOT_REMOVABLE.create(domain.getName()));
            }
           
            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
                                                                   "removeDomain",
                                                                   pbe.getMessage());
            logger.error(msg, pbe);
            throw new SecurityException(msg, pbe);           
        }
       
    }
View Full Code Here

    }
   
    public void updateDomain(SecurityDomain domain) throws SecurityException
    {
         if (!domainExists(domain)){
             throw new SecurityException(SecurityException.SECURITY_DOMAIN_DOES_NOT_EXIST.create(domain.getName()));
         }
         try
         {
             getPersistenceBrokerTemplate().store(domain);
         }
         catch (Exception pbe)
         {
             if (pbe instanceof DataIntegrityViolationException)
             {
                 logger.error(pbe.getMessage(), pbe);
                 throw new SecurityException(SecurityException.SECURITY_DOMAIN_UPDATE_FAILURE.create(domain.getDomainId()));
             }
            
             KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
                                                                    "updateDomain",
                                                                    pbe.getMessage());
             logger.error(msg, pbe);
             throw new SecurityException(msg, pbe);           
         }
    }
View Full Code Here

            // 1) check whether entity exists and
            // 2) fetch all LDAP attributes (mapped and not mapped) + fill the internal ID
            liveParentEntity = parentEntityDao.getEntity(parentEntity.getId());
            if (liveParentEntity == null)
            {
                throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(parentEntity.getType(), parentEntity.getId()));
            }
            dao.add(entity, liveParentEntity);
        }
    }
View Full Code Here

        verifyUserPrincipal(userPrincipal);

        String uid = userPrincipal.getName();
        if (isUserPrincipal(uid))
        {
            throw new SecurityException(SecurityException.USER_ALREADY_EXISTS.create(uid));
        }
        ldap.create(uid);
    }
View Full Code Here

     */
    private void validate(String uid, String password) throws SecurityException
    {
        if (StringUtils.isEmpty(password))
        {
            throw new SecurityException(SecurityException.EMPTY_PARAMETER.create("password"));
        }

        if (StringUtils.isEmpty(uid))
        {
            throw new SecurityException(SecurityException.EMPTY_PARAMETER.create("uid"));
        }
    }
View Full Code Here

    {
        GroupPrincipal group = getGroup(groupFullPathName);
        RolePrincipal role = getRole(roleFullPathName);
        if ((null == group) && (null == role))
        {
            throw new SecurityException(SecurityException.ROLE_DOES_NOT_EXIST);
        }
    }
View Full Code Here

    {
        UserPrincipal user = getUser(username);
        GroupPrincipal group = getGroup(groupFullPathName);
        if ((null == user) && (null == group))
        {
            throw new SecurityException(SecurityException.USER_DOES_NOT_EXIST);
        }
    }   
View Full Code Here

    {
        UserPrincipal user = getUser(username);
        RolePrincipal role = getRole(roleFullPathName);
        if ((null == user) && (null == role))
        {
            throw new SecurityException(SecurityException.USER_DOES_NOT_EXIST);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.SecurityException

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.