use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class MetricService method addBranch.
public void addBranch(String branchDn, String ou) {
if (getEntryManager().hasBranchesSupport(branchDn)) {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName(ou);
branch.setDn(branchDn);
getEntryManager().persist(branch);
}
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class RegistrationPersistenceService method addBranch.
public void addBranch(final String baseDn) {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("fido2_register");
branch.setDn(baseDn);
persistenceEntryManager.persist(branch);
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class AuthenticationPersistenceService method addBranch.
public void addBranch(final String baseDn) {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("fido2_auth");
branch.setDn(baseDn);
persistenceEntryManager.persist(branch);
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class AuthenticationPersistenceService method cleanup.
public void cleanup(Date now, int batchSize) {
// Cleaning expired entries
BatchOperation<Fido2AuthenticationEntry> cleanerAuthenticationBatchService = new ProcessBatchOperation<Fido2AuthenticationEntry>() {
@Override
public void performAction(List<Fido2AuthenticationEntry> entries) {
for (Fido2AuthenticationEntry p : entries) {
log.debug("Removing Fido2 authentication 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, Fido2AuthenticationEntry.class, getExpiredAuthenticationFilter(baseDn), SearchScope.SUB, new String[] { "jansCodeChallenge", "creationDate" }, cleanerAuthenticationBatchService, 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(getDnForUser(null), SimpleBranch.class, getEmptyAuthenticationBranchFilter(), SearchScope.SUB, new String[] { "ou" }, cleanerBranchBatchService, 0, 0, batchSize);
}
}
use of io.jans.orm.model.base.SimpleBranch in project jans by JanssenProject.
the class ClientAuthorizationsService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("authorizations");
branch.setDn(createDn(null));
ldapEntryManager.persist(branch);
}
Aggregations