public ICFSecuritySecAppObj realizeSecApp(ICFSecuritySecAppObj Obj) { ICFSecuritySecAppObj obj = Obj; CFSecuritySecAppPKey pkey = obj.getPKey(); ICFSecuritySecAppObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFSecuritySecAppObj existingObj = members.get(pkey); keepObj = existingObj; /* * We always rebind the data because if we're being called, some index has * been updated and is refreshing it's data, which may or may not have changed */ // Detach object from alternate and duplicate indexes, leave PKey alone if (indexByClusterIdx != null) { CFSecuritySecAppByClusterIdxKey keyClusterIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecAppPKey, ICFSecuritySecAppObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.remove(keepObj.getPKey()); } } if (indexByUJEEMountIdx != null) { CFSecuritySecAppByUJEEMountIdxKey keyUJEEMountIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newUJEEMountIdxKey(); keyUJEEMountIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUJEEMountIdx.setRequiredJEEMountName(keepObj.getRequiredJEEMountName()); indexByUJEEMountIdx.remove(keyUJEEMountIdx); } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByClusterIdx != null) { CFSecuritySecAppByClusterIdxKey keyClusterIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecAppPKey, ICFSecuritySecAppObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUJEEMountIdx != null) { CFSecuritySecAppByUJEEMountIdxKey keyUJEEMountIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newUJEEMountIdxKey(); keyUJEEMountIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUJEEMountIdx.setRequiredJEEMountName(keepObj.getRequiredJEEMountName()); indexByUJEEMountIdx.put(keyUJEEMountIdx, keepObj); } if (allSecApp != null) { allSecApp.put(keepObj.getPKey(), keepObj); } } else { keepObj = obj; keepObj.setIsNew(false); // Attach new object to PKey, all, alternate, and duplicate indexes members.put(keepObj.getPKey(), keepObj); if (allSecApp != null) { allSecApp.put(keepObj.getPKey(), keepObj); } if (indexByClusterIdx != null) { CFSecuritySecAppByClusterIdxKey keyClusterIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecAppPKey, ICFSecuritySecAppObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUJEEMountIdx != null) { CFSecuritySecAppByUJEEMountIdxKey keyUJEEMountIdx = ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newUJEEMountIdxKey(); keyUJEEMountIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUJEEMountIdx.setRequiredJEEMountName(keepObj.getRequiredJEEMountName()); indexByUJEEMountIdx.put(keyUJEEMountIdx, keepObj); } } return (keepObj); }