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)
trustId = generateTrustId(securityService);
trustConfig.setId(trustId);
trustConfig.setIsDefault(Boolean.parseBoolean(isDefault));
// create the trust handler
if ( cName != null) {
TrustHandler tHandler = new TrustHandler();
tHandler.setClassName(cName);
securityService.addIdentityAssertionTrust(trustConfig);
if (props != null) {
tHandler.setElementProperty(convertPropertiesToElementProperties(props));
}
trustConfig.setTrustHandler(tHandler);
// return trustId;
return getMBeanRegistry().getMbeanObjectName("trust-handler",
new String[]{getDomainName(), configName, trustId});
}
// ip address is must for trusted entity config
if ( ipAdd != null) {
TrustedEntity tEntity = new TrustedEntity();
if (entityId == null)
entityId = "entityid-0";
tEntity.setId(entityId);
if (trustedAs != null)
tEntity.setTrustedAs(trustedAs);
tEntity.setIpAddress(ipAdd);
tEntity.setPrincipal(principal);
tEntity.setHostName(hostName);
trustConfig.addTrustedEntity(tEntity);
securityService.addIdentityAssertionTrust(trustConfig);
// return trustId;
return getMBeanRegistry().getMbeanObjectName("trusted-entity",
new String[]{getDomainName(), configName, trustId, entityId});
}
TrustHandler tHandler = new TrustHandler();
// use the default trust handler implementation
tHandler.setClassName(DEFAULT_TRUST_HANDLER);
trustConfig.setTrustHandler(tHandler);
securityService.addIdentityAssertionTrust(trustConfig);
// return trustId;
return getMBeanRegistry().getMbeanObjectName("trust-handler",
new String[]{getDomainName(), configName, trustId});