public void deleteSecGroupByClusterIdx(long ClusterId) { CFSecuritySecGroupByClusterIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey(); key.setRequiredClusterId(ClusterId); if (indexByClusterIdx == null) { indexByClusterIdx = new HashMap< CFSecuritySecGroupByClusterIdxKey, Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj>>(); } if (indexByClusterIdx.containsKey(key)) { Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> dict = indexByClusterIdx.get(key); ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecGroup() .deleteSecGroupByClusterIdx(schema.getAuthorization(), ClusterId); Iterator<ICFSecuritySecGroupObj> iter = dict.values().iterator(); ICFSecuritySecGroupObj obj; List<ICFSecuritySecGroupObj> toForget = new LinkedList<ICFSecuritySecGroupObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByClusterIdx.remove(key); } else { ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecGroup() .deleteSecGroupByClusterIdx(schema.getAuthorization(), ClusterId); } }
public void deleteSecGroupByIdIdx(long ClusterId, int SecGroupId) { CFSecuritySecGroupPKey pkey = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newPKey(); pkey.setRequiredClusterId(ClusterId); pkey.setRequiredSecGroupId(SecGroupId); ICFSecuritySecGroupObj obj = readSecGroup(pkey); if (obj != null) { ICFSecuritySecGroupEditObj editObj = (ICFSecuritySecGroupEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFSecuritySecGroupEditObj) 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 deleteSecGroup(ICFSecuritySecGroupObj Obj) { ICFSecuritySecGroupObj obj = Obj; ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecGroup() .deleteSecGroup(schema.getAuthorization(), obj.getSecGroupBuff()); obj.forget(true); }
public void forgetSecGroupByClusterIdx(long ClusterId) { if (indexByClusterIdx == null) { return; } CFSecuritySecGroupByClusterIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newClusterIdxKey(); key.setRequiredClusterId(ClusterId); if (indexByClusterIdx.containsKey(key)) { Map<CFSecuritySecGroupPKey, ICFSecuritySecGroupObj> mapClusterIdx = indexByClusterIdx.get(key); if (mapClusterIdx != null) { List<ICFSecuritySecGroupObj> toForget = new LinkedList<ICFSecuritySecGroupObj>(); ICFSecuritySecGroupObj cur = null; Iterator<ICFSecuritySecGroupObj> iter = mapClusterIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByClusterIdx.remove(key); } }
public void forgetSecGroupByIdIdx(long ClusterId, int SecGroupId) { if (members == null) { return; } CFSecuritySecGroupPKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newPKey(); key.setRequiredClusterId(ClusterId); key.setRequiredSecGroupId(SecGroupId); if (members.containsKey(key)) { ICFSecuritySecGroupObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public void forgetSecGroupByUNameIdx(long ClusterId, String Name) { if (indexByUNameIdx == null) { return; } CFSecuritySecGroupByUNameIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredName(Name); if (indexByUNameIdx.containsKey(key)) { ICFSecuritySecGroupObj probed = indexByUNameIdx.get(key); if (probed != null) { probed.forget(true); } indexByUNameIdx.remove(key); } }
public void minimizeMemory() { allSecGroup = null; indexByClusterIdx = null; indexByUNameIdx = null; List<ICFSecuritySecGroupObj> toForget = new LinkedList<ICFSecuritySecGroupObj>(); ICFSecuritySecGroupObj cur = null; Iterator<ICFSecuritySecGroupObj> 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(); } }
public void deleteSecGroupByUNameIdx(long ClusterId, String Name) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFSecuritySecGroupByUNameIdxKey, ICFSecuritySecGroupObj>(); } CFSecuritySecGroupByUNameIdxKey key = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newUNameIdxKey(); key.setRequiredClusterId(ClusterId); key.setRequiredName(Name); ICFSecuritySecGroupObj obj = null; if (indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecGroup() .deleteSecGroupByUNameIdx(schema.getAuthorization(), ClusterId, Name); obj.forget(true); } else { ((ICFSecuritySchema) schema.getBackingStore()) .getTableSecGroup() .deleteSecGroupByUNameIdx(schema.getAuthorization(), ClusterId, Name); } }