use of com.sun.identity.saml2.jaxb.metadataextquery.AttributeQueryDescriptorElement in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method getStandardAttrQueryAttributes.
/**
* Returns a map with standard AttrQuery attributes and values.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @return Map with AttrQuery values.
* @throws AMConsoleException if unable to retrieve std AttrQuery
* values based on the realm and entityName passed.
*/
public Map getStandardAttrQueryAttributes(String realm, String entityName) throws AMConsoleException {
String[] params = { realm, entityName, "SAMLv2", "AttrQuery-Std" };
logEvent("ATTEMPT_GET_ATTR_QUERY_ATTR_VALUES", params);
Map map = new HashMap();
AttributeQueryDescriptorElement attrQueryDescriptor = null;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
attrQueryDescriptor = samlManager.getAttributeQueryDescriptor(realm, entityName);
map.put(ATTR_NAMEID_FORMAT, (OrderedSet) convertListToSet(attrQueryDescriptor.getNameIDFormat()));
logEvent("SUCCEED_GET_ATTR_QUERY_ATTR_VALUES", params);
} catch (SAML2MetaException e) {
debug.warning("SAMLv2ModelImpl.getStandardAttrQueryAttributes:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AttrQuery-Std", strError };
logEvent("FEDERATION_EXCEPTION_GET_ATTR_QUERY_ATTR_VALUES", paramsEx);
throw new AMConsoleException(strError);
}
return map;
}
Aggregations