Search in sources :

Example 6 with AttributeQueryDescriptorElement

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;
}
Also used : HashMap(java.util.HashMap) AttributeQueryDescriptorElement(com.sun.identity.saml2.jaxb.metadataextquery.AttributeQueryDescriptorElement) SAML2MetaManager(com.sun.identity.saml2.meta.SAML2MetaManager) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) HashMap(java.util.HashMap) SAML2MetaException(com.sun.identity.saml2.meta.SAML2MetaException)

Aggregations

AttributeQueryDescriptorElement (com.sun.identity.saml2.jaxb.metadataextquery.AttributeQueryDescriptorElement)6 AttributeAuthorityDescriptorElement (com.sun.identity.saml2.jaxb.metadata.AttributeAuthorityDescriptorElement)3 EntityDescriptorElement (com.sun.identity.saml2.jaxb.metadata.EntityDescriptorElement)3 SAML2MetaManager (com.sun.identity.saml2.meta.SAML2MetaManager)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 BaseConfigType (com.sun.identity.saml2.jaxb.entityconfig.BaseConfigType)2 EntityConfigElement (com.sun.identity.saml2.jaxb.entityconfig.EntityConfigElement)2 ObjectFactory (com.sun.identity.saml2.jaxb.entityconfig.ObjectFactory)2 AuthnAuthorityDescriptorElement (com.sun.identity.saml2.jaxb.metadata.AuthnAuthorityDescriptorElement)2 IDPSSODescriptorElement (com.sun.identity.saml2.jaxb.metadata.IDPSSODescriptorElement)2 SPSSODescriptorElement (com.sun.identity.saml2.jaxb.metadata.SPSSODescriptorElement)2 XACMLAuthzDecisionQueryDescriptorElement (com.sun.identity.saml2.jaxb.metadata.XACMLAuthzDecisionQueryDescriptorElement)2 XACMLPDPDescriptorElement (com.sun.identity.saml2.jaxb.metadata.XACMLPDPDescriptorElement)2 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)2 Iterator (java.util.Iterator)2 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)1 AttributeElement (com.sun.identity.saml2.jaxb.assertion.AttributeElement)1 AttributeValueElement (com.sun.identity.saml2.jaxb.assertion.AttributeValueElement)1