((com.sun.xml.wss.saml.assertion.saml11.jaxb20.Assertion)_assertion).toElement(securityHeader);
} else {
((com.sun.xml.wss.saml.assertion.saml11.jaxb10.Assertion)_assertion).toElement(securityHeader);
}
} else {
she = new GSHeaderElement(assertionElement, ((JAXBFilterProcessingContext) context).getSOAPVersion());
if (optSecHeader.getChildElement(she.getId()) == null) {
optSecHeader.add(she);
} else {
return;
}
}
HashMap tokenCache = context.getTokenCache();
//assuming unique IDs
tokenCache.put(((com.sun.xml.wss.saml.Assertion)_assertion).getAssertionID(), _assertion);
} else if (_assertion.getVersion() != null){
if(!isOptimized){
((com.sun.xml.wss.saml.assertion.saml20.jaxb20.Assertion)_assertion).toElement(securityHeader);
} else {
she = new GSHeaderElement(assertionElement, ((JAXBFilterProcessingContext) context).getSOAPVersion());
if (optSecHeader.getChildElement(she.getId()) == null) {
optSecHeader.add(she);
} else {
return;
}
}
HashMap tokenCache = context.getTokenCache();
//assuming unique IDs
tokenCache.put(((com.sun.xml.wss.saml.Assertion)_assertion).getID(), _assertion);
} else {
//Authoritybinding is set. So the Assertion should not be exported
if (null == resolvedPolicy.getSTRID()) {
throw new XWSSecurityException(
"Unsupported configuration: required wsu:Id value " +
" for SecurityTokenReference to Remote SAML Assertion not found " +
" in Policy");
}
}
} else if(reader != null) {
she = new GSHeaderElement(buffer);
she.setId(id); // set the ID again to bring it to top
if (optSecHeader.getChildElement(she.getId()) == null) {
optSecHeader.add(she);
} else {
return;