Search in sources :

Example 71 with OrderedSet

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

the class SMDiscoveryBootstrapRefOffEditViewBean method handleButton1Request.

protected void handleButton1Request(SMDiscoEntryData smData) throws AMConsoleException {
    SMDiscoveryServiceViewBean vb = (SMDiscoveryServiceViewBean) getViewBean(SMDiscoveryServiceViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(SMDiscoveryServiceViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet resoff = (OrderedSet) mapAttrs.get(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
    SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(resoff);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    smEntry.replaceResourceData(index, smData);
    mapAttrs.put(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, (OrderedSet) smEntry.getDiscoveryEntries());
    setPageSessionAttribute(SMDiscoveryServiceViewBean.PROPERTY_ATTRIBUTE, (HashMap) mapAttrs);
    setPageSessionAttribute(SMDiscoveryServiceViewBean.PAGE_MODIFIED, "1");
    backTrail();
    unlockPageTrailForSwapping();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) HashMap(java.util.HashMap) Map(java.util.Map)

Example 72 with OrderedSet

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

the class SCSAML2SOAPBindingRequestHandlerListDupViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (dupIndex != -1) {
        Map mapAttrs = (Map) getPageSessionAttribute(SCSAML2SOAPBindingViewBean.PROPERTY_ATTRIBUTE);
        OrderedSet set = (OrderedSet) mapAttrs.get(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
        setValues((String) set.get(dupIndex));
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Map(java.util.Map)

Example 73 with OrderedSet

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

the class SCSAML2SOAPBindingRequestHandlerListEditViewBean method handleButton1Request.

protected void handleButton1Request(Map values) throws AMConsoleException {
    SCSAML2SOAPBindingViewBean vb = (SCSAML2SOAPBindingViewBean) getViewBean(SCSAML2SOAPBindingViewBean.class);
    Map mapAttrs = (Map) getPageSessionAttribute(SCSAML2SOAPBindingViewBean.PROPERTY_ATTRIBUTE);
    OrderedSet serverList = (OrderedSet) mapAttrs.get(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    String val = SAML2SOAPBindingRequestHandler.toString((String) values.get(ATTR_KEY), (String) values.get(ATTR_CLASS));
    int count = 0;
    for (Iterator i = serverList.iterator(); i.hasNext(); ) {
        String v = (String) i.next();
        if ((count != index) && v.equals(val)) {
            throw new AMConsoleException("soapBinding.service.requestHandlerList.already.exist");
        }
        count++;
    }
    serverList.set(index, val);
    setPageSessionAttribute(SCSAML2SOAPBindingViewBean.PAGE_MODIFIED, "1");
    backTrail();
    unlockPageTrailForSwapping();
    passPgSessionMap(vb);
    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 74 with OrderedSet

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

the class SCSAML2SOAPBindingViewBean method handleTblRequestHandlerListButtonDeleteRequest.

/**
     * Handles remove request handlers request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblRequestHandlerListButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
        tblValues.removeAll(selected);
        setPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, tblValues);
        populateRequestHandlerListTable(tblValues);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
        setPageSessionAttribute(PAGE_MODIFIED, "1");
    }
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 75 with OrderedSet

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

the class SCSOAPBindingRequestHandlerListAddViewBean method handleButton1Request.

protected void handleButton1Request(Map values) throws AMConsoleException {
    SCSOAPBindingViewBean vb = (SCSOAPBindingViewBean) getViewBean(SCSOAPBindingViewBean.class);
    Map attrValues = (Map) getPageSessionAttribute(SCSOAPBindingViewBean.PROPERTY_ATTRIBUTE);
    Set handlers = (Set) attrValues.get(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    if ((handlers == null) || handlers.isEmpty()) {
        handlers = new OrderedSet();
        attrValues.put(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, (OrderedSet) handlers);
    }
    String val = SOAPBindingRequestHandler.toString((String) values.get(ATTR_KEY), (String) values.get(ATTR_CLASS), (String) values.get(ATTR_ACTION));
    if (handlers.contains(val)) {
        throw new AMConsoleException("soapBinding.service.requestHandlerList.already.exist");
    }
    handlers.add(val);
    setPageSessionAttribute(SCSOAPBindingViewBean.PAGE_MODIFIED, "1");
    backTrail();
    unlockPageTrailForSwapping();
    passPgSessionMap(vb);
    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)

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