use of com.sun.identity.sm.CachedSubEntries in project OpenAM by OpenRock.
the class ImportServiceConfiguration method deleteOuServicesDescendents.
private void deleteOuServicesDescendents(SSOToken ssoToken, String ouServices) throws SSOException, SMSException {
CachedSubEntries smsEntry = CachedSubEntries.getInstance(ssoToken, ouServices);
Set children = smsEntry.searchSubOrgNames(ssoToken, "*", false);
for (Iterator i = children.iterator(); i.hasNext(); ) {
String child = (String) i.next();
child = "o=" + child + "," + ouServices;
SMSEntry s = new SMSEntry(ssoToken, child);
s.delete();
}
{
// hardcoding hidden realm, cannot find a better option.
SMSEntry s = new SMSEntry(ssoToken, "o=sunamhiddenrealmdelegationservicepermissions," + ouServices);
s.delete();
}
children = smsEntry.getSubEntries(ssoToken, "*");
for (Iterator i = children.iterator(); i.hasNext(); ) {
String child = (String) i.next();
child = "ou=" + child + "," + ouServices;
SMSEntry s = new SMSEntry(ssoToken, child);
s.delete();
}
ServiceManager mgr = new ServiceManager(ssoToken);
mgr.clearCache();
AMIdentityRepository.clearCache();
}
Aggregations