Search in sources :

Example 26 with SAMLv2Model

use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.

the class SAMLv2SPAdvancedViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        //retrieve the standard metadata values from the property sheet
        Map spStdValues = ps.getAttributeValues(model.getStandardServiceProviderAttributes(realm, entityName), false, model);
        //save the standard metadata values for the Idp
        List acsList = new ArrayList();
        model.setSPStdAttributeValues(realm, entityName, spStdValues, acsList);
        //retrieve the extended metadata values from the property sheet
        Map spExtValues = getExtendedValues();
        Map new_spExtValues = ps.getAttributeValues(model.getSPEXAdDataMap(), false, model);
        spExtValues.putAll(new_spExtValues);
        //save the extended metadata values for the Idp
        model.setSPExtAttributeValues(realm, entityName, spExtValues, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "samlv2.sp.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) HashMap(java.util.HashMap) Map(java.util.Map)

Example 27 with SAMLv2Model

use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.

the class SAMLv2AffiliateViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        CCAddRemove addRemoveList = (CCAddRemove) getChild(model.AFFILIATE_MEMBER);
        addRemoveList.restoreStateData();
        CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) addRemoveList.getModel();
        Set members = new HashSet(getSelectedValues(addRemoveModel));
        if (members.isEmpty() || members == null) {
            throw new AMConsoleException(model.getLocalizedString("samlv2.create.provider.missing.affiliation.members"));
        }
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        Map orig = getStandardAffiliationValues();
        Map values = ps.getAttributeValues(orig, false, model);
        model.setStdAffilationValues(realm, entityName, values, members);
        //save for ext will be done once backend api is ready
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "samlv2.affiliation.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) Set(java.util.Set) HashSet(java.util.HashSet) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 28 with SAMLv2Model

use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.

the class SAMLv2AffiliateViewBean method getExtendedAffiliationValues.

private Map getExtendedAffiliationValues() {
    Map extendedValues = new HashMap();
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        Map attr = model.getExtendedAffiliationyAttributes(realm, entityName);
        Set entries = attr.entrySet();
        Iterator iterator = entries.iterator();
        while (iterator.hasNext()) {
            Map.Entry entry = (Map.Entry) iterator.next();
            String tmp = (String) entry.getKey();
            extendedValues.put((String) entry.getKey(), convertListToSet((List) entry.getValue()));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    return extendedValues;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) Iterator(java.util.Iterator) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Example 29 with SAMLv2Model

use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.

the class SAMLv2AttrAuthorityViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    ps.init();
    SAMLv2Model model = (SAMLv2Model) getModel();
    ps.setAttributeValues(getStandardAttriAuthorityValues(), model);
    ps.setAttributeValues(getExtendedAttriAuthorityValues(), model);
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Example 30 with SAMLv2Model

use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.

the class SAMLv2AttrAuthorityViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        //retrieve the standard metadata values from the property sheet
        Map attrAuthValues = ps.getAttributeValues(model.getStandardAttributeAuthorityAttributes(realm, entityName), false, model);
        //save the standard metadata values for attribute authority
        model.setStdAttributeAuthorityValues(realm, entityName, attrAuthValues);
        //retrieve the extended metadata values from the property sheet
        Map attrAuthExtValues = ps.getAttributeValues(model.getattrAuthEXDataMap(), false, model);
        //save the extended metadata values for attribute authority
        model.setExtAttributeAuthorityValues(realm, entityName, attrAuthExtValues, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "samlv2.attrauth.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)53 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)41 Map (java.util.Map)33 HashMap (java.util.HashMap)29 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)28 List (java.util.List)14 Set (java.util.Set)11 Iterator (java.util.Iterator)9 ArrayList (java.util.ArrayList)7 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)3 HashSet (java.util.HashSet)3 AssertionConsumerServiceElement (com.sun.identity.saml2.jaxb.metadata.AssertionConsumerServiceElement)2 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 EncodeAction (com.sun.identity.security.EncodeAction)1 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1