public void deleteClearTopDepByTenantIdx(long TenantId) { CFBamScopeByTenantIdxKey key = schema.getBackingStore().getFactoryScope().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (indexByTenantIdx == null) { indexByTenantIdx = new HashMap<CFBamScopeByTenantIdxKey, Map<CFBamScopePKey, ICFBamClearTopDepObj>>(); } if (indexByTenantIdx.containsKey(key)) { Map<CFBamScopePKey, ICFBamClearTopDepObj> dict = indexByTenantIdx.get(key); schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByTenantIdx(schema.getAuthorization(), TenantId); 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); } indexByTenantIdx.remove(key); } else { schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByTenantIdx(schema.getAuthorization(), TenantId); } }
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 ICFBamClearTopDepObj readClearTopDepByUNameIdx( long TenantId, long ContTableId, String Name, boolean forceRead) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFBamClearTopDepByUNameIdxKey, ICFBamClearTopDepObj>(); } CFBamClearTopDepByUNameIdxKey key = schema.getBackingStore().getFactoryClearTopDep().newUNameIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredContTableId(ContTableId); key.setRequiredName(Name); ICFBamClearTopDepObj obj = null; if ((!forceRead) && indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); } else { CFBamClearTopDepBuff buff = schema .getBackingStore() .getTableClearTopDep() .readDerivedByUNameIdx(schema.getAuthorization(), TenantId, ContTableId, Name); if (buff != null) { obj = (ICFBamClearTopDepObj) schema.getScopeTableObj().constructByClassCode(buff.getClassCode()); obj.setPKey(schema.getBackingStore().getFactoryScope().newPKey()); obj.setBuff(buff); obj = (ICFBamClearTopDepObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByUNameIdx.put(key, null); } } return (obj); }
public void loadData(boolean forceReload) { ICFBamSchemaObj schemaObj = swingSchema.getSchema(); if ((containingCluster == null) || forceReload) { CFSecurityAuthorization auth = schemaObj.getAuthorization(); long containingClusterId = auth.getSecClusterId(); containingCluster = schemaObj.getClusterTableObj().readClusterByIdIdx(containingClusterId); } if ((listOfSysCluster == null) || forceReload) { arrayOfSysCluster = null; listOfSysCluster = schemaObj .getSysClusterTableObj() .readSysClusterByClusterIdx(containingCluster.getRequiredId(), swingIsInitializing); if (listOfSysCluster != null) { Object objArray[] = listOfSysCluster.toArray(); if (objArray != null) { int len = objArray.length; arrayOfSysCluster = new ICFSecuritySysClusterObj[len]; for (int i = 0; i < len; i++) { arrayOfSysCluster[i] = (ICFSecuritySysClusterObj) objArray[i]; } Arrays.sort(arrayOfSysCluster, compareSysClusterByQualName); } } } }
public void deleteDataScope(ICFBamDataScopeObj Obj) { ICFBamDataScopeObj obj = Obj; ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .deleteDataScope(schema.getAuthorization(), obj.getDataScopeBuff()); obj.forget(true); }
public ICFBamDataScopeObj updateDataScope(ICFBamDataScopeObj Obj) { ICFBamDataScopeObj obj = Obj; ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .updateDataScope(schema.getAuthorization(), Obj.getDataScopeBuff()); obj = (ICFBamDataScopeObj) Obj.realize(); return (obj); }
public void deleteClearTopDep(ICFBamClearTopDepObj Obj) { ICFBamClearTopDepObj obj = Obj; schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDep(schema.getAuthorization(), obj.getClearTopDepBuff()); obj.forget(true); }
public ICFBamDataScopeObj createDataScope(ICFBamDataScopeObj Obj) { ICFBamDataScopeObj obj = Obj; CFBamDataScopeBuff buff = obj.getDataScopeBuff(); ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .createDataScope(schema.getAuthorization(), buff); obj.copyBuffToPKey(); obj = obj.realize(); return (obj); }
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 ICFBamClearTopDepObj updateClearTopDep(ICFBamClearTopDepObj Obj) { ICFBamClearTopDepObj obj = Obj; schema .getBackingStore() .getTableClearTopDep() .updateClearTopDep(schema.getAuthorization(), Obj.getClearTopDepBuff()); if (Obj.getClassCode().equals("CLRT")) { obj = (ICFBamClearTopDepObj) Obj.realize(); } return (obj); }
public ICFBamClearTopDepObj createClearTopDep(ICFBamClearTopDepObj Obj) { ICFBamClearTopDepObj obj = Obj; CFBamClearTopDepBuff buff = obj.getClearTopDepBuff(); schema .getBackingStore() .getTableClearTopDep() .createClearTopDep(schema.getAuthorization(), buff); obj.copyBuffToPKey(); if (obj.getPKey().getClassCode().equals("CLRT")) { obj = (ICFBamClearTopDepObj) (obj.realize()); } return (obj); }
public void deleteClearTopDepByUNameIdx(long TenantId, long ContTableId, String Name) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFBamClearTopDepByUNameIdxKey, ICFBamClearTopDepObj>(); } CFBamClearTopDepByUNameIdxKey key = schema.getBackingStore().getFactoryClearTopDep().newUNameIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredContTableId(ContTableId); key.setRequiredName(Name); ICFBamClearTopDepObj obj = null; if (indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByUNameIdx(schema.getAuthorization(), TenantId, ContTableId, Name); obj.forget(true); } else { schema .getBackingStore() .getTableClearTopDep() .deleteClearTopDepByUNameIdx(schema.getAuthorization(), TenantId, ContTableId, Name); } }
public ICFBamDataScopeObj lockDataScope(CFBamDataScopePKey pkey) { ICFBamDataScopeObj locked = null; CFBamDataScopeBuff lockBuff = ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .lockDerived(schema.getAuthorization(), pkey); if (lockBuff != null) { locked = schema.getDataScopeTableObj().newInstance(); locked.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey()); locked.setBuff(lockBuff); locked = (ICFBamDataScopeObj) locked.realize(); } else { throw CFLib.getDefaultExceptionFactory() .newCollisionDetectedException(getClass(), "lockDataScope", pkey); } return (locked); }
public CFBamDataScopeBuff getBuff() { if (buff == null) { if (isNew) { buff = ((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newBuff(); } else { // Read the data buff via the backing store buff = ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .readDerivedByIdIdx(schema.getAuthorization(), getPKey().getRequiredId()); if (buff != null) { copyBuffToPKey(); } } } return (buff); }
public ICFBamClearTopDepObj lockClearTopDep(CFBamScopePKey pkey) { ICFBamClearTopDepObj locked = null; CFBamClearTopDepBuff lockBuff = schema.getBackingStore().getTableClearTopDep().lockDerived(schema.getAuthorization(), pkey); if (lockBuff != null) { locked = (ICFBamClearTopDepObj) schema.getScopeTableObj().constructByClassCode(lockBuff.getClassCode()); locked.setPKey(schema.getBackingStore().getFactoryScope().newPKey()); locked.setBuff(lockBuff); locked = (ICFBamClearTopDepObj) locked.realize(); } else { throw CFLib.getDefaultExceptionFactory() .newCollisionDetectedException(getClass(), "lockClearTopDep", pkey); } return (locked); }
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 actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; Container cont; JDesktopPane desktop; ICFBamSchemaObj schemaObj = swingSchema.getSchema(); ICFInternetDomainBaseObj focus = getSwingFocusAsDomainBase(); ICFInternetDomainBaseEditObj editObj = (ICFInternetDomainBaseEditObj) focus.getEdit(); if (editObj != null) { focus = editObj; } ICFBamTenantObj referencedObj = (ICFBamTenantObj) focus.getRequiredOwnerTenant(swingIsInitializing); java.util.List<ICFSecurityTenantObj> listOfTenant = null; CFSecurityAuthorization auth = schemaObj.getAuthorization(); long containingClusterId = auth.getSecClusterId(); listOfTenant = schemaObj.getTenantTableObj().readTenantByClusterIdx(containingClusterId); if (listOfTenant == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "listOfTenant"); } Collection<ICFSecurityTenantObj> cltn = listOfTenant; JInternalFrame frame = swingSchema .getTenantFactory() .newPickerJInternalFrame(referencedObj, null, cltn, new CallbackTenantChosen()); ((ICFBamSwingTenantJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } }
public ICFBamClearTopDepObj readClearTopDep(CFBamScopePKey pkey, boolean forceRead) { ICFBamClearTopDepObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFBamClearTopDepBuff readBuff = schema .getBackingStore() .getTableClearTopDep() .readDerivedByIdIdx( schema.getAuthorization(), pkey.getRequiredTenantId(), pkey.getRequiredId()); if (readBuff != null) { obj = (ICFBamClearTopDepObj) schema.getScopeTableObj().constructByClassCode(readBuff.getClassCode()); obj.setPKey(schema.getBackingStore().getFactoryScope().newPKey()); obj.setBuff(readBuff); obj = (ICFBamClearTopDepObj) obj.realize(); } else if (schema.getCacheMisses()) { members.put(pkey, null); } } return (obj); }
public List<ICFBamClearTopDepObj> readClearTopDepByContTblIdx( long TenantId, long ContTableId, boolean forceRead) { final String S_ProcName = "readClearTopDepByContTblIdx"; CFBamClearTopDepByContTblIdxKey key = schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredContTableId(ContTableId); Map<CFBamScopePKey, ICFBamClearTopDepObj> dict; if (indexByContTblIdx == null) { indexByContTblIdx = new HashMap<CFBamClearTopDepByContTblIdxKey, Map<CFBamScopePKey, ICFBamClearTopDepObj>>(); } if ((!forceRead) && indexByContTblIdx.containsKey(key)) { dict = indexByContTblIdx.get(key); } else { dict = new HashMap<CFBamScopePKey, ICFBamClearTopDepObj>(); // Allow other threads to dirty-read while we're loading indexByContTblIdx.put(key, dict); ICFBamClearTopDepObj obj; CFBamClearTopDepBuff[] buffList = schema .getBackingStore() .getTableClearTopDep() .readDerivedByContTblIdx(schema.getAuthorization(), TenantId, ContTableId); CFBamClearTopDepBuff buff; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = (ICFBamClearTopDepObj) schema.getScopeTableObj().constructByClassCode(buff.getClassCode()); obj.setPKey(schema.getBackingStore().getFactoryScope().newPKey()); obj.setBuff(buff); ICFBamClearTopDepObj realized = (ICFBamClearTopDepObj) obj.realize(); } } Comparator<ICFBamClearTopDepObj> cmp = new Comparator<ICFBamClearTopDepObj>() { public int compare(ICFBamClearTopDepObj lhs, ICFBamClearTopDepObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFBamScopePKey lhsPKey = lhs.getPKey(); CFBamScopePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = dict.size(); ICFBamClearTopDepObj arr[] = new ICFBamClearTopDepObj[len]; Iterator<ICFBamClearTopDepObj> 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<ICFBamClearTopDepObj> arrayList = new ArrayList<ICFBamClearTopDepObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFBamClearTopDepObj> sortedList = arrayList; return (sortedList); }
public List<ICFBamDataScopeObj> readAllDataScope(boolean forceRead) { final String S_ProcName = "readAllDataScope"; if ((allDataScope == null) || forceRead) { Map<CFBamDataScopePKey, ICFBamDataScopeObj> map = new HashMap<CFBamDataScopePKey, ICFBamDataScopeObj>(); allDataScope = map; CFBamDataScopeBuff[] buffList = ((ICFBamSchema) schema.getBackingStore()) .getTableDataScope() .readAllDerived(schema.getAuthorization()); CFBamDataScopeBuff buff; ICFBamDataScopeObj obj; for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; obj = newInstance(); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDataScope().newPKey()); obj.setBuff(buff); ICFBamDataScopeObj realized = (ICFBamDataScopeObj) obj.realize(); } } Comparator<ICFBamDataScopeObj> cmp = new Comparator<ICFBamDataScopeObj>() { public int compare(ICFBamDataScopeObj lhs, ICFBamDataScopeObj rhs) { if (lhs == null) { if (rhs == null) { return (0); } else { return (-1); } } else if (rhs == null) { return (1); } else { CFBamDataScopePKey lhsPKey = lhs.getPKey(); CFBamDataScopePKey rhsPKey = rhs.getPKey(); int ret = lhsPKey.compareTo(rhsPKey); return (ret); } } }; int len = allDataScope.size(); ICFBamDataScopeObj arr[] = new ICFBamDataScopeObj[len]; Iterator<ICFBamDataScopeObj> valIter = allDataScope.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<ICFBamDataScopeObj> arrayList = new ArrayList<ICFBamDataScopeObj>(len); for (idx = 0; idx < len; idx++) { arrayList.add(arr[idx]); } List<ICFBamDataScopeObj> sortedList = arrayList; return (sortedList); }