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 forgetSecGroupIncludeByIncludeIdx(long ClusterId, int IncludeGroupId) { if (indexByIncludeIdx == null) { return; } CFGenKbSecGroupIncludeByIncludeIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredIncludeGroupId(IncludeGroupId); if (indexByIncludeIdx.containsKey(key)) { Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(key); if (mapIncludeIdx != null) { List<ICFGenKbSecGroupIncludeObj> toForget = new LinkedList<ICFGenKbSecGroupIncludeObj>(); ICFGenKbSecGroupIncludeObj cur = null; Iterator<ICFGenKbSecGroupIncludeObj> iter = mapIncludeIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByIncludeIdx.remove(key); } }
public void deleteSecGroupIncludeByIdIdx(long ClusterId, long SecGroupIncludeId) { CFGenKbSecGroupIncludePKey pkey = schema.getBackingStore().getFactorySecGroupInclude().newPKey(); pkey.setRequiredClusterId(ClusterId); pkey.setRequiredSecGroupIncludeId(SecGroupIncludeId); ICFGenKbSecGroupIncludeObj obj = readSecGroupInclude(pkey); if (obj != null) { ICFGenKbSecGroupIncludeEditObj editObj = (ICFGenKbSecGroupIncludeEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFGenKbSecGroupIncludeEditObj) obj.beginEdit(); if (editObj != null) { editStarted = true; } else { editStarted = false; } } else { editStarted = false; } if (editObj != null) { editObj.delete(); if (editStarted) { editObj.endEdit(); } } obj.forget(true); } }
public void deleteSecGroupInclude(ICFGenKbSecGroupIncludeObj Obj) { ICFGenKbSecGroupIncludeObj obj = Obj; schema .getBackingStore() .getTableSecGroupInclude() .deleteSecGroupInclude(schema.getAuthorization(), obj.getSecGroupIncludeBuff()); obj.forget(true); }
public ICFGenKbSecGroupIncludeObj lockSecGroupInclude(CFGenKbSecGroupIncludePKey pkey) { ICFGenKbSecGroupIncludeObj locked = null; CFGenKbSecGroupIncludeBuff lockBuff = schema .getBackingStore() .getTableSecGroupInclude() .lockDerived(schema.getAuthorization(), pkey); if (lockBuff != null) { locked = schema.getSecGroupIncludeTableObj().newInstance(); locked.setPKey(schema.getBackingStore().getFactorySecGroupInclude().newPKey()); locked.setBuff(lockBuff); locked = (ICFGenKbSecGroupIncludeObj) locked.realize(); } else { throw CFLib.getDefaultExceptionFactory() .newCollisionDetectedException(getClass(), "lockSecGroupInclude", pkey); } return (locked); }
public ICFGenKbSecGroupIncludeObj readSecGroupIncludeByIdIdx( long ClusterId, long SecGroupIncludeId, boolean forceRead) { CFGenKbSecGroupIncludePKey pkey = schema.getBackingStore().getFactorySecGroupInclude().newPKey(); pkey.setRequiredClusterId(ClusterId); pkey.setRequiredSecGroupIncludeId(SecGroupIncludeId); ICFGenKbSecGroupIncludeObj obj = readSecGroupInclude(pkey, forceRead); return (obj); }
public ICFGenKbSecGroupIncludeObj updateSecGroupInclude(ICFGenKbSecGroupIncludeObj Obj) { ICFGenKbSecGroupIncludeObj obj = Obj; schema .getBackingStore() .getTableSecGroupInclude() .updateSecGroupInclude(schema.getAuthorization(), Obj.getSecGroupIncludeBuff()); obj = (ICFGenKbSecGroupIncludeObj) Obj.realize(); return (obj); }
public ICFGenKbSecGroupIncludeObj createSecGroupInclude(ICFGenKbSecGroupIncludeObj Obj) { ICFGenKbSecGroupIncludeObj obj = Obj; CFGenKbSecGroupIncludeBuff buff = obj.getSecGroupIncludeBuff(); schema .getBackingStore() .getTableSecGroupInclude() .createSecGroupInclude(schema.getAuthorization(), buff); obj.copyBuffToPKey(); obj = obj.realize(); return (obj); }
public CFGenKbISOCountryLanguageBuff getBuff() { if (buff == null) { if (isNew) { buff = schema.getBackingStore().getFactoryISOCountryLanguage().newBuff(); } else { // Read the data buff via the backing store buff = schema .getBackingStore() .getTableISOCountryLanguage() .readDerivedByIdIdx( schema.getAuthorization(), getPKey().getRequiredISOCountryId(), getPKey().getRequiredISOLanguageId()); if (buff != null) { copyBuffToPKey(); } } } return (buff); }
public void forgetSecGroupIncludeByIdIdx(long ClusterId, long SecGroupIncludeId) { if (members == null) { return; } CFGenKbSecGroupIncludePKey key = schema.getBackingStore().getFactorySecGroupInclude().newPKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupIncludeId(SecGroupIncludeId); if (members.containsKey(key)) { ICFGenKbSecGroupIncludeObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public ICFGenKbSecGroupIncludeObj readSecGroupInclude( CFGenKbSecGroupIncludePKey pkey, boolean forceRead) { ICFGenKbSecGroupIncludeObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFGenKbSecGroupIncludeBuff readBuff = schema .getBackingStore() .getTableSecGroupInclude() .readDerivedByIdIdx( schema.getAuthorization(), pkey.getRequiredClusterId(), pkey.getRequiredSecGroupIncludeId()); if (readBuff != null) { obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey(schema.getBackingStore().getFactorySecGroupInclude().newPKey()); obj.setBuff(readBuff); obj = (ICFGenKbSecGroupIncludeObj) obj.realize(); } } return (obj); }
public void deleteSecGroupIncludeByGroupIdx(long ClusterId, int SecGroupId) { CFGenKbSecGroupIncludeByGroupIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newGroupIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); if (indexByGroupIdx == null) { indexByGroupIdx = new HashMap< CFGenKbSecGroupIncludeByGroupIdxKey, Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj>>(); } if (indexByGroupIdx.containsKey(key)) { Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> dict = indexByGroupIdx.get(key); schema .getBackingStore() .getTableSecGroupInclude() .deleteSecGroupIncludeByGroupIdx(schema.getAuthorization(), ClusterId, SecGroupId); Iterator<ICFGenKbSecGroupIncludeObj> iter = dict.values().iterator(); ICFGenKbSecGroupIncludeObj obj; List<ICFGenKbSecGroupIncludeObj> toForget = new LinkedList<ICFGenKbSecGroupIncludeObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByGroupIdx.remove(key); } else { schema .getBackingStore() .getTableSecGroupInclude() .deleteSecGroupIncludeByGroupIdx(schema.getAuthorization(), ClusterId, SecGroupId); } }
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 List<ICFGenKbSecGroupIncludeObj> readSecGroupIncludeByIncludeIdx( long ClusterId, int IncludeGroupId, boolean forceRead) { final String S_ProcName = "readSecGroupIncludeByIncludeIdx"; CFGenKbSecGroupIncludeByIncludeIdxKey key = schema.getBackingStore().getFactorySecGroupInclude().newIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredIncludeGroupId(IncludeGroupId); Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> dict; if (indexByIncludeIdx == null) { indexByIncludeIdx = new HashMap< CFGenKbSecGroupIncludeByIncludeIdxKey, Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj>>(); } if ((!forceRead) && indexByIncludeIdx.containsKey(key)) { dict = indexByIncludeIdx.get(key); } else { dict = new HashMap<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj>(); // Allow other threads to dirty-read while we're loading indexByIncludeIdx.put(key, dict); ICFGenKbSecGroupIncludeObj obj; CFGenKbSecGroupIncludeBuff[] buffList = schema .getBackingStore() .getTableSecGroupInclude() .readDerivedByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId); CFGenKbSecGroupIncludeBuff buff; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey(schema.getBackingStore().getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); ICFGenKbSecGroupIncludeObj realized = (ICFGenKbSecGroupIncludeObj) obj.realize(); } } Comparator<ICFGenKbSecGroupIncludeObj> cmp = new Comparator<ICFGenKbSecGroupIncludeObj>() { public int compare(ICFGenKbSecGroupIncludeObj lhs, ICFGenKbSecGroupIncludeObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFGenKbSecGroupIncludePKey lhsPKey = lhs.getPKey(); CFGenKbSecGroupIncludePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = dict.size(); ICFGenKbSecGroupIncludeObj arr[] = new ICFGenKbSecGroupIncludeObj[len]; Iterator<ICFGenKbSecGroupIncludeObj> valIter = dict.values().iterator(); int idx = 0; while ((idx < len) && valIter.hasNext()) { arr[idx++] = valIter.next(); } if (idx < len) { throw CFLib.getDefaultExceptionFactory() .newArgumentUnderflowException(getClass(), S_ProcName, 0, "idx", idx, len); } else if (valIter.hasNext()) { throw CFLib.getDefaultExceptionFactory() .newArgumentOverflowException(getClass(), S_ProcName, 0, "idx", idx, len); } Arrays.sort(arr, cmp); ArrayList<ICFGenKbSecGroupIncludeObj> arrayList = new ArrayList<ICFGenKbSecGroupIncludeObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFGenKbSecGroupIncludeObj> sortedList = arrayList; return (sortedList); }
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); }
public CFGenKbISOCountryLanguagePKey getPKey() { if (pKey == null) { pKey = schema.getBackingStore().getFactoryISOCountryLanguage().newPKey(); } return (pKey); }
public List<ICFGenKbSecGroupIncludeObj> readAllSecGroupInclude(boolean forceRead) { final String S_ProcName = "readAllSecGroupInclude"; if ((allSecGroupInclude == null) || forceRead) { Map<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj> map = new HashMap<CFGenKbSecGroupIncludePKey, ICFGenKbSecGroupIncludeObj>(); allSecGroupInclude = map; CFGenKbSecGroupIncludeBuff[] buffList = schema .getBackingStore() .getTableSecGroupInclude() .readAllDerived(schema.getAuthorization()); CFGenKbSecGroupIncludeBuff buff; ICFGenKbSecGroupIncludeObj obj; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = newInstance(); obj.setPKey(schema.getBackingStore().getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); ICFGenKbSecGroupIncludeObj realized = (ICFGenKbSecGroupIncludeObj) obj.realize(); } } Comparator<ICFGenKbSecGroupIncludeObj> cmp = new Comparator<ICFGenKbSecGroupIncludeObj>() { public int compare(ICFGenKbSecGroupIncludeObj lhs, ICFGenKbSecGroupIncludeObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFGenKbSecGroupIncludePKey lhsPKey = lhs.getPKey(); CFGenKbSecGroupIncludePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = allSecGroupInclude.size(); ICFGenKbSecGroupIncludeObj arr[] = new ICFGenKbSecGroupIncludeObj[len]; Iterator<ICFGenKbSecGroupIncludeObj> valIter = allSecGroupInclude.values().iterator(); int idx = 0; while ((idx < len) && valIter.hasNext()) { arr[idx++] = valIter.next(); } if (idx < len) { throw CFLib.getDefaultExceptionFactory() .newArgumentUnderflowException(getClass(), S_ProcName, 0, "idx", idx, len); } else if (valIter.hasNext()) { throw CFLib.getDefaultExceptionFactory() .newArgumentOverflowException(getClass(), S_ProcName, 0, "idx", idx, len); } Arrays.sort(arr, cmp); ArrayList<ICFGenKbSecGroupIncludeObj> arrayList = new ArrayList<ICFGenKbSecGroupIncludeObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFGenKbSecGroupIncludeObj> sortedList = arrayList; return (sortedList); }