public SSOSite getSiteById(int id) { return ssoSiteManagerSPI.getById(id); }
public SSOSite getSiteByName(String siteName) { return ssoSiteManagerSPI.getByName(siteName); }
public SSOSite getSiteByUrl(String siteUrl) { return ssoSiteManagerSPI.getByUrl(siteUrl); }
public void updateSite(SSOSite site) throws SSOException { SSOSite currentSite = ssoSiteManagerSPI.getById(site.getId()); if (currentSite == null){ throw new SSOException("Unable to update site: site doesn't exist."); } 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); }
public Collection<SSOSite> getSites(String filter) { return ssoSiteManagerSPI.getSites(filter); }
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(); } }
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()); } } ssoSiteManagerSPI.remove(site); }
return ssoSiteManagerSPI.add(site); } catch (SSOException se){
@SuppressWarnings("unchecked") public Collection<SSOSite> getSitesForPrincipal(JetspeedPrincipal localPrincipal) throws SSOException { Collection<SSOSite> sitesFound = null; if (localPrincipal != null){ Collection<SSOUser> ssoUsers = getRemoteUsers(localPrincipal); if (ssoUsers != null && ssoUsers.size() > 0){ sitesFound = ssoSiteManagerSPI.getSites(ssoUsers); } } return sitesFound != null ? sitesFound : Collections.EMPTY_SET; }