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 void deleteClearTopDepByContTblIdx(long TenantId, long ContTableId) { CFBamClearTopDepByContTblIdxKey key = schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredContTableId(ContTableId); if (indexByContTblIdx == null) { indexByContTblIdx = new HashMap<CFBamClearTopDepByContTblIdxKey, Map<CFBamScopePKey, ICFBamClearTopDepObj>>(); } if (indexByContTblIdx.containsKey(key)) { Map<CFBamScopePKey, ICFBamClearTopDepObj> dict = indexByContTblIdx.get(key); schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByContTblIdx(schema.getAuthorization(), TenantId, ContTableId); Iterator<ICFBamClearTopDepObj> iter = dict.values().iterator(); ICFBamClearTopDepObj obj; List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByContTblIdx.remove(key); } else { schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByContTblIdx(schema.getAuthorization(), TenantId, ContTableId); } }
public void forgetSecDeviceByUserIdx(UUID SecUserId) { if (indexByUserIdx == null) { return; } CFSecuritySecDeviceByUserIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); key.setRequiredSecUserId(SecUserId); if (indexByUserIdx.containsKey(key)) { Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(key); if (mapUserIdx != null) { List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>(); ICFSecuritySecDeviceObj cur = null; Iterator<ICFSecuritySecDeviceObj> iter = mapUserIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByUserIdx.remove(key); } }
public void deleteSecDeviceByUserIdx(UUID SecUserId) { CFSecuritySecDeviceByUserIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); key.setRequiredSecUserId(SecUserId); if (indexByUserIdx == null) { indexByUserIdx = new HashMap< CFSecuritySecDeviceByUserIdxKey, Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj>>(); } if (indexByUserIdx.containsKey(key)) { Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> dict = indexByUserIdx.get(key); ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecDevice() .deleteSecDeviceByUserIdx(schema.getAuthorization(), SecUserId); Iterator<ICFSecuritySecDeviceObj> iter = dict.values().iterator(); ICFSecuritySecDeviceObj obj; List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByUserIdx.remove(key); } else { ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecDevice() .deleteSecDeviceByUserIdx(schema.getAuthorization(), SecUserId); } }
public void forgetClearTopDepByContTblIdx(long TenantId, long ContTableId) { if (indexByContTblIdx == null) { return; } CFBamClearTopDepByContTblIdxKey key = schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredContTableId(ContTableId); if (indexByContTblIdx.containsKey(key)) { Map<CFBamScopePKey, ICFBamClearTopDepObj> mapContTblIdx = indexByContTblIdx.get(key); if (mapContTblIdx != null) { List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>(); ICFBamClearTopDepObj cur = null; Iterator<ICFBamClearTopDepObj> iter = mapContTblIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByContTblIdx.remove(key); } }
public List<ICFAccTaxObj> readAllTax(boolean forceRead) { final String S_ProcName = "readAllTax"; if ((allTax == null) || forceRead) { Map<CFAccTaxPKey, ICFAccTaxObj> map = new HashMap<CFAccTaxPKey, ICFAccTaxObj>(); allTax = map; CFAccTaxBuff[] buffList = ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .readAllDerived(schema.getAuthorization()); CFAccTaxBuff buff; ICFAccTaxObj obj; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = newInstance(); obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey()); obj.setBuff(buff); ICFAccTaxObj realized = (ICFAccTaxObj) obj.realize(); } } Comparator<ICFAccTaxObj> cmp = new Comparator<ICFAccTaxObj>() { public int compare(ICFAccTaxObj lhs, ICFAccTaxObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFAccTaxPKey lhsPKey = lhs.getPKey(); CFAccTaxPKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = allTax.size(); ICFAccTaxObj arr[] = new ICFAccTaxObj[len]; Iterator<ICFAccTaxObj> valIter = allTax.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<ICFAccTaxObj> arrayList = new ArrayList<ICFAccTaxObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFAccTaxObj> sortedList = arrayList; return (sortedList); }
public void forgetTaxByTenantIdx(long TenantId) { if (indexByTenantIdx == null) { return; } CFAccTaxByTenantIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (indexByTenantIdx.containsKey(key)) { Map<CFAccTaxPKey, ICFAccTaxObj> mapTenantIdx = indexByTenantIdx.get(key); if (mapTenantIdx != null) { List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); ICFAccTaxObj cur = null; Iterator<ICFAccTaxObj> iter = mapTenantIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByTenantIdx.remove(key); } }
public void forgetISOCountryCurrencyByCurrencyIdx(short ISOCurrencyId) { if (indexByCurrencyIdx == null) { return; } CFSecurityISOCountryCurrencyByCurrencyIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountryCurrency() .newCurrencyIdxKey(); key.setRequiredISOCurrencyId(ISOCurrencyId); if (indexByCurrencyIdx.containsKey(key)) { Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj> mapCurrencyIdx = indexByCurrencyIdx.get(key); if (mapCurrencyIdx != null) { List<ICFSecurityISOCountryCurrencyObj> toForget = new LinkedList<ICFSecurityISOCountryCurrencyObj>(); ICFSecurityISOCountryCurrencyObj cur = null; Iterator<ICFSecurityISOCountryCurrencyObj> iter = mapCurrencyIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByCurrencyIdx.remove(key); } }
public void deleteTaxByTenantIdx(long TenantId) { CFAccTaxByTenantIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (indexByTenantIdx == null) { indexByTenantIdx = new HashMap<CFAccTaxByTenantIdxKey, Map<CFAccTaxPKey, ICFAccTaxObj>>(); } if (indexByTenantIdx.containsKey(key)) { Map<CFAccTaxPKey, ICFAccTaxObj> dict = indexByTenantIdx.get(key); ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId); Iterator<ICFAccTaxObj> iter = dict.values().iterator(); ICFAccTaxObj obj; List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByTenantIdx.remove(key); } else { ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId); } }
public void forgetDomainBySubDomIdx(long TenantId, long SubDomainOfId) { if (indexBySubDomIdx == null) { return; } CFInternetDomainBySubDomIdxKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDomain().newSubDomIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredSubDomainOfId(SubDomainOfId); if (indexBySubDomIdx.containsKey(key)) { Map<CFInternetDomainBasePKey, ICFInternetDomainObj> mapSubDomIdx = indexBySubDomIdx.get(key); if (mapSubDomIdx != null) { List<ICFInternetDomainObj> toForget = new LinkedList<ICFInternetDomainObj>(); ICFInternetDomainObj cur = null; Iterator<ICFInternetDomainObj> iter = mapSubDomIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexBySubDomIdx.remove(key); } }
public void minimizeMemory() { allSecDevice = null; indexByUserIdx = null; List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>(); ICFSecuritySecDeviceObj cur = null; Iterator<ICFSecuritySecDeviceObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
public void minimizeMemory() { allTax = null; indexByTenantIdx = null; indexByUNameIdx = null; List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); ICFAccTaxObj cur = null; Iterator<ICFAccTaxObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
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() { allMemo = null; indexByTenantIdx = null; indexByMemoContactIdx = null; indexByUDescrIdx = null; List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>(); ICFCrmMemoObj cur = null; Iterator<ICFCrmMemoObj> 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 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 deleteISOCountryCurrencyByCurrencyIdx(short ISOCurrencyId) { CFSecurityISOCountryCurrencyByCurrencyIdxKey key = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountryCurrency() .newCurrencyIdxKey(); key.setRequiredISOCurrencyId(ISOCurrencyId); if (indexByCurrencyIdx == null) { indexByCurrencyIdx = new HashMap< CFSecurityISOCountryCurrencyByCurrencyIdxKey, Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj>>(); } if (indexByCurrencyIdx.containsKey(key)) { Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj> dict = indexByCurrencyIdx.get(key); ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountryCurrency() .deleteISOCountryCurrencyByCurrencyIdx(schema.getAuthorization(), ISOCurrencyId); Iterator<ICFSecurityISOCountryCurrencyObj> iter = dict.values().iterator(); ICFSecurityISOCountryCurrencyObj obj; List<ICFSecurityISOCountryCurrencyObj> toForget = new LinkedList<ICFSecurityISOCountryCurrencyObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByCurrencyIdx.remove(key); } else { ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountryCurrency() .deleteISOCountryCurrencyByCurrencyIdx(schema.getAuthorization(), ISOCurrencyId); } }
public List<ICFAccTaxObj> readTaxByTenantIdx(long TenantId, boolean forceRead) { final String S_ProcName = "readTaxByTenantIdx"; CFAccTaxByTenantIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey(); key.setRequiredTenantId(TenantId); Map<CFAccTaxPKey, ICFAccTaxObj> dict; if (indexByTenantIdx == null) { indexByTenantIdx = new HashMap<CFAccTaxByTenantIdxKey, Map<CFAccTaxPKey, ICFAccTaxObj>>(); } if ((!forceRead) && indexByTenantIdx.containsKey(key)) { dict = indexByTenantIdx.get(key); } else { dict = new HashMap<CFAccTaxPKey, ICFAccTaxObj>(); // Allow other threads to dirty-read while we're loading indexByTenantIdx.put(key, dict); ICFAccTaxObj obj; CFAccTaxBuff[] buffList = ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .readDerivedByTenantIdx(schema.getAuthorization(), TenantId); CFAccTaxBuff buff; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = schema.getTaxTableObj().newInstance(); obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey()); obj.setBuff(buff); ICFAccTaxObj realized = (ICFAccTaxObj) obj.realize(); } } Comparator<ICFAccTaxObj> cmp = new Comparator<ICFAccTaxObj>() { public int compare(ICFAccTaxObj lhs, ICFAccTaxObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFAccTaxPKey lhsPKey = lhs.getPKey(); CFAccTaxPKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = dict.size(); ICFAccTaxObj arr[] = new ICFAccTaxObj[len]; Iterator<ICFAccTaxObj> 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<ICFAccTaxObj> arrayList = new ArrayList<ICFAccTaxObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFAccTaxObj> sortedList = arrayList; return (sortedList); }