Project

General

Profile

« Previous | Next » 

Revision 45455

Included changes about the CQL translation as in most recent version of cnr-cql-utils of DNet40 + refactoring of OAI parameters

View differences:

EnsureIndexesAction.java
4 4
import eu.dnetlib.enabling.tools.blackboard.BlackboardServerHandler;
5 5
import eu.dnetlib.oai.mongo.MongoPublisherStore;
6 6
import eu.dnetlib.oai.mongo.MongoPublisherStoreDAO;
7
import eu.dnetlib.oai.utils.OAIParameterNames;
7 8
import org.apache.commons.lang3.StringUtils;
8 9
import org.apache.commons.logging.Log;
9 10
import org.apache.commons.logging.LogFactory;
......
19 20
	@Override
20 21
	public void execute(final BlackboardServerHandler handler, final BlackboardJob job) throws Exception {
21 22
		try {
22
			final String storeId = job.getParameters().get("collection");
23
			final String dbName = job.getParameters().get("oai_dbName");
23
			String storeId = job.getParameters().get(OAIParameterNames.OAI_COLLECTON);
24
			String dbName = job.getParameters().get(OAIParameterNames.OAI_DB);
24 25
			if (StringUtils.isBlank(storeId)) {
25 26
				log.info("Ensuring index on all OAI store");
26 27
				this.mongoPublisherStoreDAO.ensureIndex(dbName);
27 28
			} else {
28 29
				log.info("Ensuring index on " + storeId + " only");
29
				final MongoPublisherStore store = this.mongoPublisherStoreDAO.getStore(storeId, dbName);
30
				MongoPublisherStore store = this.mongoPublisherStoreDAO.getStore(storeId, dbName);
30 31
				store.ensureIndices();
31 32
			}
32 33
			handler.done(job);

Also available in: Unified diff