Fix mongo to pass with testsuite
This commit is contained in:
parent
a00d36eea2
commit
36cc298b32
1 changed files with 6 additions and 1 deletions
|
@ -128,6 +128,7 @@ public class MongoUserSessionProvider implements UserSessionProvider {
|
||||||
public List<UserSessionModel> getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults) {
|
public List<UserSessionModel> getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults) {
|
||||||
DBObject query = new QueryBuilder()
|
DBObject query = new QueryBuilder()
|
||||||
.and("clientId").is(client.getId())
|
.and("clientId").is(client.getId())
|
||||||
|
.and("sessionId").notEquals(null)
|
||||||
.get();
|
.get();
|
||||||
DBObject sort = new BasicDBObject("timestamp", 1).append("id", 1);
|
DBObject sort = new BasicDBObject("timestamp", 1).append("id", 1);
|
||||||
|
|
||||||
|
@ -142,7 +143,11 @@ public class MongoUserSessionProvider implements UserSessionProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getActiveUserSessions(RealmModel realm, ClientModel client) {
|
public int getActiveUserSessions(RealmModel realm, ClientModel client) {
|
||||||
return getUserSessions(realm, client).size();
|
DBObject query = new QueryBuilder()
|
||||||
|
.and("clientId").is(client.getId())
|
||||||
|
.and("sessionId").notEquals(null)
|
||||||
|
.get();
|
||||||
|
return mongoStore.countEntities(MongoClientSessionEntity.class, query, invocationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue