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;
}
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;
}
Aggregations