@Override public void deleteGroup(final long groupId) throws SGroupNotFoundException, SGroupDeletionException { final SGroup group = getGroup(groupId); this.deleteGroup(group); }
@Override public void deleteGroup(final long groupId) throws SGroupNotFoundException, SGroupDeletionException { final SGroup group = getGroup(groupId); this.deleteGroup(group); }
@Override public List<Long> deleteChildrenGroup(final long groupId) throws SGroupDeletionException, SGroupNotFoundException { final ArrayList<Long> deletedGroups = new ArrayList<>(); try { List<SGroup> childrenGroup; final int nbGroup = 20; while (!(childrenGroup = getGroupChildren(groupId, 0, nbGroup)).isEmpty()) { for (final SGroup sGroup : childrenGroup) { deletedGroups.addAll(deleteChildrenGroup(sGroup.getId())); deletedGroups.add(sGroup.getId()); deleteGroup(sGroup); } } } catch (final SGroupNotFoundException e) { throw e; } catch (final SIdentityException e) { throw new SGroupDeletionException(e); } return deletedGroups; }
@Override public List<Long> deleteChildrenGroup(final long groupId) throws SGroupDeletionException, SGroupNotFoundException { final ArrayList<Long> deletedGroups = new ArrayList<>(); try { List<SGroup> childrenGroup; final int nbGroup = 20; while (!(childrenGroup = getGroupChildren(groupId, 0, nbGroup)).isEmpty()) { for (final SGroup sGroup : childrenGroup) { deletedGroups.addAll(deleteChildrenGroup(sGroup.getId())); deletedGroups.add(sGroup.getId()); deleteGroup(sGroup); } } } catch (final SGroupNotFoundException e) { throw e; } catch (final SIdentityException e) { throw new SGroupDeletionException(e); } return deletedGroups; }