public CFSecurityServiceBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFBamRamService.readAllBuff"; CFSecurityServiceBuff buff; ArrayList<CFSecurityServiceBuff> filteredList = new ArrayList<CFSecurityServiceBuff>(); CFSecurityServiceBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("HSVC")) { filteredList.add(buff); } } return (filteredList.toArray(new CFSecurityServiceBuff[0])); }
public CFSecurityServiceBuff[] readBuffByHostIdx( CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "CFBamRamService.readBuffByHostIdx() "; CFSecurityServiceBuff buff; ArrayList<CFSecurityServiceBuff> filteredList = new ArrayList<CFSecurityServiceBuff>(); CFSecurityServiceBuff[] buffList = readDerivedByHostIdx(Authorization, ClusterId, HostNodeId); 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 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<ICFInternetDomainObj> readDomainBySubDomIdx( long TenantId, long SubDomainOfId, boolean forceRead) { final String S_ProcName = "readDomainBySubDomIdx"; CFInternetDomainBySubDomIdxKey key = ((ICFBamSchema) schema.getBackingStore()).getFactoryDomain().newSubDomIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredSubDomainOfId(SubDomainOfId); Map<CFInternetDomainBasePKey, ICFInternetDomainObj> dict; if (indexBySubDomIdx == null) { indexBySubDomIdx = new HashMap< CFInternetDomainBySubDomIdxKey, Map<CFInternetDomainBasePKey, ICFInternetDomainObj>>(); } if ((!forceRead) && indexBySubDomIdx.containsKey(key)) { dict = indexBySubDomIdx.get(key); } else { dict = new HashMap<CFInternetDomainBasePKey, ICFInternetDomainObj>(); // Allow other threads to dirty-read while we're loading indexBySubDomIdx.put(key, dict); ICFInternetDomainObj obj; CFInternetDomainBuff[] buffList = ((ICFBamSchema) schema.getBackingStore()) .getTableDomain() .readDerivedBySubDomIdx(schema.getAuthorization(), TenantId, SubDomainOfId); CFInternetDomainBuff buff; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = (ICFInternetDomainObj) schema.getDomainBaseTableObj().constructByClassCode(buff.getClassCode()); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDomainBase().newPKey()); obj.setBuff(buff); ICFInternetDomainObj realized = (ICFInternetDomainObj) obj.realize(); } } Comparator<ICFInternetDomainObj> cmp = new Comparator<ICFInternetDomainObj>() { public int compare(ICFInternetDomainObj lhs, ICFInternetDomainObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFInternetDomainBasePKey lhsPKey = lhs.getPKey(); CFInternetDomainBasePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = dict.size(); ICFInternetDomainObj arr[] = new ICFInternetDomainObj[len]; Iterator<ICFInternetDomainObj> 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<ICFInternetDomainObj> arrayList = new ArrayList<ICFInternetDomainObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFInternetDomainObj> sortedList = arrayList; return (sortedList); }
public List<ICFInternetDomainObj> readAllDomain(boolean forceRead) { final String S_ProcName = "readAllDomain"; if ((allDomain == null) || forceRead) { Map<CFInternetDomainBasePKey, ICFInternetDomainObj> map = new HashMap<CFInternetDomainBasePKey, ICFInternetDomainObj>(); allDomain = map; CFInternetDomainBuff[] buffList = ((ICFBamSchema) schema.getBackingStore()) .getTableDomain() .readAllDerived(schema.getAuthorization()); CFInternetDomainBuff buff; ICFInternetDomainObj obj; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = (ICFInternetDomainObj) schema.getDomainBaseTableObj().constructByClassCode(buff.getClassCode()); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDomainBase().newPKey()); obj.setBuff(buff); ICFInternetDomainObj realized = (ICFInternetDomainObj) obj.realize(); } } Comparator<ICFInternetDomainObj> cmp = new Comparator<ICFInternetDomainObj>() { public int compare(ICFInternetDomainObj lhs, ICFInternetDomainObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFInternetDomainBasePKey lhsPKey = lhs.getPKey(); CFInternetDomainBasePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = allDomain.size(); ICFInternetDomainObj arr[] = new ICFInternetDomainObj[len]; Iterator<ICFInternetDomainObj> valIter = allDomain.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<ICFInternetDomainObj> arrayList = new ArrayList<ICFInternetDomainObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFInternetDomainObj> sortedList = arrayList; return (sortedList); }