use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class ExpirationNotificatorTimer method fillSessions.
private void fillSessions(Date future) {
final String baseDn = staticConfiguration.getBaseDn().getSessions();
final Filter filter = Filter.createANDFilter(Filter.createEqualityFilter("del", true), Filter.createLessOrEqualFilter("exp", persistenceEntryManager.encodeTime(baseDn, future)));
final List<SessionId> sessions = persistenceEntryManager.findEntries(baseDn, SessionId.class, filter);
if (sessions == null || sessions.isEmpty()) {
return;
}
long now = new Date().getTime();
for (SessionId session : sessions) {
final long duration = session.getExpirationDate().getTime() - now;
if (duration <= 0) {
remove(session);
continue;
}
expiringMap.put(new ExpId(session.getId(), ExpType.SESSION), session, duration, TimeUnit.MILLISECONDS);
}
}
use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class DeviceRegistrationService method getCountDeviceRegistrations.
public int getCountDeviceRegistrations(String appId) {
String baseDn = userService.getDnForUser(null);
Filter appIdFilter = Filter.createEqualityFilter("oxApplication", appId);
Filter activeDeviceFilter = Filter.createEqualityFilter("oxStatus", DeviceRegistrationStatus.ACTIVE.getValue());
Filter resultFilter = Filter.createANDFilter(appIdFilter, activeDeviceFilter);
return ldapEntryManager.countEntries(baseDn, DeviceRegistration.class, resultFilter);
}
use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class DeviceRegistrationService method getExpiredDeviceRegistrations.
public List<DeviceRegistration> getExpiredDeviceRegistrations(BatchOperation<DeviceRegistration> batchOperation, Date expirationDate, String[] returnAttributes, int sizeLimit, int chunkSize) {
final String u2fBaseDn = getDnForOneStepU2fDevice(null);
Filter expirationFilter = Filter.createLessOrEqualFilter("creationDate", ldapEntryManager.encodeTime(u2fBaseDn, expirationDate));
List<DeviceRegistration> deviceRegistrations = ldapEntryManager.findEntries(u2fBaseDn, DeviceRegistration.class, expirationFilter, SearchScope.SUB, returnAttributes, batchOperation, 0, sizeLimit, chunkSize);
return deviceRegistrations;
}
use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class RequestService method getExpiredRequestMessages.
public List<RequestMessageLdap> getExpiredRequestMessages(BatchOperation<RequestMessageLdap> batchOperation, Date expirationDate, String[] returnAttributes, int sizeLimit, int chunkSize) {
// ou=u2f,o=gluu
final String u2fBaseDn = staticConfiguration.getBaseDn().getU2fBase();
Filter expirationFilter = Filter.createLessOrEqualFilter("creationDate", ldapEntryManager.encodeTime(u2fBaseDn, expirationDate));
List<RequestMessageLdap> requestMessageLdap = ldapEntryManager.findEntries(u2fBaseDn, RequestMessageLdap.class, expirationFilter, SearchScope.SUB, returnAttributes, batchOperation, 0, sizeLimit, chunkSize);
return requestMessageLdap;
}
use of org.gluu.search.filter.Filter in project oxAuth by GluuFederation.
the class UserService method countFido2RegisteredDevices.
public long countFido2RegisteredDevices(String username) {
String userInum = getUserInum(username);
if (userInum == null) {
return 0;
}
String baseDn = getBaseDnForFido2RegistrationEntries(userInum);
if (persistenceEntryManager.hasBranchesSupport(baseDn)) {
if (!persistenceEntryManager.contains(baseDn, SimpleBranch.class)) {
return 0;
}
}
Filter userInumFilter = Filter.createEqualityFilter("personInum", userInum);
Filter registeredFilter = Filter.createEqualityFilter("oxStatus", "registered");
Filter filter = Filter.createANDFilter(userInumFilter, registeredFilter);
long countEntries = persistenceEntryManager.countEntries(baseDn, Fido2RegistrationEntry.class, filter);
return countEntries;
}
Aggregations