@Override public List<Group> getChildrenGroupsByUUID(final String groupUUID) { final IdentityService identityService = EnvTool.getIdentityService(); final List<GroupImpl> groups = identityService.getGroupChildren(groupUUID); final List<Group> result = new ArrayList<Group>(); if (groups != null) { for (final GroupImpl group : groups) { result.add(new GroupImpl(group)); } } return result; }
@Override public List<Group> getChildrenGroups(final String groupUUID, final int fromIndex, final int numberOfGroups) throws GroupNotFoundException { final IdentityService identityService = EnvTool.getIdentityService(); final List<GroupImpl> groups = identityService.getGroupChildren(groupUUID, fromIndex, numberOfGroups); final List<Group> result = new ArrayList<Group>(); if (groups != null) { for (final GroupImpl group : groups) { result.add(new GroupImpl(group)); } } return result; }
@Override public List<Group> getChildrenGroups(final String groupUUID, final int fromIndex, final int numberOfGroups, final GroupCriterion pagingCriterion) throws GroupNotFoundException { final IdentityService identityService = EnvTool.getIdentityService(); final List<GroupImpl> groups = identityService.getGroupChildren(groupUUID, fromIndex, numberOfGroups, pagingCriterion); final List<Group> result = new ArrayList<Group>(); if (groups != null) { for (final GroupImpl group : groups) { result.add(new GroupImpl(group)); } } return result; }
throw new GroupNotFoundException("bai_IAPII_12", groupUUID); final List<GroupImpl> children = identityService.getGroupChildren(groupUUID); final List<String> childrenUUIDs = new ArrayList<String>(); for (final GroupImpl child : children) {
final GroupImpl group = identityService.getGroup(groupUUID); if (group != null) { final List<GroupImpl> children = identityService.getGroupChildren(groupUUID); final List<String> childrenUUIDs = new ArrayList<String>(); for (final GroupImpl child : children) {
@Override public Group addGroup(final String name, final String parentGroupUUID) throws GroupAlreadyExistsException, GroupNotFoundException { FacadeUtil.checkArgsNotNull(name); final IdentityService identityService = EnvTool.getIdentityService(); final List<GroupImpl> childrenGroups = identityService.getGroupChildren(parentGroupUUID); for (final GroupImpl childGroup : childrenGroups) { if (name.equalsIgnoreCase(childGroup.getName())) { throw new GroupAlreadyExistsException("bai_IAPII_7", name); } } final GroupImpl group = new GroupImpl(name); if (parentGroupUUID != null) { final GroupImpl parentGroup = identityService.getGroup(parentGroupUUID); if (parentGroup == null) { throw new GroupNotFoundException("bai_IAPII_13", parentGroupUUID); } group.setParentGroup(parentGroup); } identityService.addGroup(group); return new GroupImpl(group); }
@Override public Group addGroup(final String name, final String label, final String description, final String parentGroupUUID) throws GroupAlreadyExistsException, GroupNotFoundException { FacadeUtil.checkArgsNotNull(name); final IdentityService identityService = EnvTool.getIdentityService(); final List<GroupImpl> childrenGroups = identityService.getGroupChildren(parentGroupUUID); for (final GroupImpl childGroup : childrenGroups) { if (name.equalsIgnoreCase(childGroup.getName())) { throw new GroupAlreadyExistsException("bai_IAPII_7", name); } } final GroupImpl group = new GroupImpl(name); group.setLabel(label); group.setDescription(description); identityService.addGroup(group); if (parentGroupUUID != null) { final GroupImpl parentGroup = identityService.getGroup(parentGroupUUID); if (parentGroup == null) { throw new GroupNotFoundException("bai_IAPII_13", parentGroupUUID); } group.setParentGroup(parentGroup); } return new GroupImpl(group); }
final List<GroupImpl> groupChildren = identityService.getGroupChildren(parentGroupUUID); for (final GroupImpl child : groupChildren) { if (child.getName().equals(name)) {
@Override public Group importGroup(final String uuid, final String name, final String label, final String description, final String parentGroupUUID) throws GroupAlreadyExistsException, GroupNotFoundException { FacadeUtil.checkArgsNotNull(name); final IdentityService identityService = EnvTool.getIdentityService(); final Group group = identityService.getGroup(uuid); if (group != null) { throw new GroupAlreadyExistsException("bai_IAPII_7", uuid); } final List<GroupImpl> childrenGroups = identityService.getGroupChildren(parentGroupUUID); for (final GroupImpl childGroup : childrenGroups) { if (name.equalsIgnoreCase(childGroup.getName())) { throw new GroupAlreadyExistsException("bai_IAPII_7", name); } } final GroupImpl groupToImport = new GroupImpl(uuid, name); groupToImport.setLabel(label); groupToImport.setDescription(description); identityService.addGroup(groupToImport); if (parentGroupUUID != null) { final GroupImpl parentGroup = identityService.getGroup(parentGroupUUID); if (parentGroup == null) { throw new GroupNotFoundException("bai_IAPII_13", parentGroupUUID); } groupToImport.setParentGroup(parentGroup); } return new GroupImpl(groupToImport); }