}
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);
}
}