Search in sources :

Example 81 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class FSSAMLServiceViewBean method handleTblSiteIDButtonDeleteRequest.

public void handleTblSiteIDButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    Map modifiedValues = null;
    try {
        modifiedValues = getValues(false, false);
    } catch (AMConsoleException e) {
    /* exception will not be thrown because we are instructing
             * AMPropertySheet to return values without doing password
             * validation.
             */
    }
    CCActionTable tbl = (CCActionTable) getChild(TABLE_SITE_ID);
    tbl.restoreStateData();
    Integer[] selected = tblSiteIdModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) modifiedValues.get(TABLE_SITE_ID);
        tblValues.removeAll(selected);
        modifiedValues.put(TABLE_SITE_ID, tblValues);
    }
    setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) modifiedValues);
    setPageSessionAttribute(MODIFIED, "1");
    setValues();
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCActionTable(com.sun.web.ui.view.table.CCActionTable) HashMap(java.util.HashMap) Map(java.util.Map)

Example 82 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class FSSAMLTargetURLsAddViewBean method handleButton1Request.

protected void handleButton1Request(String value) throws AMConsoleException {
    FSSAMLServiceViewBean vb = (FSSAMLServiceViewBean) getViewBean(FSSAMLServiceViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(FSSAMLServiceViewBean.PROPERTY_ATTRIBUTE);
    Set targetURLs = (Set) mapAttrs.get(FSSAMLServiceViewBean.TABLE_TARGET_URLS);
    if ((targetURLs == null) || targetURLs.isEmpty()) {
        targetURLs = new OrderedSet();
        mapAttrs.put(FSSAMLServiceViewBean.TABLE_TARGET_URLS, (OrderedSet) targetURLs);
    }
    if (targetURLs.contains(value)) {
        throw new AMConsoleException("saml.profile.targetURLs.already.exists");
    }
    targetURLs.add(value);
    backTrail();
    unlockPageTrailForSwapping();
    setPageSessionAttribute(FSSAMLServiceViewBean.MODIFIED, "1");
    passPgSessionMap(vb);
    vb.setValues();
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 83 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class FSSAMLTargetURLsEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
        Map mapAttrs = (Map) getPageSessionAttribute(FSSAMLServiceViewBean.PROPERTY_ATTRIBUTE);
        OrderedSet targets = (OrderedSet) mapAttrs.get(FSSAMLServiceViewBean.TABLE_TARGET_URLS);
        setValues((String) targets.get(index));
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Map(java.util.Map)

Example 84 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class FSSAMLTargetURLsEditViewBean method handleButton1Request.

protected void handleButton1Request(String value) throws AMConsoleException {
    FSSAMLServiceViewBean vb = (FSSAMLServiceViewBean) getViewBean(FSSAMLServiceViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(FSSAMLServiceViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet targets = (OrderedSet) mapAttrs.get(FSSAMLServiceViewBean.TABLE_TARGET_URLS);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    int count = 0;
    for (Iterator i = targets.iterator(); i.hasNext(); ) {
        String t = (String) i.next();
        if ((count != index) && t.equals(value)) {
            throw new AMConsoleException("saml.profile.targetURLs.already.exists");
        }
        count++;
    }
    targets.set(index, value);
    backTrail();
    unlockPageTrailForSwapping();
    setPageSessionAttribute(FSSAMLServiceViewBean.MODIFIED, "1");
    passPgSessionMap(vb);
    vb.setValues();
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 85 with OrderedSet

use of com.sun.identity.shared.datastruct.OrderedSet in project OpenAM by OpenRock.

the class FSSAMLSiteIDEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
        Map mapAttrs = (Map) getPageSessionAttribute(FSSAMLServiceViewBean.PROPERTY_ATTRIBUTE);
        OrderedSet siteIDs = (OrderedSet) mapAttrs.get(FSSAMLServiceViewBean.TABLE_SITE_ID);
        setValues(AMPipeDelimitAttrTokenizer.getInstance().tokenizes((String) siteIDs.get(index)));
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Map(java.util.Map)

Aggregations

OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)87 Map (java.util.Map)52 Set (java.util.Set)36 Iterator (java.util.Iterator)20 HashMap (java.util.HashMap)17 HashSet (java.util.HashSet)16 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)13 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)13 CCActionTable (com.sun.web.ui.view.table.CCActionTable)12 AMServiceProfileModel (com.sun.identity.console.base.model.AMServiceProfileModel)6 CaseInsensitiveHashSet (com.sun.identity.common.CaseInsensitiveHashSet)5 ArrayList (java.util.ArrayList)5 LinkedHashSet (java.util.LinkedHashSet)5 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)4 List (java.util.List)4 AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)3 WSAuthHandlerEntry (com.sun.identity.console.webservices.model.WSAuthHandlerEntry)3 IdRepo (com.sun.identity.idm.IdRepo)3 Issuer (com.sun.identity.saml2.assertion.Issuer)3 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)3