public void deleteSecGroupIncludeByIdIdx(long ClusterId, long SecGroupIncludeId) { CFGenKbSecGroupIncludePKey pkey = schema.getBackingStore().getFactorySecGroupInclude().newPKey(); pkey.setRequiredClusterId(ClusterId); pkey.setRequiredSecGroupIncludeId(SecGroupIncludeId); ICFGenKbSecGroupIncludeObj obj = readSecGroupInclude(pkey); if (obj != null) { ICFGenKbSecGroupIncludeEditObj editObj = (ICFGenKbSecGroupIncludeEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFGenKbSecGroupIncludeEditObj) 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 minimizeMemory() { allSecGroupInclude = null; indexByClusterIdx = null; indexByGroupIdx = null; indexByIncludeIdx = null; indexByUIncludeIdx = null; List<ICFGenKbSecGroupIncludeObj> toForget = new LinkedList<ICFGenKbSecGroupIncludeObj>(); ICFGenKbSecGroupIncludeObj cur = null; Iterator<ICFGenKbSecGroupIncludeObj> 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(); } }