use of org.gluu.persist.model.base.SimpleBranch in project oxAuth by GluuFederation.
the class StatService method createBranch.
public void createBranch(String branchDn, String ou) {
try {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName(ou);
branch.setDn(branchDn);
entryManager.persist(branch);
} catch (EntryPersistenceException ex) {
// Check if another process added this branch already
if (!entryManager.contains(branchDn, SimpleBranch.class)) {
throw ex;
}
}
}
use of org.gluu.persist.model.base.SimpleBranch in project oxAuth by GluuFederation.
the class UmaPctService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("pct");
branch.setDn(branchBaseDn());
ldapEntryManager.persist(branch);
}
use of org.gluu.persist.model.base.SimpleBranch in project oxCore by GluuFederation.
the class NativePersistenceCacheProvider method create.
@Override
public void create() {
try {
baseDn = cacheConfiguration.getNativePersistenceConfiguration().getBaseDn();
deleteExpiredOnGetRequest = cacheConfiguration.getNativePersistenceConfiguration().isDeleteExpiredOnGetRequest();
if (StringUtils.isBlank(baseDn)) {
log.error("Failed to create NATIVE_PERSISTENCE cache provider. 'baseDn' in CacheConfiguration is not initialized. It has to be set by client application (e.g. oxAuth has to set it in ApplicationFactory.)");
throw new RuntimeException("Failed to create NATIVE_PERSISTENCE cache provider. 'baseDn' in CacheConfiguration is not initialized. It has to be set by client application.");
}
String branchDn = String.format("ou=cache,%s", baseDn);
if (entryManager.hasBranchesSupport(branchDn)) {
if (!entryManager.contains(branchDn, SimpleBranch.class)) {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("cache");
branch.setDn(branchDn);
entryManager.persist(branch);
}
}
baseDn = branchDn;
cacheConfiguration.getNativePersistenceConfiguration().setBaseDn(baseDn);
String persistenceType = entryManager.getPersistenceType(baseDn);
// CouchbaseEntryManagerFactory.PERSISTENCE_TYPE
skipRemoveBeforePut = "couchbase".equals(persistenceType);
attemptUpdateBeforeInsert = "sql".equals(persistenceType);
log.info("Created NATIVE_PERSISTENCE cache provider. `baseDn`: " + baseDn);
} catch (Exception e) {
log.error("Failed to create NATIVE_PERSISTENCE cache provider.", e);
throw new RuntimeException("Failed to create NATIVE_PERSISTENCE cache provider.", e);
}
}
use of org.gluu.persist.model.base.SimpleBranch in project oxCore by GluuFederation.
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 org.gluu.persist.model.base.SimpleBranch in project oxTrust by GluuFederation.
the class PasswordResetService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("resetPasswordRequests");
branch.setDn(getDnForPasswordResetRequest(null));
ldapEntryManager.persist(branch);
}
Aggregations