Revision 60864
Added by Michele Artini about 3 years ago
EnrichDatasetsPlugin.java | ||
---|---|---|
9 | 9 |
import org.apache.commons.lang3.StringUtils; |
10 | 10 |
import org.apache.commons.logging.Log; |
11 | 11 |
import org.apache.commons.logging.LogFactory; |
12 |
import org.springframework.beans.factory.annotation.Autowired; |
|
12 | 13 |
import org.springframework.beans.factory.annotation.Value; |
13 | 14 |
|
14 | 15 |
import com.google.gson.Gson; |
15 | 16 |
import com.google.gson.reflect.TypeToken; |
17 |
import com.mongodb.MongoClient; |
|
18 |
import com.mongodb.client.MongoCollection; |
|
16 | 19 |
|
17 | 20 |
import eu.dnetlib.data.mdstore.plugins.objects.Dataset; |
18 | 21 |
import eu.dnetlib.data.mdstore.plugins.objects.MdRecord; |
... | ... | |
29 | 32 |
@Value("${plugin.enrich.dataset.dli.url}") |
30 | 33 |
private String baseUrl; |
31 | 34 |
|
35 |
@Autowired |
|
36 |
private MongoClient mongoClient; |
|
37 |
|
|
32 | 38 |
private Counter enrichDatasetsCounter = new Counter(); |
33 | 39 |
|
34 | 40 |
@Override |
... | ... | |
48 | 54 |
} |
49 | 55 |
|
50 | 56 |
@Override |
57 |
protected MongoCollection<org.bson.Document> getCacheCollection() { |
|
58 |
return mongoClient.getDatabase("API_CACHES").getCollection("DATASETS_API_CACHE"); |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
51 | 62 |
protected boolean updateDocument(final MdRecord doc, final String response) { |
52 | 63 |
|
53 | 64 |
doc.getDatasets().clear(); |
Also available in: Unified diff
API Cache