use of org.gluu.persist.model.base.GluuBoolean in project oxTrust by GluuFederation.
the class PassportUmaProtectionService method isPassportEnabled.
private boolean isPassportEnabled() {
GluuAppliance appliance = applianceService.getAppliance();
GluuBoolean passportEnbaled = appliance.getPassportEnabled();
return GluuBoolean.ENABLED.equals(passportEnbaled) || GluuBoolean.TRUE.equals(passportEnbaled);
}
use of org.gluu.persist.model.base.GluuBoolean in project oxTrust by GluuFederation.
the class ScimUmaProtectionService method isScimEnabled.
private boolean isScimEnabled() {
GluuAppliance appliance = applianceService.getAppliance();
GluuBoolean scimEnabled = appliance.getScimEnabled();
return GluuBoolean.ENABLED.equals(scimEnabled) || GluuBoolean.TRUE.equals(scimEnabled);
}
use of org.gluu.persist.model.base.GluuBoolean in project oxTrust by GluuFederation.
the class UpdateGroupAction method updatePersons.
private void updatePersons(List<DisplayNameEntry> oldMembers, List<DisplayNameEntry> newMembers) throws Exception {
log.debug("Old members: {}", oldMembers);
log.debug("New members: {}", newMembers);
String groupDn = this.group.getDn();
GluuOrganization organization = organizationService.getOrganization();
String[] organizationGroups = { organization.getManagerGroup() };
// Convert members to array of DNs
String[] oldMemberDns = convertToDNsArray(oldMembers);
String[] newMemberDns = convertToDNsArray(newMembers);
Arrays.sort(oldMemberDns);
Arrays.sort(newMemberDns);
boolean[] retainOldMembers = new boolean[oldMemberDns.length];
Arrays.fill(retainOldMembers, false);
List<String> addedMembers = new ArrayList<String>();
List<String> removedMembers = new ArrayList<String>();
List<String> existingMembers = new ArrayList<String>();
// Add new values
for (String value : newMemberDns) {
int idx = Arrays.binarySearch(oldMemberDns, value);
if (idx >= 0) {
// Old members array contains member. Retain member
retainOldMembers[idx] = true;
} else {
// This is new member
addedMembers.add(value);
}
}
// Remove members which we don't have in new members
for (int i = 0; i < oldMemberDns.length; i++) {
if (retainOldMembers[i]) {
existingMembers.add(oldMemberDns[i]);
} else {
removedMembers.add(oldMemberDns[i]);
}
}
for (String dn : addedMembers) {
GluuCustomPerson person = personService.getPersonByDn(dn);
log.debug("Adding group {} to person {} memberOf", groupDn, person.getDisplayName());
if (appConfiguration.isUpdateApplianceStatus()) {
GluuBoolean slaManager = isSLAManager(organizationGroups, person);
person.setSLAManager(slaManager);
}
List<String> personMemberOf = new ArrayList<String>(person.getMemberOf());
personMemberOf.add(groupDn);
person.setMemberOf(personMemberOf);
personService.updatePerson(person);
}
for (String dn : removedMembers) {
GluuCustomPerson person = personService.getPersonByDn(dn);
log.debug("Removing group {} from person {} memberOf", groupDn, person.getDisplayName());
if (appConfiguration.isUpdateApplianceStatus()) {
GluuBoolean slaManager = isSLAManager(organizationGroups, person);
person.setSLAManager(slaManager);
}
List<String> personMemberOf = new ArrayList<String>(person.getMemberOf());
personMemberOf.remove(groupDn);
person.setMemberOf(personMemberOf);
personService.updatePerson(person);
}
if (appConfiguration.isUpdateApplianceStatus()) {
// Update existing members if needed
for (String dn : existingMembers) {
GluuCustomPerson person = personService.getPersonByDn(dn);
log.debug("Updating group {} to person {} memberOf", groupDn, person.getDisplayName());
GluuBoolean slaManager = isSLAManager(organizationGroups, person);
if (slaManager.equals(person.getSLAManager())) {
continue;
}
person.setSLAManager(slaManager);
personService.updatePerson(person);
}
}
}
Aggregations