public void forgetSecGroupIncludeByIncludeIdx(long ClusterId, int IncludeGroupId) { if (indexByIncludeIdx == null) { return; } CFSecuritySecGroupIncludeByIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredIncludeGroupId(IncludeGroupId); if (indexByIncludeIdx.containsKey(key)) { Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(key); if (mapIncludeIdx != null) { List<ICFSecuritySecGroupIncludeObj> toForget = new LinkedList<ICFSecuritySecGroupIncludeObj>(); ICFSecuritySecGroupIncludeObj cur = null; Iterator<ICFSecuritySecGroupIncludeObj> 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 ICFSecuritySecGroupIncludeObj readSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId, boolean forceRead) { if (indexByUIncludeIdx == null) { indexByUIncludeIdx = new HashMap<CFSecuritySecGroupIncludeByUIncludeIdxKey, ICFSecuritySecGroupIncludeObj>(); } CFSecuritySecGroupIncludeByUIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); ICFSecuritySecGroupIncludeObj obj = null; if ((!forceRead) && indexByUIncludeIdx.containsKey(key)) { obj = indexByUIncludeIdx.get(key); } else { CFSecuritySecGroupIncludeBuff buff = ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .readDerivedByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); if (buff != null) { obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); obj = (ICFSecuritySecGroupIncludeObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByUIncludeIdx.put(key, null); } } return (obj); }
public void deleteSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId) { if (indexByUIncludeIdx == null) { indexByUIncludeIdx = new HashMap<CFSecuritySecGroupIncludeByUIncludeIdxKey, ICFSecuritySecGroupIncludeObj>(); } CFSecuritySecGroupIncludeByUIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); ICFSecuritySecGroupIncludeObj obj = null; if (indexByUIncludeIdx.containsKey(key)) { obj = indexByUIncludeIdx.get(key); ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .deleteSecGroupIncludeByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); obj.forget(true); } else { ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .deleteSecGroupIncludeByUIncludeIdx( schema.getAuthorization(), ClusterId, SecGroupId, IncludeGroupId); } }
public ICFBamDataScopeObj readDataScopeByUNameIdx(String Name, boolean forceRead) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFBamDataScopeByUNameIdxKey, ICFBamDataScopeObj>(); } CFBamDataScopeByUNameIdxKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); key.setRequiredName(Name); ICFBamDataScopeObj obj = null; if ((!forceRead) && indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); } else { CFBamDataScopeBuff buff = ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .readDerivedByUNameIdx(schema.getAuthorization(), Name); if (buff != null) { obj = schema.getDataScopeTableObj().newInstance(); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey()); obj.setBuff(buff); obj = (ICFBamDataScopeObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByUNameIdx.put(key, null); } } return (obj); }
public ICFSecuritySecGroupIncludeObj readSecGroupInclude( CFSecuritySecGroupIncludePKey pkey, boolean forceRead) { ICFSecuritySecGroupIncludeObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFSecuritySecGroupIncludeBuff readBuff = ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .readDerivedByIdIdx( schema.getAuthorization(), pkey.getRequiredClusterId(), pkey.getRequiredSecGroupIncludeId()); if (readBuff != null) { obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactorySecGroupInclude().newPKey()); obj.setBuff(readBuff); obj = (ICFSecuritySecGroupIncludeObj) obj.realize(); } else if (schema.getCacheMisses()) { members.put(pkey, null); } } return (obj); }
public ICFSecurityISOCountryObj readISOCountryByISOCodeIdx(String ISOCode, boolean forceRead) { if (indexByISOCodeIdx == null) { indexByISOCodeIdx = new HashMap<CFSecurityISOCountryByISOCodeIdxKey, ICFSecurityISOCountryObj>(); } CFSecurityISOCountryByISOCodeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newISOCodeIdxKey(); key.setRequiredISOCode(ISOCode); ICFSecurityISOCountryObj obj = null; if ((!forceRead) && indexByISOCodeIdx.containsKey(key)) { obj = indexByISOCodeIdx.get(key); } else { CFSecurityISOCountryBuff buff = ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .readDerivedByISOCodeIdx(schema.getAuthorization(), ISOCode); if (buff != null) { obj = schema.getISOCountryTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey()); obj.setBuff(buff); obj = (ICFSecurityISOCountryObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByISOCodeIdx.put(key, null); } } return (obj); }
public void forgetISOCountryByIdIdx(short Id) { if (members == null) { return; } CFSecurityISOCountryPKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey(); key.setRequiredId(Id); if (members.containsKey(key)) { ICFSecurityISOCountryObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public void forgetDataScopeByIdIdx(short Id) { if (members == null) { return; } CFBamDataScopePKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey(); key.setRequiredId(Id); if (members.containsKey(key)) { ICFBamDataScopeObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public void forgetSecGroupIncludeByIdIdx(long ClusterId, long SecGroupIncludeId) { if (members == null) { return; } CFSecuritySecGroupIncludePKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactorySecGroupInclude().newPKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupIncludeId(SecGroupIncludeId); if (members.containsKey(key)) { ICFSecuritySecGroupIncludeObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public void forgetDataScopeByUNameIdx(String Name) { if (indexByUNameIdx == null) { return; } CFBamDataScopeByUNameIdxKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); key.setRequiredName(Name); if (indexByUNameIdx.containsKey(key)) { ICFBamDataScopeObj probed = indexByUNameIdx.get(key); if (probed != null) { probed.forget(true); } indexByUNameIdx.remove(key); } }
public void forgetISOCountryByNameIdx(String Name) { if (indexByNameIdx == null) { return; } CFSecurityISOCountryByNameIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); key.setRequiredName(Name); if (indexByNameIdx.containsKey(key)) { ICFSecurityISOCountryObj probed = indexByNameIdx.get(key); if (probed != null) { probed.forget(true); } indexByNameIdx.remove(key); } }
public ICFBamDataScopeObj realizeDataScope(ICFBamDataScopeObj Obj) { ICFBamDataScopeObj obj = Obj; CFBamDataScopePKey pkey = obj.getPKey(); ICFBamDataScopeObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFBamDataScopeObj 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 (indexByUNameIdx != null) { CFBamDataScopeByUNameIdxKey keyUNameIdx = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); keyUNameIdx.setRequiredName(keepObj.getRequiredName()); indexByUNameIdx.remove(keyUNameIdx); } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByUNameIdx != null) { CFBamDataScopeByUNameIdxKey keyUNameIdx = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); keyUNameIdx.setRequiredName(keepObj.getRequiredName()); indexByUNameIdx.put(keyUNameIdx, keepObj); } if (allDataScope != null) { allDataScope.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 (allDataScope != null) { allDataScope.put(keepObj.getPKey(), keepObj); } if (indexByUNameIdx != null) { CFBamDataScopeByUNameIdxKey keyUNameIdx = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); keyUNameIdx.setRequiredName(keepObj.getRequiredName()); indexByUNameIdx.put(keyUNameIdx, keepObj); } } return (keepObj); }
public void deleteDataScopeByUNameIdx(String Name) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFBamDataScopeByUNameIdxKey, ICFBamDataScopeObj>(); } CFBamDataScopeByUNameIdxKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); key.setRequiredName(Name); ICFBamDataScopeObj obj = null; if (indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .deleteDataScopeByUNameIdx(schema.getAuthorization(), Name); obj.forget(true); } else { ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .deleteDataScopeByUNameIdx(schema.getAuthorization(), Name); } }
public ICFBamDataScopeObj readDataScope(CFBamDataScopePKey pkey, boolean forceRead) { ICFBamDataScopeObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFBamDataScopeBuff readBuff = ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .readDerivedByIdIdx(schema.getAuthorization(), pkey.getRequiredId()); if (readBuff != null) { obj = schema.getDataScopeTableObj().newInstance(); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey()); obj.setBuff(readBuff); obj = (ICFBamDataScopeObj) obj.realize(); } else if (schema.getCacheMisses()) { members.put(pkey, null); } } return (obj); }
public void deleteISOCountryByNameIdx(String Name) { if (indexByNameIdx == null) { indexByNameIdx = new HashMap<CFSecurityISOCountryByNameIdxKey, ICFSecurityISOCountryObj>(); } CFSecurityISOCountryByNameIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); key.setRequiredName(Name); ICFSecurityISOCountryObj obj = null; if (indexByNameIdx.containsKey(key)) { obj = indexByNameIdx.get(key); ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .deleteISOCountryByNameIdx(schema.getAuthorization(), Name); obj.forget(true); } else { ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .deleteISOCountryByNameIdx(schema.getAuthorization(), Name); } }
public void forgetSecGroupIncludeByUIncludeIdx( long ClusterId, int SecGroupId, int IncludeGroupId) { if (indexByUIncludeIdx == null) { return; } CFSecuritySecGroupIncludeByUIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newUIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); key.setRequiredIncludeGroupId(IncludeGroupId); if (indexByUIncludeIdx.containsKey(key)) { ICFSecuritySecGroupIncludeObj probed = indexByUIncludeIdx.get(key); if (probed != null) { probed.forget(true); } indexByUIncludeIdx.remove(key); } }
public void forgetDataScope(ICFBamDataScopeObj Obj, boolean forgetSubObjects) { ICFBamDataScopeObj obj = Obj; CFBamDataScopePKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFBamDataScopeObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByUNameIdx != null) { CFBamDataScopeByUNameIdxKey keyUNameIdx = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newUNameIdxKey(); keyUNameIdx.setRequiredName(keepObj.getRequiredName()); indexByUNameIdx.remove(keyUNameIdx); } if (allDataScope != null) { allDataScope.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) {} } }
public void deleteSecGroupIncludeByIncludeIdx(long ClusterId, int IncludeGroupId) { CFSecuritySecGroupIncludeByIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredIncludeGroupId(IncludeGroupId); if (indexByIncludeIdx == null) { indexByIncludeIdx = new HashMap< CFSecuritySecGroupIncludeByIncludeIdxKey, Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj>>(); } if (indexByIncludeIdx.containsKey(key)) { Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> dict = indexByIncludeIdx.get(key); ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .deleteSecGroupIncludeByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId); Iterator<ICFSecuritySecGroupIncludeObj> iter = dict.values().iterator(); ICFSecuritySecGroupIncludeObj obj; List<ICFSecuritySecGroupIncludeObj> toForget = new LinkedList<ICFSecuritySecGroupIncludeObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByIncludeIdx.remove(key); } else { ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .deleteSecGroupIncludeByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId); } }
public void minimizeMemory() { allDataScope = null; indexByUNameIdx = null; List<ICFBamDataScopeObj> toForget = new LinkedList<ICFBamDataScopeObj>(); ICFBamDataScopeObj cur = null; Iterator<ICFBamDataScopeObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); if (cur.getEdit() == null) { toForget.add(cur); } } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
public void minimizeMemory() { allISOCountry = null; indexByISOCodeIdx = null; indexByNameIdx = null; List<ICFSecurityISOCountryObj> toForget = new LinkedList<ICFSecurityISOCountryObj>(); ICFSecurityISOCountryObj cur = null; Iterator<ICFSecurityISOCountryObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); if (cur.getEdit() == null) { toForget.add(cur); } } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
public void minimizeMemory() { allSecGroupInclude = null; indexByClusterIdx = null; indexByGroupIdx = null; indexByIncludeIdx = null; indexByUIncludeIdx = null; List<ICFSecuritySecGroupIncludeObj> toForget = new LinkedList<ICFSecuritySecGroupIncludeObj>(); ICFSecuritySecGroupIncludeObj cur = null; Iterator<ICFSecuritySecGroupIncludeObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); if (cur.getEdit() == null) { toForget.add(cur); } } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
public void forgetISOCountry(ICFSecurityISOCountryObj Obj, boolean forgetSubObjects) { ICFSecurityISOCountryObj obj = Obj; CFSecurityISOCountryPKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFSecurityISOCountryObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByISOCodeIdx != null) { CFSecurityISOCountryByISOCodeIdxKey keyISOCodeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountry() .newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(keepObj.getRequiredISOCode()); indexByISOCodeIdx.remove(keyISOCodeIdx); } if (indexByNameIdx != null) { CFSecurityISOCountryByNameIdxKey keyNameIdx = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); keyNameIdx.setRequiredName(keepObj.getRequiredName()); indexByNameIdx.remove(keyNameIdx); } if (allISOCountry != null) { allISOCountry.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) { ((ICFSecuritySchemaObj) schema) .getISOCountryCurrencyTableObj() .forgetISOCountryCurrencyByCountryIdx(keepObj.getRequiredId()); ((ICFSecuritySchemaObj) schema) .getISOCountryLanguageTableObj() .forgetISOCountryLanguageByCountryIdx(keepObj.getRequiredId()); } } }
public List<ICFSecuritySecGroupIncludeObj> readSecGroupIncludeByIncludeIdx( long ClusterId, int IncludeGroupId, boolean forceRead) { final String S_ProcName = "readSecGroupIncludeByIncludeIdx"; CFSecuritySecGroupIncludeByIncludeIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredIncludeGroupId(IncludeGroupId); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> dict; if (indexByIncludeIdx == null) { indexByIncludeIdx = new HashMap< CFSecuritySecGroupIncludeByIncludeIdxKey, Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj>>(); } if ((!forceRead) && indexByIncludeIdx.containsKey(key)) { dict = indexByIncludeIdx.get(key); } else { dict = new HashMap<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj>(); // Allow other threads to dirty-read while we're loading indexByIncludeIdx.put(key, dict); ICFSecuritySecGroupIncludeObj obj; CFSecuritySecGroupIncludeBuff[] buffList = ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .readDerivedByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId); CFSecuritySecGroupIncludeBuff buff; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = schema.getSecGroupIncludeTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); ICFSecuritySecGroupIncludeObj realized = (ICFSecuritySecGroupIncludeObj) obj.realize(); } } Comparator<ICFSecuritySecGroupIncludeObj> cmp = new Comparator<ICFSecuritySecGroupIncludeObj>() { public int compare(ICFSecuritySecGroupIncludeObj lhs, ICFSecuritySecGroupIncludeObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFSecuritySecGroupIncludePKey lhsPKey = lhs.getPKey(); CFSecuritySecGroupIncludePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = dict.size(); ICFSecuritySecGroupIncludeObj arr[] = new ICFSecuritySecGroupIncludeObj[len]; Iterator<ICFSecuritySecGroupIncludeObj> 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<ICFSecuritySecGroupIncludeObj> arrayList = new ArrayList<ICFSecuritySecGroupIncludeObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFSecuritySecGroupIncludeObj> sortedList = arrayList; return (sortedList); }
public List<ICFSecuritySecGroupIncludeObj> readAllSecGroupInclude(boolean forceRead) { final String S_ProcName = "readAllSecGroupInclude"; if ((allSecGroupInclude == null) || forceRead) { Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> map = new HashMap<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj>(); allSecGroupInclude = map; CFSecuritySecGroupIncludeBuff[] buffList = ((ICFInternetSchema) schema.getBackingStore()) .getTableSecGroupInclude() .readAllDerived(schema.getAuthorization()); CFSecuritySecGroupIncludeBuff buff; ICFSecuritySecGroupIncludeObj obj; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactorySecGroupInclude().newPKey()); obj.setBuff(buff); ICFSecuritySecGroupIncludeObj realized = (ICFSecuritySecGroupIncludeObj) obj.realize(); } } Comparator<ICFSecuritySecGroupIncludeObj> cmp = new Comparator<ICFSecuritySecGroupIncludeObj>() { public int compare(ICFSecuritySecGroupIncludeObj lhs, ICFSecuritySecGroupIncludeObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFSecuritySecGroupIncludePKey lhsPKey = lhs.getPKey(); CFSecuritySecGroupIncludePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = allSecGroupInclude.size(); ICFSecuritySecGroupIncludeObj arr[] = new ICFSecuritySecGroupIncludeObj[len]; Iterator<ICFSecuritySecGroupIncludeObj> 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<ICFSecuritySecGroupIncludeObj> arrayList = new ArrayList<ICFSecuritySecGroupIncludeObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFSecuritySecGroupIncludeObj> sortedList = arrayList; return (sortedList); }
public ICFSecuritySecGroupIncludeObj realizeSecGroupInclude(ICFSecuritySecGroupIncludeObj Obj) { ICFSecuritySecGroupIncludeObj obj = Obj; CFSecuritySecGroupIncludePKey pkey = obj.getPKey(); ICFSecuritySecGroupIncludeObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFSecuritySecGroupIncludeObj 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) { CFSecuritySecGroupIncludeByClusterIdxKey keyClusterIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.remove(keepObj.getPKey()); } } if (indexByGroupIdx != null) { CFSecuritySecGroupIncludeByGroupIdxKey keyGroupIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.remove(keepObj.getPKey()); } } if (indexByIncludeIdx != null) { CFSecuritySecGroupIncludeByIncludeIdxKey keyIncludeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.remove(keepObj.getPKey()); } } if (indexByUIncludeIdx != null) { CFSecuritySecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = ((ICFInternetSchema) 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) { CFSecuritySecGroupIncludeByClusterIdxKey keyClusterIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByGroupIdx != null) { CFSecuritySecGroupIncludeByGroupIdxKey keyGroupIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.put(keepObj.getPKey(), keepObj); } } if (indexByIncludeIdx != null) { CFSecuritySecGroupIncludeByIncludeIdxKey keyIncludeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUIncludeIdx != null) { CFSecuritySecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = ((ICFInternetSchema) 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) { CFSecuritySecGroupIncludeByClusterIdxKey keyClusterIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.put(keepObj.getPKey(), keepObj); } } if (indexByGroupIdx != null) { CFSecuritySecGroupIncludeByGroupIdxKey keyGroupIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.put(keepObj.getPKey(), keepObj); } } if (indexByIncludeIdx != null) { CFSecuritySecGroupIncludeByIncludeIdxKey keyIncludeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.put(keepObj.getPKey(), keepObj); } } if (indexByUIncludeIdx != null) { CFSecuritySecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newUIncludeIdxKey(); keyUIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyUIncludeIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); keyUIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); indexByUIncludeIdx.put(keyUIncludeIdx, keepObj); } } return (keepObj); }
public void forgetSecGroupInclude(ICFSecuritySecGroupIncludeObj Obj, boolean forgetSubObjects) { ICFSecuritySecGroupIncludeObj obj = Obj; CFSecuritySecGroupIncludePKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFSecuritySecGroupIncludeObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByClusterIdx != null) { CFSecuritySecGroupIncludeByClusterIdxKey keyClusterIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapClusterIdx = indexByClusterIdx.get(keyClusterIdx); if (mapClusterIdx != null) { mapClusterIdx.remove(keepObj.getPKey()); } } if (indexByGroupIdx != null) { CFSecuritySecGroupIncludeByGroupIdxKey keyGroupIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newGroupIdxKey(); keyGroupIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyGroupIdx.setRequiredSecGroupId(keepObj.getRequiredSecGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapGroupIdx = indexByGroupIdx.get(keyGroupIdx); if (mapGroupIdx != null) { mapGroupIdx.remove(keepObj.getPKey()); } } if (indexByIncludeIdx != null) { CFSecuritySecGroupIncludeByIncludeIdxKey keyIncludeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactorySecGroupInclude() .newIncludeIdxKey(); keyIncludeIdx.setRequiredClusterId(keepObj.getRequiredClusterId()); keyIncludeIdx.setRequiredIncludeGroupId(keepObj.getRequiredIncludeGroupId()); Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx = indexByIncludeIdx.get(keyIncludeIdx); if (mapIncludeIdx != null) { mapIncludeIdx.remove(keepObj.getPKey()); } } if (indexByUIncludeIdx != null) { CFSecuritySecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = ((ICFInternetSchema) 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) {} } }