21 |
21 |
import org.apache.commons.logging.LogFactory;
|
22 |
22 |
import org.bson.Document;
|
23 |
23 |
import org.bson.conversions.Bson;
|
|
24 |
import org.springframework.beans.factory.annotation.Required;
|
24 |
25 |
|
25 |
26 |
public class DnetLoggerMongoDao implements DnetLoggerDao {
|
26 |
27 |
|
... | ... | |
107 |
108 |
}
|
108 |
109 |
|
109 |
110 |
@Override
|
110 |
|
public Iterator<Map<String, String>> findByDateRange(final String collection, final Date startDate, final Date endDate, final String key, final String value) {
|
|
111 |
public Iterator<Map<String, String>> findByDateRange(final String collection,
|
|
112 |
final Date startDate,
|
|
113 |
final Date endDate,
|
|
114 |
final String key,
|
|
115 |
final String value) {
|
111 |
116 |
final MongoCollection coll = db.getCollection(collection);
|
112 |
117 |
final Bson query = Filters.and(getBasicQuery(key, value), getDateQuery(startDate, endDate));
|
113 |
118 |
return iter(coll.find(query).iterator());
|
114 |
119 |
}
|
115 |
120 |
|
116 |
121 |
@Override
|
117 |
|
public Iterator<Map<String, String>> findByDateRange(final String collection, final Date startDate, final Date endDate, final Map<String, Object> criteria) {
|
|
122 |
public Iterator<Map<String, String>> findByDateRange(final String collection,
|
|
123 |
final Date startDate,
|
|
124 |
final Date endDate,
|
|
125 |
final Map<String, Object> criteria) {
|
118 |
126 |
final MongoCollection coll = db.getCollection(collection);
|
119 |
127 |
final Bson query = Filters.and(getCustomQuery(criteria), getDateQuery(startDate, endDate));
|
120 |
128 |
return iter(coll.find(query).iterator());
|
... | ... | |
180 |
188 |
return res;
|
181 |
189 |
}
|
182 |
190 |
|
|
191 |
public MongoDatabase getDb() {
|
|
192 |
return db;
|
|
193 |
}
|
|
194 |
|
|
195 |
@Required
|
|
196 |
public void setDb(final MongoDatabase db) {
|
|
197 |
this.db = db;
|
|
198 |
}
|
183 |
199 |
}
|
Re-added Mongo DB bean to logger, as it is currently needed to a class for updating the LOD in dnet-openaireplus-workflows.