public ICFGenKbSecGroupIncludeObj readSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId, boolean forceRead) { if (indexByUIncludeIdx == null) { indexByUIncludeIdx = new HashMap<CFGenKbSecGroupIncludeByUIncludeIdxKey, ICFGenKbSecGroupIncludeObj>(); } CFGenKbSecGroupIncludeByUIncludeIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); ICFGenKbSecGroupIncludeObj obj = null; if ((!forceRead) && indexByUIncludeIdx.containsKey(key)) { obj = indexByUIncludeIdx.get(key); } else { CFGenKbSecGroupIncludeBuff buff = schema .getBackingStore() .getTableSecGroupInclude() .readDerivedByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); if (buff != null) { obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey(schema.getBackingStore().getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); obj = (ICFGenKbSecGroupIncludeObj) obj.realize(); } } return (obj); }
public void deleteSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId) { if (indexByUIncludeIdx == null) { indexByUIncludeIdx = new HashMap<CFGenKbSecGroupIncludeByUIncludeIdxKey, ICFGenKbSecGroupIncludeObj>(); } CFGenKbSecGroupIncludeByUIncludeIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); ICFGenKbSecGroupIncludeObj obj = null; if (indexByUIncludeIdx.containsKey(key)) { obj = indexByUIncludeIdx.get(key); schema .getBackingStore() .getTableSecGroupInclude() .deleteSecGroupIncludeByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); obj.forget(true); } else { schema .getBackingStore() .getTableSecGroupInclude() .deleteSecGroupIncludeByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); } }
public void forgetSecGroupInclude(ICFGenKbSecGroupIncludeObj Obj, boolean forgetSubObjects) { ICFGenKbSecGroupIncludeObj obj = Obj; CFGenKbSecGroupIncludePKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFGenKbSecGroupIncludeObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByClusterIdx != null) { CFGenKbSecGroupIncludeByClusterIdxKey keyClusterIdx = schema.getBackingStore().getFactorySecGroupInclude().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.remove(keepObj.getPKey()); } } if (indexByGroupIdx != null) { CFGenKbSecGroupIncludeByGroupIdxKey keyGroupIdx = schema.getBackingStore().getFactorySecGroupInclude().newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.remove(keepObj.getPKey()); } } if (indexByIncludeIdx != null) { CFGenKbSecGroupIncludeByIncludeIdxKey keyIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.remove(keepObj.getPKey()); } } if (indexByUIncludeIdx != null) { CFGenKbSecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); keyUIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUIncludeIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); keyUIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); indexByUIncludeIdx.remove(keyUIncludeIdx); } if (allSecGroupInclude != null) { allSecGroupInclude.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) {} } }
public void forgetSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId) { if (indexByUIncludeIdx == null) { return; } CFGenKbSecGroupIncludeByUIncludeIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); if (indexByUIncludeIdx.containsKey(key)) { ICFGenKbSecGroupIncludeObj probed = indexByUIncludeIdx.get(key); if (probed != null) { probed.forget(true); } indexByUIncludeIdx.remove(key); } }
public ICFGenKbSecGroupIncludeObj realizeSecGroupInclude(ICFGenKbSecGroupIncludeObj Obj) { ICFGenKbSecGroupIncludeObj obj = Obj; CFGenKbSecGroupIncludePKey pkey = obj.getPKey(); ICFGenKbSecGroupIncludeObj keepObj = null; if (members.containsKey(pkey)) { ICFGenKbSecGroupIncludeObj 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) { CFGenKbSecGroupIncludeByClusterIdxKey keyClusterIdx = schema.getBackingStore().getFactorySecGroupInclude().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.remove(keepObj.getPKey()); } } if (indexByGroupIdx != null) { CFGenKbSecGroupIncludeByGroupIdxKey keyGroupIdx = schema.getBackingStore().getFactorySecGroupInclude().newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.remove(keepObj.getPKey()); } } if (indexByIncludeIdx != null) { CFGenKbSecGroupIncludeByIncludeIdxKey keyIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.remove(keepObj.getPKey()); } } if (indexByUIncludeIdx != null) { CFGenKbSecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); keyUIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUIncludeIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); keyUIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); indexByUIncludeIdx.remove(keyUIncludeIdx); } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByClusterIdx != null) { CFGenKbSecGroupIncludeByClusterIdxKey keyClusterIdx = schema.getBackingStore().getFactorySecGroupInclude().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByGroupIdx != null) { CFGenKbSecGroupIncludeByGroupIdxKey keyGroupIdx = schema.getBackingStore().getFactorySecGroupInclude().newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.put(keepObj.getPKey(), keepObj); } } if (indexByIncludeIdx != null) { CFGenKbSecGroupIncludeByIncludeIdxKey keyIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUIncludeIdx != null) { CFGenKbSecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); keyUIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUIncludeIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); keyUIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); indexByUIncludeIdx.put(keyUIncludeIdx, keepObj); } if (allSecGroupInclude != null) { allSecGroupInclude.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 (allSecGroupInclude != null) { allSecGroupInclude.put(keepObj.getPKey(), keepObj); } if (indexByClusterIdx != null) { CFGenKbSecGroupIncludeByClusterIdxKey keyClusterIdx = schema.getBackingStore().getFactorySecGroupInclude().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByGroupIdx != null) { CFGenKbSecGroupIncludeByGroupIdxKey keyGroupIdx = schema.getBackingStore().getFactorySecGroupInclude().newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.put(keepObj.getPKey(), keepObj); } } if (indexByIncludeIdx != null) { CFGenKbSecGroupIncludeByIncludeIdxKey keyIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUIncludeIdx != null) { CFGenKbSecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = schema.getBackingStore().getFactorySecGroupInclude().newUIncludeIdxKey(); keyUIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUIncludeIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); keyUIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); indexByUIncludeIdx.put(keyUIncludeIdx, keepObj); } } return (keepObj); }