if (jsDomain.getOwnerDomain().equals(SecurityDomain.SYSTEM_NAME)){
ownerDomainId=defaultDomainId;
} else if (jsDomain.getOwnerDomain().equals(SecurityDomain.SYSTEM_NAME)) {
ownerDomainId=systemDomainId;
} else {
SecurityDomain ownerDomain = domainAccessManager.getDomainByName(jsDomain.getOwnerDomain());
if (ownerDomain == null){
throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create(new String[] { "SecurityDomain","Could not find owner domain with name "+jsDomain.getOwnerDomain()+"for domain with name "+jsDomain.getName()}));
}
ownerDomainId=ownerDomain.getDomainId();
}
} else {
// remote domains always need an owner domain. Set the default domain if owner domain is not specified
if (jsDomain.isRemote()){
ownerDomainId=defaultDomainId;