Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.SecurityDomain


    protected Long getDefaultSecurityDomainId()
    {
        if (defaultSecurityDomainId == null)
        {
            SecurityDomain d = getDomainByName(SecurityDomain.DEFAULT_NAME);
            if (d != null)
            {
                // cache real default security domain id
                defaultSecurityDomainId = d.getDomainId();
            }
            else
            {
                throw new IllegalStateException("The default security domain could not be found.");
            }
View Full Code Here


    protected Long getDefaultSecurityDomainId()
    {
        if (defaultSecurityDomainId == null)
        {
            SecurityDomain d = getDomainByName(SecurityDomain.DEFAULT_NAME);
            if (d != null)
            {
                // cache real default security domain id
                defaultSecurityDomainId = d.getDomainId();
            }
            else
            {
                throw new IllegalStateException("The default security domain could not be found.");
            }
View Full Code Here

        domainStorageManager.addDomain(sd);
      } catch(SecurityException sx){
        log.error("Could not add remote security domain with name "+site.getName()+" for owner domain "+ownerDomainId);
        throw new SSOException(SSOException.SITE_COULD_NOT_BE_CREATED,sx);
      }
      SecurityDomain storedDomain = domainAccessManager.getDomainByName(site.getName());
      if (storedDomain == null || storedDomain.getDomainId() == null){
        throw new SSOException(SSOException.SITE_COULD_NOT_BE_CREATED);
      }
     
      site.setSecurityDomainId(storedDomain.getDomainId());
     
      try{
            return ssoSiteManagerSPI.add(site);
      } catch (SSOException se){
          // catch SSO Exception to remove already stored domain.
View Full Code Here

       
    }

    public void removeSite(SSOSite site) throws SSOException
    {
        SecurityDomain domain = domainAccessManager.getDomain(site.getSecurityDomainId());
        if (domain != null){
            try{
                domainStorageManager.removeDomain(domain);
            } catch (SecurityException secex){
                throw new SSOException("Unable to remove security domain (id:"+site.getSecurityDomainId()+") associated with the SSO Site "+site.getName());
View Full Code Here

        }
        if (!currentSite.getName().equals(site.getName())){
            if (domainAccessManager.getDomainByName(site.getName()) != null){
                throw new SSOException("Unable to rename site to '"+site.getName()+"': a security domain with that name already exists!");
            }
            SecurityDomain domain = domainAccessManager.getDomain(currentSite.getSecurityDomainId());
            SecurityDomainImpl renamedDomain = new SecurityDomainImpl(domain);
            renamedDomain.setName(site.getName());
            try{
                domainStorageManager.updateDomain(renamedDomain);   
            } catch (SecurityException secex){
                throw new SSOException("Unable to rename security domain "+domain.getName()+" to "+site.getName()+".",secex);
            }           
        }
        ssoSiteManagerSPI.update(site);
    }
View Full Code Here

       
        // Need to ensure required Security Domains are setup.
        domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
        domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");

        SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME);
        if (domain == null){
           
            SecurityDomainImpl newDomain = new SecurityDomainImpl();
            newDomain.setName(SecurityDomain.SYSTEM_NAME);
            domainStorageManager.addDomain(newDomain);
View Full Code Here

    public Collection<JetspeedPrincipal> getPortalPrincipals(SSOUser user)
    {
        SSOSite site = ssoSiteManagerSPI.getSite(user);
        if (site != null){
            SecurityDomain ssoDomain = domainAccessManager.getDomain(site.getSecurityDomainId());
            SecurityDomain ownerDomain = domainAccessManager.getDomain(ssoDomain.getOwnerDomainId());
            return ssoUserManagerSPI.getPortalPrincipals(user,ownerDomain.getDomainId());   
        } else {
            return Collections.emptyList();
        }           
    }
View Full Code Here

        }           
    }

    protected Long getDefaultDomainId(){
        if (defaultDomainId==null){
            SecurityDomain domain=domainAccessManager.getDomainByName(SecurityDomain.DEFAULT_NAME);
            if (domain == null){
                throw new RuntimeException("Could not find default security domain.");
            }
            defaultDomainId=domain.getDomainId();
        }
        return defaultDomainId;   
    }
View Full Code Here

        pms = (PermissionManager) scm.getComponent("org.apache.jetspeed.security.PermissionManager");
        domainStorageManager = (SecurityDomainStorageManager) scm.getComponent(SecurityDomainStorageManager.class.getName());
        domainAccessManager = (SecurityDomainAccessManager) scm.getComponent("org.apache.jetspeed.security.spi.SecurityDomainAccessManager");
       
        // TODO: remove when default seed contains the default domain       
        SecurityDomain domain = domainAccessManager.getDomainByName(SecurityDomain.SYSTEM_NAME);
        if (domain == null){
           
            SecurityDomainImpl newDomain = new SecurityDomainImpl();
            newDomain.setName(SecurityDomain.SYSTEM_NAME);
            domainStorageManager.addDomain(newDomain);
View Full Code Here

            }
        }
    }

    protected SecurityDomain checkDomainExistsOtherwiseCreate(String domainName) throws SecurityException{
        SecurityDomain domain = domainAccessManager.getDomainByName(domainName);
        if (domain == null){
            SecurityDomainImpl newDomain = new SecurityDomainImpl();
            newDomain.setName(domainName);
            newDomain.setEnabled(true);
            newDomain.setRemote(false);
View Full Code Here

TOP

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

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.