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 CFSecurityISOLanguageBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFInternetRamISOLanguage.readAllBuff"; CFSecurityISOLanguageBuff buff; ArrayList<CFSecurityISOLanguageBuff> filteredList = new ArrayList<CFSecurityISOLanguageBuff>(); CFSecurityISOLanguageBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ISLN")) { filteredList.add(buff); } } return (filteredList.toArray(new CFSecurityISOLanguageBuff[0])); }
public CFAccFeeBuff[] readBuffByTenantIdx(CFSecurityAuthorization Authorization, long TenantId) { final String S_ProcName = "CFAccRamFee.readBuffByTenantIdx() "; CFAccFeeBuff buff; ArrayList<CFAccFeeBuff> filteredList = new ArrayList<CFAccFeeBuff>(); CFAccFeeBuff[] buffList = readDerivedByTenantIdx(Authorization, TenantId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("FEE")) { filteredList.add((CFAccFeeBuff) buff); } } return (filteredList.toArray(new CFAccFeeBuff[0])); }
public CFSecuritySecGroupMemberBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFFreeSwitchRamSecGroupMember.readAllBuff"; CFSecuritySecGroupMemberBuff buff; ArrayList<CFSecuritySecGroupMemberBuff> filteredList = new ArrayList<CFSecuritySecGroupMemberBuff>(); CFSecuritySecGroupMemberBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("SGMB")) { filteredList.add(buff); } } return (filteredList.toArray(new CFSecuritySecGroupMemberBuff[0])); }
public CFSecurityServiceBuff[] readBuffByTypeIdx( CFSecurityAuthorization Authorization, int ServiceTypeId) { final String S_ProcName = "CFBamRamService.readBuffByTypeIdx() "; CFSecurityServiceBuff buff; ArrayList<CFSecurityServiceBuff> filteredList = new ArrayList<CFSecurityServiceBuff>(); CFSecurityServiceBuff[] buffList = readDerivedByTypeIdx(Authorization, ServiceTypeId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("HSVC")) { filteredList.add((CFSecurityServiceBuff) buff); } } return (filteredList.toArray(new CFSecurityServiceBuff[0])); }
public CFBamUuidDefBuff[] readBuffByNextIdx( CFSecurityAuthorization Authorization, Long NextTenantId, Long NextId) { final String S_ProcName = "CFBamRamValue.readBuffByNextIdx() "; CFBamUuidDefBuff buff; ArrayList<CFBamUuidDefBuff> filteredList = new ArrayList<CFBamUuidDefBuff>(); CFBamUuidDefBuff[] buffList = readDerivedByNextIdx(Authorization, NextTenantId, NextId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VALU")) { filteredList.add((CFBamUuidDefBuff) buff); } } return (filteredList.toArray(new CFBamUuidDefBuff[0])); }
public CFDbTestLoaderBehaviourBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFDbTestRamLoaderBehaviour.readAllBuff"; CFDbTestLoaderBehaviourBuff buff; ArrayList<CFDbTestLoaderBehaviourBuff> filteredList = new ArrayList<CFDbTestLoaderBehaviourBuff>(); CFDbTestLoaderBehaviourBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("LDBV")) { filteredList.add(buff); } } return (filteredList.toArray(new CFDbTestLoaderBehaviourBuff[0])); }
public CFSecuritySecFormBuff[] readBuffBySecAppIdx( CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) { final String S_ProcName = "CFInternetRamSecForm.readBuffBySecAppIdx() "; CFSecuritySecFormBuff buff; ArrayList<CFSecuritySecFormBuff> filteredList = new ArrayList<CFSecuritySecFormBuff>(); CFSecuritySecFormBuff[] buffList = readDerivedBySecAppIdx(Authorization, ClusterId, SecAppId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("SFRM")) { filteredList.add((CFSecuritySecFormBuff) buff); } } return (filteredList.toArray(new CFSecuritySecFormBuff[0])); }
public CFBamUuidDefBuff[] readDerivedByContNextIdx( CFSecurityAuthorization Authorization, long TenantId, long ScopeId, Long NextId) { final String S_ProcName = "CFBamRamValue.readDerivedByContNextIdx"; CFBamValueBuff buffList[] = schema.getTableValue().readDerivedByContNextIdx(Authorization, TenantId, ScopeId, NextId); if (buffList == null) { return (null); } else { CFBamValueBuff buff; ArrayList<CFBamUuidDefBuff> filteredList = new ArrayList<CFBamUuidDefBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof CFBamUuidDefBuff)) { filteredList.add((CFBamUuidDefBuff) buff); } } return (filteredList.toArray(new CFBamUuidDefBuff[0])); } }
public CFBamUuidDefBuff[] readDerivedByVAccSecIdx( CFSecurityAuthorization Authorization, ICFBamSchema.AccessSecurityEnum ViewAccessSecurity) { final String S_ProcName = "CFBamRamValue.readDerivedByVAccSecIdx"; CFBamValueBuff buffList[] = schema.getTableValue().readDerivedByVAccSecIdx(Authorization, ViewAccessSecurity); if (buffList == null) { return (null); } else { CFBamValueBuff buff; ArrayList<CFBamUuidDefBuff> filteredList = new ArrayList<CFBamUuidDefBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof CFBamUuidDefBuff)) { filteredList.add((CFBamUuidDefBuff) buff); } } return (filteredList.toArray(new CFBamUuidDefBuff[0])); } }
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); }