use of io.jans.scim.model.GluuGroup in project jans by JanssenProject.
the class Scim2GroupService method preCreateGroup.
public GluuGroup preCreateGroup(GroupResource group, boolean skipMembersValidation, boolean fillDisplay, String usersUrl) throws Exception {
log.info("Preparing to create group {}", group.getDisplayName());
GluuGroup gluuGroup = new GluuGroup();
transferAttributesToGroup(group, gluuGroup, skipMembersValidation, fillDisplay, usersUrl);
assignComputedAttributesToGroup(gluuGroup);
return gluuGroup;
}
use of io.jans.scim.model.GluuGroup in project jans by JanssenProject.
the class GroupWebService method checkDisplayNameExistence.
private void checkDisplayNameExistence(String displayName, String id) throws DuplicateEntryException {
// Validate if there is an attempt to supply a displayName already in use by a
// group other than current
GluuGroup groupToFind = new GluuGroup();
groupToFind.setDisplayName(displayName);
List<GluuGroup> list = groupService.findGroups(groupToFind, 2);
if (list != null && list.stream().anyMatch(g -> !g.getInum().equals(id))) {
throw new DuplicateEntryException("Duplicate group displayName value: " + displayName);
}
}
use of io.jans.scim.model.GluuGroup in project jans by JanssenProject.
the class GroupService method addGroup.
public void addGroup(GluuGroup group) throws Exception {
GluuGroup displayNameGroup = new GluuGroup();
displayNameGroup.setDisplayName(group.getDisplayName());
List<GluuGroup> groups = findGroups(displayNameGroup, 1);
if (groups == null || groups.size() == 0) {
persistenceEntryManager.persist(group);
} else {
throw new DuplicateEntryException("Duplicate displayName: " + group.getDisplayName());
}
}
use of io.jans.scim.model.GluuGroup in project jans by JanssenProject.
the class GroupService method getGroupByDisplayName.
public GluuGroup getGroupByDisplayName(String DisplayName) throws Exception {
GluuGroup group = new GluuGroup();
group.setBaseDn(getDnForGroup(null));
group.setDisplayName(DisplayName);
List<GluuGroup> groups = persistenceEntryManager.findEntries(group);
if ((groups != null) && (groups.size() > 0)) {
return groups.get(0);
}
return null;
}
Aggregations