Skip to content
Snippets Groups Projects
Commit dac945fb authored by Alan Braz's avatar Alan Braz
Browse files

migration from Cloudant to CouchDB

parent 227d665f
No related branches found
No related tags found
1 merge request!6Trusted ibm
......@@ -30,23 +30,32 @@ import com.cloudant.client.api.Database;
@Repository
public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
@Inject
private JaxRsDpsLog logger;
@Value("${ibm.cloudant.url}")
private String url;
@Value("${ibm.cloudant.apikey}")
@Value("${ibm.db.url}")
private String dbUrl;
@Value("${ibm.db.apikey:#{null}}")
private String apiKey;
@Value("${ibm.cloudant.dbname.prefix:local-dev}")
@Value("${ibm.db.user:#{null}}")
private String dbUser;
@Value("${ibm.db.password:#{null}}")
private String dbPassword;
@Value("${ibm.env.prefix:local-dev}")
private String dbNamePrefix;
private IBMCloudantClientFactory cloudantFactory;
private Database db;
@Inject
private JaxRsDpsLog logger;
@PostConstruct
public void init(){
try {
IBMCloudantClientFactory cloudantFactory = new IBMCloudantClientFactory(new ServiceCredentials(url, apiKey));
db = cloudantFactory.getDatabase(dbNamePrefix, "SearchSettings");
if (apiKey != null) {
cloudantFactory = new IBMCloudantClientFactory(new ServiceCredentials(dbUrl, apiKey));
} else {
cloudantFactory = new IBMCloudantClientFactory(new ServiceCredentials(dbUrl, dbUser, dbPassword));
} db = cloudantFactory.getDatabase(dbNamePrefix, "SearchSettings");
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -33,11 +33,15 @@ STORAGE_QUERY_RECORD_HOST=${storage_service_url}/api/storage/v2/query/records
STORAGE_QUERY_RECORD_FOR_CONVERSION_HOST=${storage_service_url}/api/storage/v2/query/records:batch
STORAGE_RECORDS_BATCH_SIZE=20
ibm.cloudant.url=REPLACE_ME
ibm.cloudant.apikey=REPLACE_ME
ibm.db.url=REPLACE_ME
## use apikey or user/password
ibm.db.user=REPLACE_ME
ibm.db.password=REPLACE_ME
ibm.tenant.cloudant.url=${ibm.cloudant.url}
ibm.tenant.cloudant.apikey=${ibm.cloudant.apikey}
ibm.tenant.db.url=${ibm.db.url}
## use apikey or user/password
ibm.tenant.db.user=${ibm.db.user}
ibm.tenant.db.password=${ibm.db.password}
ibm.rabbitmq.uri=REPLACE_ME
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment