}
// can have either trust handler or trusted entity not both
if (cName != null && (ipAdd != null || hostName != null || principal != null)) {
String msg = _strMgr.getString("EitherTrustHandlerOrTrustedEntity");
throw new MBeanConfigException(msg);
}
if (cName == null && (ipAdd == null && (hostName != null || principal != null || trustedAs != null))) {
String msg = _strMgr.getString("IpAddMustforTrustedEntity");
throw new MBeanConfigException(msg);
}
if (entityId != null && ipAdd == null) {
String msg = _strMgr.getString("IpAddMustforTrustedEntity");
throw new MBeanConfigException(msg);
}
// identity assertion trust
IdentityAssertionTrust trustConfig = securityService.getIdentityAssertionTrustById(trustId);
if (trustConfig != null)
{
String msg = _strMgr.getString("IdentityTrustAlreadyExists", trustId);
throw new MBeanConfigException(msg);
}
// we have to create it
trustConfig = new IdentityAssertionTrust();
if (trustId == null)