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); domainStorageManager.addDomain(newDomain); domain = domainAccessManager.getDomainByName(domainName); } return domain; }
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); }
SecurityDomainImpl sd = new SecurityDomainImpl(); sd.setName(site.getName()); sd.setOwnerDomainId(ownerDomainId); sd.setEnabled(true); sd.setRemote(true);
SecurityDomainImpl newDomain = new SecurityDomainImpl(); newDomain.setName(jsDomain.getName()); newDomain.setOwnerDomainId(ownerDomainId); newDomain.setRemote(jsDomain.isRemote()); newDomain.setEnabled(jsDomain.isEnabled()); try{ domainStorageManager.addDomain(newDomain);