protected static CSSASMechConfig extractGSSUPDynamic(CSSGSSUPDynamicType gssupType) {
return new CSSGSSUPMechConfigDynamic(gssupType.getDomain());
}
protected static CSSSASMechConfig extractSASMech(CSSSasMechType sasMechType, Bundle bundle) throws DeploymentException {
CSSSASMechConfig result = new CSSSASMechConfig();
if (sasMechType == null) {
result.setIdentityToken(new CSSSASITTAbsent());
} else if (sasMechType.isSetITTAbsent()) {
result.setIdentityToken(new CSSSASITTAbsent());
} else if (sasMechType.isSetITTAnonymous()) {
result.setIdentityToken(new CSSSASITTAnonymous());
} else if (sasMechType.isSetITTPrincipalNameStatic()) {
CSSITTPrincipalNameStaticType principal = sasMechType.getITTPrincipalNameStatic();
result.setIdentityToken(new CSSSASITTPrincipalNameStatic(principal.getOid(), principal.getName()));
} else if (sasMechType.isSetITTPrincipalNameDynamic()) {
CSSITTPrincipalNameDynamicType principal = sasMechType.getITTPrincipalNameDynamic();
String principalClassName = principal.getPrincipalClass();
Class principalClass = null;
try {
principalClass = ClassLoading.loadClass(principalClassName, bundle);
} catch (ClassNotFoundException e) {
throw new DeploymentException("Could not load principal class", e);
}
String domainName = principal.getDomain();
String realmName = null;
if (domainName != null) {
realmName = principal.getRealm();
}
result.setIdentityToken(new CSSSASITTPrincipalNameDynamic(principal.getOid(), principalClass, domainName, realmName));
}
return result;
}