use of org.springframework.data.mongodb.core.query.Query in project cas by apereo.
the class U2FMongoDbDeviceRepository method removeAll.
@Override
public void removeAll() {
val query = new Query();
query.addCriteria(Criteria.where("createdDate").exists(true));
mongoTemplate.remove(query, U2FDeviceRegistration.class, casProperties.getAuthn().getMfa().getU2f().getMongo().getCollection());
}
use of org.springframework.data.mongodb.core.query.Query in project cas by apereo.
the class MongoDbYubiKeyAccountRegistry method delete.
@Override
public void delete(final String uid) {
val query = new Query();
query.addCriteria(Criteria.where(MongoDbYubiKeyAccount.FIELD_USERNAME).is(uid));
this.mongoTemplate.remove(query, MongoDbYubiKeyAccount.class, this.collectionName);
}
use of org.springframework.data.mongodb.core.query.Query in project cas by apereo.
the class MongoDbCasEventRepository method load.
@Override
public Stream<? extends CasEvent> load(final ZonedDateTime dateTime) {
val query = new Query();
query.addCriteria(Criteria.where(CREATION_TIME_PARAM).gte(dateTime.toString()));
return this.mongoTemplate.stream(query, CasEvent.class, this.collectionName).stream();
}
use of org.springframework.data.mongodb.core.query.Query in project cas by apereo.
the class MongoDbCasEventRepository method getEventsOfTypeForPrincipal.
@Override
public Stream<? extends CasEvent> getEventsOfTypeForPrincipal(final String type, final String principal) {
val query = new Query();
query.addCriteria(Criteria.where(TYPE_PARAM).is(type).and(PRINCIPAL_ID_PARAM).is(principal));
return this.mongoTemplate.stream(query, CasEvent.class, this.collectionName).stream();
}
use of org.springframework.data.mongodb.core.query.Query in project cas by apereo.
the class MongoDbCasEventRepository method getEventsOfTypeForPrincipal.
@Override
public Stream<? extends CasEvent> getEventsOfTypeForPrincipal(final String type, final String principal, final ZonedDateTime dateTime) {
val query = new Query();
query.addCriteria(Criteria.where(TYPE_PARAM).is(type).and(PRINCIPAL_ID_PARAM).is(principal).and(CREATION_TIME_PARAM).gte(dateTime.toString()));
return this.mongoTemplate.stream(query, CasEvent.class, this.collectionName).stream();
}
Aggregations