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 deleteSecDeviceByIdIdx(UUID SecUserId, String DevName) { CFSecuritySecDevicePKey pkey = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey(); pkey.setRequiredSecUserId(SecUserId); pkey.setRequiredDevName(DevName); ICFSecuritySecDeviceObj obj = readSecDevice(pkey); if (obj != null) { ICFSecuritySecDeviceEditObj editObj = (ICFSecuritySecDeviceEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFSecuritySecDeviceEditObj) obj.beginEdit(); if (editObj != null) { editStarted = true; } else { editStarted = false; } } else { editStarted = false; } if (editObj != null) { editObj.delete(); if (editStarted) { editObj.endEdit(); } } obj.forget(true); } }
public void deleteSecDevice(ICFSecuritySecDeviceObj Obj) { ICFSecuritySecDeviceObj obj = Obj; ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecDevice() .deleteSecDevice(schema.getAuthorization(), obj.getSecDeviceBuff()); obj.forget(true); }
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 forgetSecDeviceByIdIdx(UUID SecUserId, String DevName) { if (members == null) { return; } CFSecuritySecDevicePKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey(); key.setRequiredSecUserId(SecUserId); key.setRequiredDevName(DevName); if (members.containsKey(key)) { ICFSecuritySecDeviceObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
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(); } }