use of org.gluu.asimba.util.ldap.sp.LDAPRequestorPoolEntry in project oxTrust by GluuFederation.
the class AsimbaService method addRequestorPoolEntry.
/**
* Add new LDAPRequestorPoolEntry.
*
* @param entry LDAPRequestorPoolEntry
*/
public void addRequestorPoolEntry(RequestorPoolEntry entry) {
entry.setLastModified(new Date());
LDAPRequestorPoolEntry ldapEntry = new LDAPRequestorPoolEntry();
ldapEntry.setEntry(entry);
String inum = generateInum();
ldapEntry.setInum(inum);
ldapEntry.setDn(getDnForLDAPRequestorPoolEntry(inum));
ldapEntryManager.persist(ldapEntry);
}
use of org.gluu.asimba.util.ldap.sp.LDAPRequestorPoolEntry in project oxTrust by GluuFederation.
the class AsimbaService method updateRequestorPoolEntry.
/**
* Update LDAPRequestorPoolEntry.
*
* @param entry LDAPRequestorPoolEntry
*/
public void updateRequestorPoolEntry(RequestorPoolEntry entry) {
entry.setLastModified(new Date());
LDAPRequestorPoolEntry ldapEntry = ldapEntryManager.find(LDAPRequestorPoolEntry.class, getDnForLDAPRequestorPoolEntry(entry.getInum()));
ldapEntry.setEntry(entry);
ldapEntryManager.merge(ldapEntry);
}
use of org.gluu.asimba.util.ldap.sp.LDAPRequestorPoolEntry in project oxTrust by GluuFederation.
the class AsimbaService method searchRequestorPools.
/**
* Search by pattern
*
* @param pattern Pattern
* @param sizeLimit Maximum count of results
* @return List of scopes
* @throws Exception
*/
public List<RequestorPoolEntry> searchRequestorPools(String pattern, int sizeLimit) throws Exception {
// filter
String[] targetArray = new String[] { pattern };
Filter idFilter = Filter.createSubstringFilter(OxTrustConstants.uniqueIdentifier, null, targetArray, null);
Filter friendlyNameFilter = Filter.createSubstringFilter(OxTrustConstants.friendlyName, null, targetArray, null);
Filter descriptionFilter = Filter.createSubstringFilter(OxTrustConstants.description, null, targetArray, null);
Filter inameFilter = Filter.createSubstringFilter(OxTrustConstants.iname, null, targetArray, null);
Filter searchFilter = Filter.createORFilter(idFilter, friendlyNameFilter, descriptionFilter, inameFilter);
// search
List<LDAPRequestorPoolEntry> entries = ldapEntryManager.findEntries(getDnForLDAPRequestorPoolEntry(null), LDAPRequestorPoolEntry.class, searchFilter, sizeLimit);
// convert result
List<RequestorPoolEntry> ret = new ArrayList<RequestorPoolEntry>();
for (LDAPRequestorPoolEntry entry : entries) {
ret.add(entry.getEntry());
}
return ret;
}
use of org.gluu.asimba.util.ldap.sp.LDAPRequestorPoolEntry in project oxTrust by GluuFederation.
the class AsimbaService method loadRequestorPools.
public List<RequestorPoolEntry> loadRequestorPools() {
List<LDAPRequestorPoolEntry> entries = ldapEntryManager.findEntries(getDnForLDAPRequestorPoolEntry(null), LDAPRequestorPoolEntry.class, null);
List<RequestorPoolEntry> result = new ArrayList<RequestorPoolEntry>();
for (LDAPRequestorPoolEntry entry : entries) {
result.add(entry.getEntry());
}
return result;
}
use of org.gluu.asimba.util.ldap.sp.LDAPRequestorPoolEntry in project oxTrust by GluuFederation.
the class AsimbaService method removeRequestorPoolEntry.
/**
* Remove LDAPRequestorPoolEntry.
*
* @param entry LDAPRequestorPoolEntry
*/
public void removeRequestorPoolEntry(RequestorPoolEntry entry) {
LDAPRequestorPoolEntry ldapEntry = ldapEntryManager.find(LDAPRequestorPoolEntry.class, getDnForLDAPRequestorPoolEntry(entry.getInum()));
ldapEntry.setEntry(entry);
ldapEntryManager.remove(ldapEntry);
}
Aggregations