use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class UmaPctService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("pct");
branch.setDn(branchBaseDn());
ldapEntryManager.persist(branch);
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class UmaResourceService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("resources");
branch.setDn(getDnForResource(null));
ldapEntryManager.persist(branch);
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class RegistrationPersistenceService method cleanup.
public void cleanup(Date now, int batchSize) {
// Cleaning expired entries
BatchOperation<Fido2RegistrationEntry> cleanerRegistrationBatchService = new ProcessBatchOperation<Fido2RegistrationEntry>() {
@Override
public void performAction(List<Fido2RegistrationEntry> entries) {
for (Fido2RegistrationEntry p : entries) {
log.debug("Removing Fido2 registration entry: {}, Creation date: {}", p.getChallange(), p.getCreationDate());
try {
persistenceEntryManager.remove(p);
} catch (Exception e) {
log.error("Failed to remove entry", e);
}
}
}
};
String baseDn = getDnForUser(null);
persistenceEntryManager.findEntries(baseDn, Fido2RegistrationEntry.class, getExpiredRegistrationFilter(baseDn), SearchScope.SUB, new String[] { "jansCodeChallenge", "creationDate" }, cleanerRegistrationBatchService, 0, 0, batchSize);
String branchDn = getDnForUser(null);
if (persistenceEntryManager.hasBranchesSupport(branchDn)) {
// Cleaning empty branches
BatchOperation<SimpleBranch> cleanerBranchBatchService = new ProcessBatchOperation<SimpleBranch>() {
@Override
public void performAction(List<SimpleBranch> entries) {
for (SimpleBranch p : entries) {
try {
persistenceEntryManager.remove(p);
} catch (Exception e) {
log.error("Failed to remove entry", e);
}
}
}
};
persistenceEntryManager.findEntries(branchDn, SimpleBranch.class, getEmptyRegistrationBranchFilter(), SearchScope.SUB, new String[] { "ou" }, cleanerBranchBatchService, 0, 0, batchSize);
}
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class UmaPermissionService method addBranch.
public void addBranch(String clientDn) {
final SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName(ORGUNIT_OF_RESOURCE_PERMISSION);
branch.setDn(getBranchDn(clientDn));
ldapEntryManager.persist(branch);
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class UmaRptService method addBranch.
public void addBranch() {
final SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName(ORGUNIT_OF_RPT);
branch.setDn(branchDn());
ldapEntryManager.persist(branch);
}
Aggregations