use of org.xdi.ldap.model.SimpleBranch in project oxTrust by GluuFederation.
the class ResourceSetService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("resource_sets");
branch.setDn(getDnForResourceSet(null));
ldapEntryManager.persist(branch);
}
use of org.xdi.ldap.model.SimpleBranch in project oxTrust by GluuFederation.
the class PushApplicationService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("application");
branch.setDn(getDnForPushApplication(null));
ldapEntryManager.persist(branch);
}
use of org.xdi.ldap.model.SimpleBranch in project oxTrust by GluuFederation.
the class PushDeviceService method addBranch.
public void addBranch() {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("device");
branch.setDn(getDnForPushDevice(null));
ldapEntryManager.persist(branch);
}
use of org.xdi.ldap.model.SimpleBranch in project oxCore by GluuFederation.
the class MetricService method removeExpiredMetricEntries.
public void removeExpiredMetricEntries(int batchSize, final Date expirationDate, final ApplicationType applicationType, final String applianceInum) {
final Set<String> keepBaseDnForPeriod = getBaseDnForPeriod(applicationType, applianceInum, expirationDate, new Date());
// Remove expired entries
for (final String baseDnForPeriod : keepBaseDnForPeriod) {
BatchOperation<MetricEntry> metricEntryBatchOperation = new BatchOperation<MetricEntry>(ldapEntryManager) {
@Override
protected List<MetricEntry> getChunkOrNull(int batchSize) {
return getExpiredMetricEntries(this, batchSize, baseDnForPeriod, expirationDate);
}
@Override
protected void performAction(List<MetricEntry> objects) {
for (MetricEntry metricEntry : objects) {
remove(metricEntry);
}
}
};
metricEntryBatchOperation.iterateAllByChunks(batchSize);
}
BatchOperation<SimpleBranch> batchOperation = new BatchOperation<SimpleBranch>(ldapEntryManager) {
@Override
protected List<SimpleBranch> getChunkOrNull(int batchSize) {
return findAllPeriodBranches(this, batchSize, applicationType, applianceInum);
}
@Override
protected void performAction(List<SimpleBranch> objects) {
String baseDn = buildDn(null, null, applicationType, applianceInum);
Set<String> periodBranchesStrings = new HashSet<String>();
for (SimpleBranch periodBranch : objects) {
if (!StringHelper.equalsIgnoreCase(baseDn, periodBranch.getDn())) {
periodBranchesStrings.add(periodBranch.getDn());
}
}
periodBranchesStrings.removeAll(keepBaseDnForPeriod);
// Remove expired months
for (String baseDnForPeriod : periodBranchesStrings) {
removeBranch(baseDnForPeriod);
}
}
};
batchOperation.iterateAllByChunks(batchSize);
}
use of org.xdi.ldap.model.SimpleBranch in project oxAuth by GluuFederation.
the class PairwiseIdentifierService method addBranch.
public void addBranch(final String userInum) {
SimpleBranch branch = new SimpleBranch();
branch.setOrganizationalUnitName("pairwiseIdentifiers");
branch.setDn(getBaseDnForPairwiseIdentifiers(userInum));
ldapEntryManager.persist(branch);
}
Aggregations