Search in sources :

Example 51 with CaseInsensitiveHashMap

use of com.sun.identity.common.CaseInsensitiveHashMap in project OpenAM by OpenRock.

the class IdServicesImpl method reverseMapAttributeNames.

private Map reverseMapAttributeNames(Map attrMap, Map configMap) {
    if (attrMap == null || attrMap.isEmpty()) {
        return attrMap;
    }
    Map resultMap;
    Map[] mapArray = getAttributeNameMap(configMap);
    if (mapArray == null) {
        resultMap = attrMap;
    } else {
        resultMap = new CaseInsensitiveHashMap();
        Map reverseMap = mapArray[1];
        Iterator it = attrMap.keySet().iterator();
        while (it.hasNext()) {
            String curr = (String) it.next();
            if (reverseMap.containsKey(curr)) {
                resultMap.put((String) reverseMap.get(curr), attrMap.get(curr));
            } else {
                // if there wasn't an attribute mapped with the same name already
                if (!resultMap.containsKey(curr)) {
                    DEBUG.message("IdServicesImpl.reverseMapAttributeNames(): " + "adding unmapped attribute " + curr);
                    resultMap.put(curr, attrMap.get(curr));
                }
            }
        }
    }
    return resultMap;
}
Also used : Iterator(java.util.Iterator) Map(java.util.Map) AMHashMap(com.iplanet.am.sdk.AMHashMap) HashMap(java.util.HashMap) CaseInsensitiveHashMap(com.sun.identity.common.CaseInsensitiveHashMap) CaseInsensitiveHashMap(com.sun.identity.common.CaseInsensitiveHashMap)

Example 52 with CaseInsensitiveHashMap

use of com.sun.identity.common.CaseInsensitiveHashMap in project OpenAM by OpenRock.

the class IdRepoJAXRPCObjectImpl method getAttributes2_idrepo.

public Map getAttributes2_idrepo(String token, String type, String name, String amOrgName, String amsdkDN) throws RemoteException, IdRepoException, SSOException {
    SSOToken ssoToken = getSSOToken(token);
    IdType idtype = IdUtils.getType(type);
    Map res = idServices.getAttributes(ssoToken, idtype, name, amOrgName, amsdkDN);
    if (res != null && res instanceof CaseInsensitiveHashMap) {
        Map res2 = new HashMap();
        Iterator it = res.keySet().iterator();
        while (it.hasNext()) {
            Object attr = it.next();
            Set set = (Set) res.get(attr);
            set = XMLUtils.encodeAttributeSet(set, idRepoDebug);
            res2.put(attr, set);
        }
        res = res2;
    }
    return res;
}
Also used : SSOToken(com.iplanet.sso.SSOToken) HashSet(java.util.HashSet) NotificationSet(com.iplanet.services.comm.share.NotificationSet) Set(java.util.Set) HashMap(java.util.HashMap) CaseInsensitiveHashMap(com.sun.identity.common.CaseInsensitiveHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Iterator(java.util.Iterator) HashMap(java.util.HashMap) CaseInsensitiveHashMap(com.sun.identity.common.CaseInsensitiveHashMap) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) IdType(com.sun.identity.idm.IdType) CaseInsensitiveHashMap(com.sun.identity.common.CaseInsensitiveHashMap)

Aggregations

CaseInsensitiveHashMap (com.sun.identity.common.CaseInsensitiveHashMap)52 HashMap (java.util.HashMap)40 Map (java.util.Map)38 Set (java.util.Set)35 HashSet (java.util.HashSet)34 CaseInsensitiveHashSet (com.sun.identity.common.CaseInsensitiveHashSet)23 Iterator (java.util.Iterator)22 AMHashMap (com.iplanet.am.sdk.AMHashMap)13 CollectionUtils.asSet (org.forgerock.openam.utils.CollectionUtils.asSet)8 LinkedHashSet (java.util.LinkedHashSet)6 SSOException (com.iplanet.sso.SSOException)5 AMIdentity (com.sun.identity.idm.AMIdentity)5 IdRepoUnsupportedOpException (com.sun.identity.idm.IdRepoUnsupportedOpException)5 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)5 IdRepoException (com.sun.identity.idm.IdRepoException)4 ByteString (org.forgerock.opendj.ldap.ByteString)4 SMSException (com.sun.identity.sm.SMSException)3 File (java.io.File)3 CollectionUtils.asOrderedSet (org.forgerock.openam.utils.CollectionUtils.asOrderedSet)3 Test (org.testng.annotations.Test)3