use of org.gluu.oxtrust.model.GluuGroup in project oxTrust by GluuFederation.
the class GroupService method generateInumForNewGroup.
/* (non-Javadoc)
* @see org.gluu.oxtrust.ldap.service.IGroupService#generateInumForNewGroup()
*/
@Override
public String generateInumForNewGroup() throws Exception {
GluuGroup group = new GluuGroup();
String newInum = null;
do {
newInum = generateInumForNewGroupImpl();
String newDn = getDnForGroup(newInum);
group.setDn(newDn);
} while (ldapEntryManager.contains(group));
return newInum;
}
use of org.gluu.oxtrust.model.GluuGroup in project oxTrust by GluuFederation.
the class GroupService method addGroup.
/* (non-Javadoc)
* @see org.gluu.oxtrust.ldap.service.IGroupService#addGroup(org.gluu.oxtrust.model.GluuGroup)
*/
@Override
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) {
ldapEntryManager.persist(group);
} else {
throw new DuplicateEntryException("Duplicate displayName: " + group.getDisplayName());
}
}
use of org.gluu.oxtrust.model.GluuGroup in project oxTrust by GluuFederation.
the class GroupService method getGroupByIname.
/* (non-Javadoc)
* @see org.gluu.oxtrust.ldap.service.IGroupService#getGroupByIname(java.lang.String)
*/
@Override
public GluuGroup getGroupByIname(String iname) throws Exception {
GluuGroup group = new GluuGroup();
group.setBaseDn(getDnForGroup(null));
group.setIname(iname);
List<GluuGroup> groups = ldapEntryManager.findEntries(group);
if ((groups != null) && (groups.size() > 0)) {
return groups.get(0);
}
return null;
}
use of org.gluu.oxtrust.model.GluuGroup in project oxTrust by GluuFederation.
the class GroupService method getGroupByDisplayName.
/* (non-Javadoc)
* @see org.gluu.oxtrust.ldap.service.IGroupService#getGroupByDisplayName(java.lang.String)
*/
@Override
public GluuGroup getGroupByDisplayName(String DisplayName) throws Exception {
GluuGroup group = new GluuGroup();
group.setBaseDn(getDnForGroup(null));
group.setDisplayName(DisplayName);
List<GluuGroup> groups = ldapEntryManager.findEntries(group);
if ((groups != null) && (groups.size() > 0)) {
return groups.get(0);
}
return null;
}
use of org.gluu.oxtrust.model.GluuGroup in project oxTrust by GluuFederation.
the class InumService method containsGroup.
public boolean containsGroup(String inum, String gluuInum) {
boolean contains = true;
GluuGroup group = new GluuGroup();
group.setBaseDn(String.format("inum=%s,ou=groups,o=%s,o=gluu", inum, gluuInum));
contains = ldapEntryManager.contains(group);
if (contains)
return true;
group.setBaseDn(String.format("inum=%s,ou=groups,o=gluu", inum));
contains = ldapEntryManager.contains(group);
return contains;
}
Aggregations